GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FES / V6-4-2 > fes / i845e


Interface   Data Structures   File List   Data Fields   Globals  

fesCtlP.h File Reference

Private definitions for the control system. More...

#include <fesBootParams.h>
#include <fesBufLib.h>
#include <fesConfig.h>
#include <fesDataFmt.h>
#include <fesDevice.h>
#include <fesFeed.h>
#include <fesFile.h>
#include <fesMemTest.h>
#include <fesMisc.h>
#include <fesMon.h>
#include <fesParm.h>
#include <fesReader.h>
#include <fesRegs.h>
#include <fesRun.h>

Classes

struct  ctlNode_s
 Control information for worker node. More...
struct  ctlBoard_s
 System-wide board indices. More...
struct  ctlMsgNoData_s
 Message used for dataless commands. More...
struct  ctlMsgRunInit_s
 Message used to initialize a run. More...
struct  ctlMsgRunTest_s
 Message used to initialize a test run. More...
struct  ctlMsgRunStatGet_s
 Message used to request run status. More...
struct  ctlMsgRunStat_s
 Message used to send run status. More...
struct  ctlMsgRunState_s
 Message used to send run state. More...
struct  ctlMsgState_s
 Message used to send system state. More...
struct  ctlMsgBoard_s
 Message used to send board data. More...
struct  ctlMsgDevInfoGet_s
 Message used to request device information. More...
struct  ctlMsgDevInfo_s
 Message used to send device information. More...
struct  ctlMsgMemoryGet_s
 Message used to request memory contents. More...
struct  ctlMsgMemory_s
 Message used to send memory contents. More...
struct  ctlMsgTestData_s
 Message used to generate test data. More...
struct  ctlMsgTrigData_s
 Message used to generate trigger test data. More...
struct  ctlMsgMtStart_s
 Message used to start a memory test. More...
struct  ctlMsgMtStats_s
 Message used to send memory test statistics. More...
struct  ctlMsgMtErrsGet_s
 Message used to request memory test error data. More...
struct  ctlMsgMtErrs_s
 Message used to send memory test error data. More...
struct  ctlMsgBootParm_s
 Message used to set boot parameters. More...
struct  ctlMsgFileInfoGet_s
 Message used to get file information. More...
struct  ctlMsgFileInfo_s
 Message used to send file information. More...
struct  ctlMsgFileDelete_s
 Message used to delete a file. More...
struct  ctlMsgDirCreate_s
 Message used to create a directory. More...
struct  ctlMsgDiskInfoGet_s
 Message used to get disk information. More...
struct  ctlMsgDiskInfo_s
 Message used to send disk information. More...
struct  ctlMsgPedesLoad_s
 Message used to load pedestals. More...
struct  ctlMsgConstInfo_s
 Message used to send constituent information. More...
struct  ctlMsgPedesGet_s
 Message used to get pedestal data. More...
struct  ctlMsgPedesData_s
 Message used to send pedestal data. More...
struct  ctlMsgRCRegGet_s
 Message used to get RC register data. More...
struct  ctlMsgRCRegData_s
 Message used to send RC register data. More...
struct  ctlMsgFERegGet_s
 Message used to get FE register data. More...
struct  ctlMsgFERegData_s
 Message used to send FE register data. More...
struct  ctlMsgMonData_s
 Message used to send monitored data. More...
struct  ctlMsgDataJoin_s
 Message used to join data file sets. More...
struct  ctlMsgNetStats_s
 Message used to send network statistics. More...
struct  ctlMsgRdrStat_s
 Message used to send reader statistics. More...
struct  ctlMsgFeedStat_s
 Message used to send memory feeder statistics. More...
struct  ctlMsgBufStat_s
 Message used to send buffer pool statistics. More...
union  ctlMsgAll_u
 Union of all message types. More...
struct  ctlBcast_s
 Broadcast data, one set per worker node. More...

Defines

#define DATASZ(x)   (sizeof(x) - sizeof((x).head))
 The size of the data portion of a message.
#define CTL_MAX_MSG_LENG   (sizeof(ctlMsgAll_t) - sizeof(nmsgHead_t))
 Maximum message data length.

Typedefs

typedef enum
ctlFuncCode_e 
ctlFuncCode_t
 Control function codes.
typedef enum
ctlFuncType_e 
ctlFuncType_t
 Control function types.
typedef enum
ctlBcstStat_e 
ctlBcstStat_t
 Broadcast status value.
typedef struct ctlNode_s ctlNode_t
 Control information for worker node.
typedef struct ctlBoard_s ctlBoard_t
 System-wide board indices.
typedef struct
ctlMsgNoData_s 
ctlMsgNoData_t
 Message used for dataless commands.
typedef struct
ctlMsgRunInit_s 
ctlMsgRunInit_t
 Message used to initialize a run.
typedef struct
ctlMsgRunTest_s 
ctlMsgRunTest_t
 Message used to initialize a test run.
typedef struct
ctlMsgRunStatGet_s 
ctlMsgRunStatGet_t
 Message used to request run status.
typedef struct
ctlMsgRunStat_s 
ctlMsgRunStat_t
 Message used to send run status.
typedef struct
ctlMsgRunState_s 
ctlMsgRunState_t
 Message used to send run state.
typedef struct
ctlMsgState_s 
ctlMsgState_t
 Message used to send system state.
typedef struct
ctlMsgBoard_s 
ctlMsgBoard_t
 Message used to send board data.
typedef struct
ctlMsgDevInfoGet_s 
ctlMsgDevInfoGet_t
 Message used to request device information.
typedef struct
ctlMsgDevInfo_s 
ctlMsgDevInfo_t
 Message used to send device information.
typedef struct
ctlMsgMemoryGet_s 
ctlMsgMemoryGet_t
 Message used to request memory contents.
typedef struct
ctlMsgMemory_s 
ctlMsgMemory_t
 Message used to send memory contents.
typedef struct
ctlMsgTestData_s 
ctlMsgTestData_t
 Message used to generate test data.
typedef struct
ctlMsgTrigData_s 
ctlMsgTrigData_t
 Message used to generate trigger test data.
typedef struct
ctlMsgMtStart_s 
ctlMsgMtStart_t
 Message used to start a memory test.
typedef struct
ctlMsgMtStats_s 
ctlMsgMtStats_t
 Message used to send memory test statistics.
typedef struct
ctlMsgMtErrsGet_s 
ctlMsgMtErrsGet_t
 Message used to request memory test error data.
typedef struct
ctlMsgMtErrs_s 
ctlMsgMtErrs_t
 Message used to send memory test error data.
typedef struct
ctlMsgBootParm_s 
ctlMsgBootParm_t
 Message used to set boot parameters.
typedef struct
ctlMsgFileInfoGet_s 
ctlMsgFileInfoGet_t
 Message used to get file information.
typedef struct
ctlMsgFileInfo_s 
ctlMsgFileInfo_t
 Message used to send file information.
typedef struct
ctlMsgFileDelete_s 
ctlMsgFileDelete_t
 Message used to delete a file.
typedef struct
ctlMsgDirCreate_s 
ctlMsgDirCreate_t
 Message used to create a directory.
typedef struct
ctlMsgDiskInfoGet_s 
ctlMsgDiskInfoGet_t
 Message used to get disk information.
typedef struct
ctlMsgDiskInfo_s 
ctlMsgDiskInfo_t
 Message used to send disk information.
typedef struct
ctlMsgPedesLoad_s 
ctlMsgPedesLoad_t
 Message used to load pedestals.
typedef struct
ctlMsgConstInfo_s 
ctlMsgConstInfo_t
 Message used to send constituent information.
typedef struct
ctlMsgPedesGet_s 
ctlMsgPedesGet_t
 Message used to get pedestal data.
typedef struct
ctlMsgPedesData_s 
ctlMsgPedesData_t
 Message used to send pedestal data.
typedef struct
ctlMsgRCRegGet_s 
ctlMsgRCRegGet_t
 Message used to get RC register data.
typedef struct
ctlMsgRCRegData_s 
ctlMsgRCRegData_t
 Message used to send RC register data.
typedef struct
ctlMsgFERegGet_s 
ctlMsgFERegGet_t
 Message used to get FE register data.
typedef struct
ctlMsgFERegData_s 
ctlMsgFERegData_t
 Message used to send FE register data.
typedef struct
ctlMsgMonData_s 
ctlMsgMonData_t
 Message used to send monitored data.
typedef struct
ctlMsgDataJoin_s 
ctlMsgDataJoin_t
 Message used to join data file sets.
typedef struct
ctlMsgNetStats_s 
ctlMsgNetStats_t
 Message used to send network statistics.
typedef struct
ctlMsgRdrStat_s 
ctlMsgRdrStat_t
 Message used to send reader statistics.
typedef struct
ctlMsgFeedStat_s 
ctlMsgFeedStat_t
 Message used to send memory feeder statistics.
typedef struct
ctlMsgBufStat_s 
ctlMsgBufStat_t
 Message used to send buffer pool statistics.
typedef union ctlMsgAll_u ctlMsgAll_t
 Union of all message types.
typedef struct ctlBcast_s ctlBcast_t
 Broadcast data, one set per worker node.

Enumerations

enum  ctlFuncCode_e {
  CFN_INVALID = 0,
  CFN_RUN_INIT = 1,
  CFN_RUN_TERM = 3,
  CFN_RUN_STATUS_GET = 4,
  CFN_REBOOT = 5,
  CFN_HEARTBEAT = 6,
  CFN_RUN_TEST = 7,
  CFN_TEST_DATA = 8,
  CFN_BOARD_GET = 9,
  CFN_DEVICE_GET = 10,
  CFN_CODE_LOAD = 11,
  CFN_TRIG_DATA = 12,
  CFN_MT_START = 13,
  CFN_MT_STOP = 14,
  CFN_MT_STATS_GET = 15,
  CFN_MT_ERRS_GET = 16,
  CFN_BOOT_PARM_SET = 17,
  CFN_RUN_STATE_GET = 18,
  CFN_FILE_INFO_GET = 19,
  CFN_FILE_DELETE = 20,
  CFN_DIR_CREATE = 21,
  CFN_DISK_INFO_GET = 22,
  CFN_PEDES_LOAD = 23,
  CFN_DATA_INFO_GET = 24,
  CFN_MEMORY_GET = 25,
  CFN_CONST_GET = 26,
  CFN_STATE_GET = 27,
  CFN_PEDES_GET = 28,
  CFN_RCREG_GET = 29,
  CFN_FEREG_GET = 30,
  CFN_MON_GET = 31,
  CFN_DATA_JOIN = 32,
  CFN_NET_STATS_GET = 33,
  CFN_RUN_START = 34,
  CFN_RUN_PAUSE = 35,
  CFN_RDR_STAT_GET = 36,
  CFN_FEED_STAT_GET = 37,
  CFN_BUF_STAT_GET = 38,
  CFN_BUS_RESET = 39,
  CTL_MAX_CMND_FN = 39
}
 Control function codes. More...
enum  ctlFuncType_e {
  CFT_HIDDEN = 0,
  CFT_INFO = 1,
  CFT_ACTION = 2
}
 Control function types. More...
enum  ctlBcstStat_e {
  BCS_DSAB = -1,
  BCS_OK = 0,
  BCS_ERROR = 1,
  BCS_DISC = 2
}
 Broadcast status value. More...
enum  {
  CTL_MT_ERR_BUFF_LENG = 2000,
  CTL_MAX_CONST_ITEMS = 20
}
 Miscellaneous constants. More...

Functions

void fesCtlBcastFree (ctlBcast_t *bcast)
 Private routine to free a broadcast block.
const ctlBoard_tfesCtlBoard (int bIndx)
 Private routine to get a board's information.
int fesCtlCheckCtlNode (void)
 Private routine to check that we're running on the control node.
int fesCtlCheckStatus (ctlBcast_t *bcast)
 Private routine to check command status.
int fesCtlCountIncr (ctlFuncCode_t code)
 Private routine to increment a command counter.
int fesCtlFindBoard (const char *bName, int ctlOk, int *bIndx)
 Private routine to find the index of a board.
int fesCtlFindNode (const char *nName, ctlNode_t **node)
 Private routine to find control info for worker node.
int fesCtlHwUnit (void)
 Private routine to get the control board's hardware unit number.
int fesCtlNNode (void)
 Private routine to get the number of worker nodes.
ctlNode_tfesCtlNode (int nIndx)
 Private routine to get a node's information.
int fesCtlSendMsg (ctlNode_t *node, ctlMsgAll_t *msg)
 Private routine to send a command message.
int fesCtlSendMsgW (ctlNode_t *node, ctlMsgAll_t *msg, ctlMsgAll_t **replyP, ctlMsgAll_t *reply, int maxData)
 Private routine to send a command message and wait for reply.
int fesCtlSendToAll (ctlMsgAll_t *msg, ctlBcast_t **bcast, int lData)
 Private routine to broadcast a command message.
int fesCtlSendToSome (long long bMask, ctlMsgAll_t *msg, ctlBcast_t **bcast, int lData)
 Private routine to broadcast a command message for selected boards.
int fesCtlSrvrStart (void)
 Private routine to start the control server.


Detailed Description

Private definitions for the control system.

Author:
Owen H Saxton
$Id: fesCtlP.h,v 1.7 2010/08/19 23:25:13 saxton Exp $

Enumeration Type Documentation

anonymous enum

Miscellaneous constants.

Enumerator:
CTL_MT_ERR_BUFF_LENG  Buffer length for memory test errors.
CTL_MAX_CONST_ITEMS  Maximum constituent items to send.

enum ctlBcstStat_e

Broadcast status value.

Enumerator:
BCS_DSAB  Node disabled.
BCS_OK  Success.
BCS_ERROR  Network error.
BCS_DISC  Node disconnected.

enum ctlFuncCode_e

Control function codes.

Enumerator:
CFN_INVALID  Invalid placeholder.
CFN_RUN_INIT  Initialize run.
CFN_RUN_TERM  Terminate run.
CFN_RUN_STATUS_GET  Get run status.
CFN_REBOOT  Reboot.
CFN_HEARTBEAT  Heartbeat message.
CFN_RUN_TEST  Initialize test run.
CFN_TEST_DATA  Generate test data.
CFN_BOARD_GET  Get board information.
CFN_DEVICE_GET  Get device information.
CFN_CODE_LOAD  Load code into FPGAs.
CFN_TRIG_DATA  Generate trigger data.
CFN_MT_START  Start memory test.
CFN_MT_STOP  Stop memory test.
CFN_MT_STATS_GET  Get memory test stats.
CFN_MT_ERRS_GET  Get memory test errors.
CFN_BOOT_PARM_SET  Set boot parameters.
CFN_RUN_STATE_GET  Get run state.
CFN_FILE_INFO_GET  Get file information.
CFN_FILE_DELETE  Delete file.
CFN_DIR_CREATE  Create directory.
CFN_DISK_INFO_GET  Get disk information.
CFN_PEDES_LOAD  Load pedestals.
CFN_DATA_INFO_GET  Get data file info.
CFN_MEMORY_GET  Get memory contents.
CFN_CONST_GET  Get constituent data.
CFN_STATE_GET  Get system state.
CFN_PEDES_GET  Get pedestal data.
CFN_RCREG_GET  Get RC register data.
CFN_FEREG_GET  Get FE register data.
CFN_MON_GET  Get monitored data.
CFN_DATA_JOIN  Join data file sets.
CFN_NET_STATS_GET  Get network stats.
CFN_RUN_START  Start unsynch run.
CFN_RUN_PAUSE  Pause unsynch run.
CFN_RDR_STAT_GET  Get reader stats.
CFN_FEED_STAT_GET  Get memory feeder stats.
CFN_BUF_STAT_GET  Get buffer pool stats.
CFN_BUS_RESET  Reset bus.
CTL_MAX_CMND_FN  Number of codes.

enum ctlFuncType_e

Control function types.

Enumerator:
CFT_HIDDEN  Under the radar.
CFT_INFO  Get information.
CFT_ACTION  Take action.


Function Documentation

void fesCtlBcastFree ( ctlBcast_t bcast  ) 

Private routine to free a broadcast block.

This routine frees a previously allocated broadcast data table along with any associated reply buffers.

Parameters:
bcast The address of the broadcast block to be freed.

const ctlBoard_t* fesCtlBoard ( int  bIndx  ) 

Private routine to get a board's information.

This routine returns the address of the information block for the specified board.

Parameters:
bIndx The board's index.
Returns:
The address of the board's information.

int fesCtlCheckCtlNode ( void   ) 

Private routine to check that we're running on the control node.

This routine checks whether the code is running on the control node, and reports it if not.

Return values:
FES_SUCCESS Success.
FES_NOTCNTRL Not running on control node.

int fesCtlCheckStatus ( ctlBcast_t bcast  ) 

Private routine to check command status.

This routine checks the replies from the last command broadcast, reports if any had errors, and frees the broadcast block.

Parameters:
bcast The address of the broadcast block to be checked and freed.
Return values:
FES_SUCCESS No errors occurred.
FES_CMDERROR There were errors executing the command.

int fesCtlCountIncr ( ctlFuncCode_t  code  ) 

Private routine to increment a command counter.

The counter for the specified command is incremented.

Parameters:
code The command function code
Returns:
FES_SUCCESS Success, always.

int fesCtlFindBoard ( const char *  bName,
int  ctlOk,
int *  bIndx 
)

Private routine to find the index of a board.

This routine returns the index of the specified board.

Parameters:
bName The board name (type plus tower).
ctlOk If TRUE, the control board is allowed; otherwise not.
bIndx The address of a word to contain the returned index of the board's information.
Return values:
FES_SUCCESS Success.
FES_INVBNAME Unknown or invalid board name.

int fesCtlFindNode ( const char *  nName,
ctlNode_t **  node 
)

Private routine to find control info for worker node.

This routine returns the address of the control block associated with the specified worker node.

Parameters:
nName The name of the worker node.
node The address of a pointer to receive the address of the node's control block.
Return values:
FES_SUCCESS Success.
FES_UNKNODE The node is unknown.

int fesCtlHwUnit ( void   ) 

Private routine to get the control board's hardware unit number.

Returns:
The hardware unit number of the control board

int fesCtlNNode ( void   ) 

Private routine to get the number of worker nodes.

Returns:
The number of worker nodes

ctlNode_t* fesCtlNode ( int  nIndx  ) 

Private routine to get a node's information.

Parameters:
nIndx The index of the node
Returns:
The address of the information for the node

int fesCtlSendMsg ( ctlNode_t node,
ctlMsgAll_t msg 
)

Private routine to send a command message.

This routine sends a message to the specified worker node.

Parameters:
node The address of the control parameter block for the worker node.
msg The address of the message to be sent.
Return values:
FES_SUCCESS Success.
FES_EMSGSEND Error sending message

int fesCtlSendMsgW ( ctlNode_t node,
ctlMsgAll_t msg,
ctlMsgAll_t **  replyP,
ctlMsgAll_t reply,
int  maxData 
)

Private routine to send a command message and wait for reply.

This routine sends a message to the specified worker node and waits for the reply.

Parameters:
node The address of the control parameter block for the worker node.
msg The address of the message to be sent.
replyP The address of a pointer to receive the address of the reply. If this is not the same as the default reply area, its memory must be relinquished after use via a call to free().
reply The address of a default area to receive the reply, or NULL if no such area requested.
maxData The size of the data portion of the default reply.
Return values:
FES_SUCCESS Success.
FES_EMSGSEND Error sending message

int fesCtlSendToAll ( ctlMsgAll_t msg,
ctlBcast_t **  bcast,
int  lData 
)

Private routine to broadcast a command message.

This routine sends a message to all connected worker nodes.

Parameters:
msg The address of the message to be sent.
bcast The address of a pointer to an array of broadcast data, one item per worker node. If the pointer is NULL, a new array is allocated along with optional reply buffers, and its address returned.
lData The length of the data portion of each allocated reply buffer. If negative, no reply buffers are allocated.
Return values:
FES_SUCCESS Success.
FES_NOMEMORY Insufficient memory for broadcast data.

int fesCtlSendToSome ( long long  bMask,
ctlMsgAll_t msg,
ctlBcast_t **  bcast,
int  lData 
)

Private routine to broadcast a command message for selected boards.

This routine sends a message to all connected worker nodes, specifying which boards (units) on each node are affected.

Parameters:
bMask The 40-bit mask word specifying which boards are to be affected. Bits 0 - 15 select tracker boards 0 - 15; bits 16 - 31 select calorimeter boards 0 - 15; bits 32 - 39 select ACD boards 0 - 7.
msg The address of the message to be sent.
bcast The address of a pointer to a broadcast block. If the pointer is NULL, a new block is allocated along with optional reply buffers, and its address returned.
lData The length of the data portion of each allocated reply buffer. If negative, no buffers are allocated.
Return values:
FES_SUCCESS Success.
FES_NOMEMORY Insufficient memory for broadcast data.

int fesCtlSrvrStart ( void   ) 

Private routine to start the control server.

This routine starts the control server on a worker node.

Return values:
FES_SUCCESS Success
FES_ESRVSTRT Unable to start server.


Generated on Thu Aug 19 17:15:03 2010 by  doxygen 1.5.3