GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-0 > lcbb / mv2304
#include "PBI/Endianness.h"
#include "LCBD/LCB.h"
#include "LCBD/LATP.h"
Classes | |
struct | _LCBB_cfg_latp_bf |
Structure to define the LATP configuration information. More... | |
union | _LCBB_cfg_latp_us |
Union of the LATp bit field configuration structure with an unsigned short. More... | |
struct | _LCBB_cfg_latp_sv |
Defines a field selectable structure for those values one wishes to configure. More... | |
union | _LCBB_latp_cfg |
Union of the select/value bit field representation of the LATp configuration bits and an unsigned int. More... | |
struct | _LCBB_xtrace_ols_bf |
Defines the bit field representation of the opcode/length/status word. More... | |
union | _LCBB_xtrace_ols |
Union of the bit field representation of the OLS word and an uninterpretted unsigned short int. More... | |
struct | _LCBB_xtrace_rec |
Defines a transaction trace record. More... | |
struct | _LCBB_xtrace |
The trace buffer, this holds the transaction count and the last 8 transaction records. More... | |
struct | _LCBB_msg_hdr |
Layout of an unsolicited event message header. More... | |
struct | _LCBB_msg |
layout of an unsolicited event message More... | |
struct | _LCBB |
Control block for the LCBB driver. More... | |
Defines | |
#define | LCBB_OK 0 |
Generic success code. | |
#define | LCBB_XTRACE_REC_CNT 8 |
Count of the number of trace records. | |
#define | LCBB_MSG_CHECK(_msg) ((_msg)->hdr.ed.ui & LCB_EVT_DSC_STATUS) |
Checks the message for both transmit and receive errors. | |
Typedefs | |
typedef enum _LCBB_CFG_LATP_S | LCBB_CFG_LATP_S |
Typedef for enum _LCBB_CFG_LATP_S. | |
typedef enum _LCBB_CFG_LATP_V | LCBB_CFG_LATP_V |
Typedef for enum _LCBB_CFG_LATP_V. | |
typedef enum _LCBB_CFG_LATP_M | LCBB_CFG_LATP_M |
Typedef for enum _LCBB_CFG_LATP_M. | |
typedef struct _LCBB_cfg_latp_bf | LCBB_cfg_latp_bf |
Typedef for struct _LCBB_cfg_latp_bf. | |
typedef union _LCBB_cfg_latp_us | LCBB_cfg_latp_us |
Typedef for union _LCBB_latp_us. | |
typedef struct _LCBB_cfg_latp_sv | LCBB_cfg_latp_sv |
Typedef for struct _LCBB_cfg_latp_sv. | |
typedef union _LCBB_latp_cfg | LCBB_latp_cfg |
Typedef for union _LCBB_latp_cfg. | |
typedef enum _LCBB_XTRACE_OLS_S | LCBB_XTRACE_OLS_S |
Typedef for enum _LCBB_XTRACE_OLS_S. | |
typedef enum _LCBB_XTRACE_OLS_V | LCBB_XTRACE_OLS_V |
Typedef for enum _LCBB_XTRACE_OLS_V. | |
typedef enum _LCBB_XTRACE_OLS_M | LCBB_XTRACE_OLS_M |
Typedef for enum _LCBB_XTRACE_OLS_M. | |
typedef enum _LCBB_XTRACE_OLS_STATUS_K | LCBB_XTRACE_OLS_STATUS_K |
Typedef for enum _LCBB_XTRACE_OLS_STATUS_K. | |
typedef enum _LCBB_XTRACE_OLS_STATUS_M | LCBB_XTRACE_OLS_STATUS_M |
Typedef for enum _LCBB_XTRACE_OLS_STATUS_M. | |
typedef struct _LCBB_xtrace_ols_bf | LCBB_xtrace_ols_bf |
Typedef for struct _LCBB_xtrace_ols_bf. | |
typedef union _LCBB_xtrace_ols | LCBB_xtrace_ols |
Typedef for union _LCBB_xtrace_ols. | |
typedef struct _LCBB_xtrace_rec | LCBB_xtrace_rec |
Typedef for struct _LCBB_xtrace_rec. | |
typedef struct _LCBB_xtrace | LCBB_xtrace |
Typedef for struct _LCBB_xtrace. | |
typedef struct _LCBB_msg_hdr | LCBB_msg_hdr |
Typedef for struct _LCBB_msg_hdr. | |
typedef struct _LCBB_msg | LCBB_msg |
Typedef for struct _LCBB_msg. | |
typedef struct _LCBB * | LCBB |
Typedef for a pointer to struct. | |
Enumerations | |
enum | _LCBB_CFG_LATP_S { LCBB_CFG_LATP_S_USER0 = 1, LCBB_CFG_LATP_S_EVT_ENABLE = 1, LCBB_CFG_LATP_S_USER1 = 1, LCBB_CFG_LATP_S_USER2 = 1, LCBB_CFG_LATP_S_HDR_PARITY = 1, LCBB_CFG_LATP_S_PAYLOAD_PARITY = 1, LCBB_CFG_LATP_S_PAUSE_TEST = 1, LCBB_CFG_LATP_S_USER3 = 1, LCBB_CFG_LATP_S_BOARD_ID = 5, LCBB_CFG_LATP_S_MUST_BE_1 = 1, LCBB_CFG_LATP_S_BYTE_WIDE = 1, LCBB_CFG_LATP_S_RESET = 1 } |
Size of each of the bit fields in the LATp configuration word. More... | |
enum | _LCBB_CFG_LATP_V { LCBB_CFG_LATP_V_USER0 = 0, LCBB_CFG_LATP_V_EVT_ENABLE = 1, LCBB_CFG_LATP_V_USER1 = 2, LCBB_CFG_LATP_V_USER2 = 3, LCBB_CFG_LATP_V_HDR_PARITY = 4, LCBB_CFG_LATP_V_PAYLOAD_PARITY = 5, LCBB_CFG_LATP_V_PAUSE_TEST = 6, LCBB_CFG_LATP_V_USER3 = 7, LCBB_CFG_LATP_V_BOARD_ID = 8, LCBB_CFG_LATP_V_MUST_BE_1 = 13, LCBB_CFG_LATP_V_BYTE_WIDE = 14, LCBB_CFG_LATP_V_RESET = 15 } |
Right justified bit offset of each of the bit fields in the LATp configuration word. More... | |
enum | _LCBB_CFG_LATP_M { LCBB_CFG_LATP_M_USER0 = (1 << LCBB_CFG_LATP_V_USER0 ), LCBB_CFG_LATP_M_EVT_ENABLE = (1 << LCBB_CFG_LATP_V_EVT_ENABLE ), LCBB_CFG_LATP_M_USER1 = (1 << LCBB_CFG_LATP_V_USER1 ), LCBB_CFG_LATP_M_USER2 = (1 << LCBB_CFG_LATP_V_USER2 ), LCBB_CFG_LATP_M_HDR_PARITY = (1 << LCBB_CFG_LATP_V_HDR_PARITY ), LCBB_CFG_LATP_M_PAYLOAD_PARITY = (1 << LCBB_CFG_LATP_V_PAYLOAD_PARITY), LCBB_CFG_LATP_M_PAUSE_TEST = (1 << LCBB_CFG_LATP_V_PAUSE_TEST ), LCBB_CFG_LATP_M_USER3 = (1 << LCBB_CFG_LATP_V_USER3 ), LCBB_CFG_LATP_M_BOARD_ID = (0x1f << LCBB_CFG_LATP_V_BOARD_ID ), LCBB_CFG_LATP_M_MUST_BE_1 = (1 << LCBB_CFG_LATP_V_MUST_BE_1 ), LCBB_CFG_LATP_M_BYTE_WIDE = (1 << LCBB_CFG_LATP_V_BYTE_WIDE ), LCBB_CFG_LATP_M_RESET = (1 << LCBB_CFG_LATP_V_RESET ) } |
In place masks for each of the bit fields in the LATp configuration word. More... | |
enum | _LCBB_XTRACE_OLS_S { LCBB_XTRACE_S_OLS_OPCODE = 4, LCBB_XTRACE_S_OLS_LENGTH = 10, LCBB_XTRACE_S_OLS_STATUS = 2 } |
Defines the size, in bits, of the opcode/length/status fields. More... | |
enum | _LCBB_XTRACE_OLS_V { LCBB_XTRACE_OLS_V_OPCODE = 0, LCBB_XTRACE_OLS_V_LENGTH = 4, LCBB_XTRACE_OLS_V_STATUS = 14 } |
Defines the right offset, in bits of the opcode/length/status fields. More... | |
enum | _LCBB_XTRACE_OLS_M { LCBB_XTRACE_M_OLS_OPCODE = 0x000f, LCBB_XTRACE_M_OLS_LENGTH = 0x3ff0, LCBB_XTRACE_M_OLS_STATUS = 0xc000 } |
Defines the in place masks of the opcode/length/status fields. More... | |
enum | _LCBB_XTRACE_OLS_STATUS_K { LCBB_XTRACE_OLS_STATUS_K_SUCCESS = 0, LCBB_XTRACE_OLS_STATUS_K_ROGUE = 1, LCBB_XTRACE_OLS_STATUS_K_NULL = 2, LCBB_XTRACE_OLS_STATUS_K_TIMEOUT = 3 } |
Defines the values for the transaction status field in the OLS (opcode, length, status) field of the trace buffer. More... | |
enum | _LCBB_XTRACE_OLS_STATUS_M { LCBB_XTRACE_OLS_STATUS_M_SUCCESS, LCBB_XTRACE_OLS_STATUS_M_ROGUE, LCBB_XTRACE_OLS_STATUS_M_NULL, LCBB_XTRACE_OLS_STATUS_M_TIMEOUT } |
Defines the in place masks for the transaction status field in the OLS (opcode, length, status) field of the trace buffer. More... | |
Functions | |
LCBB | LCBB_configure (unsigned int latp, void *requestList, void *resultList, void *circBuffer) |
Returns a pointer to the LCB control structure, with the specified configuration parameters. | |
unsigned int | LCBB_init (LCBB lcb) |
Initializes the LCB structure for polled mode. | |
unsigned int | LCBB_start (LCBB lcb) |
Enables the LCB for taking event data. | |
unsigned char * | LCBB_locate (LCBB lcb) |
Returns a pointer to payload. | |
unsigned int | LCBB_send (LCBB lcb, unsigned int dst, unsigned int proto, int nbytes) |
Sends the data. | |
unsigned int | LCBB_check (LCBB lcb, LCBB_msg *msg) |
Maps the LCB error codes to a LCB message code. | |
LCBB_msg * | LCBB_receive (LCBB lcb) |
Reads the event FIFO for descriptors. | |
unsigned int | LCBB_free (LCBB lcb, LCBB_msg *msg) |
unsigned int | LCBB_mark_time (LCBB lcb, unsigned short int stall) |
Issues a Mark Time command to the LCB. | |
unsigned int | LCBB_lat_reset (LCBB lcb, unsigned short int stall) |
Issues a LAT reset. | |
unsigned int | LCBB_csr_access (LCBB lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur) |
Does an access of the LATp CSR register. | |
unsigned int | LCBB_faults_access (LCBB lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur) |
Does an access of the LATp CSR register. | |
unsigned int | LCBB_rxstats_access (LCBB lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur) |
Does an access of the LATp Receive Statistics/Status register. |
CVS $Id
#define LCBB_MSG_CHECK | ( | _msg | ) | ((_msg)->hdr.ed.ui & LCB_EVT_DSC_STATUS) |
Checks the message for both transmit and receive errors.
Typedef for a pointer to struct.
Keeping this in mind, it would still serve the user of the LCBB driver to avoid directly reference this structure. The alternative of providing many access routines to get at this data seemed to low in a cost to benefits analysis.
Typedef for struct _LCBB_cfg_latp_bf.
Typedef for struct _LCBB_cfg_latp_sv.
This structure consists of two identical bit fields. The upper portion contains a bit mask of those values one wishes to alter. The lower portion contains a bit mask of the values of the alterable fields.
Typedef for struct _LCBB_msg.
This is structure of a received bulk message. The first 3 32-bit words of the structure are available to user. The 4rth word contains the original event descriptor exactly as it was read from the EVENT Q. It should be intact when the message is freed.
Typedef for struct _LCBB_msg_hdr.
This is structure of outlining the LCBB driver's use of the pad area left by the driver before each received bulk message. The size of this area must be LCB_EVT_PAD_SIZE, as defined in LCB.h. This is checked for at compile time in LCBB.c
Typedef for struct _LCBB_xtrace.
Typedef for union _LCBB_xtrace_ols.
Typedef for struct _LCBB_xtrace_rec.
enum _LCBB_CFG_LATP_M |
In place masks for each of the bit fields in the LATp configuration word.
enum _LCBB_CFG_LATP_S |
Size of each of the bit fields in the LATp configuration word.
enum _LCBB_CFG_LATP_V |
Right justified bit offset of each of the bit fields in the LATp configuration word.
enum _LCBB_XTRACE_OLS_M |
enum _LCBB_XTRACE_OLS_S |
Defines the values for the transaction status field in the OLS (opcode, length, status) field of the trace buffer.
Defines the in place masks for the transaction status field in the OLS (opcode, length, status) field of the trace buffer.
enum _LCBB_XTRACE_OLS_V |
Maps the LCB error codes to a LCB message code.
LCBB_OK | if message is okay | |
LCB | message code if not |
lcb | Pointer to private LCB structure | |
msg | The LCB message |
LCBB LCBB_configure | ( | unsigned int | latp, | |
void * | requestList, | |||
void * | resultList, | |||
void * | circBuffer | |||
) |
Returns a pointer to the LCB control structure, with the specified configuration parameters.
latp | The LATp configuration information presented as 16 select bits and 16 value bits. Only those bits with their corresponding select bits set will be altered. | |
requestList | An array of 4096 bytes aligned on a 512 byte boundary. This memory will be used to construct request lists. It is from this memory that space for LCB-to-LCB traffic, |
resultList | As array of 4096 bytes aligned on a 16 byte boundary. This memory will be used to hold result lists. | |
circBuffer | An array of LCB_CIRC_BUFFER_TOTAL (640Kbytes) align on a LCB_CIRC_BUFFER_ALIGN (1Mbyte) boundary. This memory will be used to hold incoming 'event' traffic. |
SIU EPU commander 1 - evt_path - - cmd_path - - hdr_parity - - payload_parity - - pause_test - - pause_stick - - board_id v - byte_wide v -
LCBB_latp_cfg latp; latp.ui = 0; latp.sv.value.command = 1; latp.sv.value.board_id = board_id; latp.sv.value.byte_wide = 1; latp.sv.select.command = LCBB_LATP_SELECT; latp.sv.select.board_id = LCBB_LATP_SELECT; latp.sv.select.byte_wide = LCBB_LATP_SELECT; LCBB_configure (latp.ui, requestList, resultList, circBuffer);
unsigned int LCBB_csr_access | ( | LCBB | lcb, | |
unsigned int | value, | |||
unsigned int | field_select, | |||
unsigned short int | timeout, | |||
unsigned int * | prv, | |||
unsigned int * | cur | |||
) |
Does an access of the LATp CSR register.
lcb | Pointer to the LCBB control structure | |
value | The value to write to the register | |
field_select | A bit map indicating which fields of value should be written to the register. | |
timeout | The number of 20MHz ticks that the LCB should wait for a response before timing out. | |
prv | A pointer to receive the previous value | |
cur | A pointer to receive the current value |
unsigned int LCBB_faults_access | ( | LCBB | lcb, | |
unsigned int | value, | |||
unsigned int | field_select, | |||
unsigned short int | timeout, | |||
unsigned int * | prv, | |||
unsigned int * | cur | |||
) |
Does an access of the LATp CSR register.
lcb | Pointer to the LCBB control structure | |
value | The value to write to the register | |
field_select | A bit map indicating which fields of value should be written to the register. | |
timeout | The number of 20MHz ticks that the LCB should wait for a response before timing out. | |
prv | A pointer to receive the previous value | |
cur | A pointer to receive the current value |
lcb | Pointer to private LCB structure | |
msg | Pointer to a pointer to a message |
unsigned int LCBB_init | ( | LCBB | lcb | ) |
Initializes the LCB structure for polled mode.
lcb | Pointer to private LCB structure |
unsigned int LCBB_lat_reset | ( | LCBB | lcb, | |
unsigned short int | stall | |||
) |
Issues a LAT reset.
lcb | Pointer to the LCBB control structure | |
stall | The stall time, in units of 20MHz ticks until the next command can be issued. |
unsigned char* LCBB_locate | ( | LCBB | lcb | ) |
Returns a pointer to payload.
lcb | Pointer to private LCB structure |
unsigned int LCBB_mark_time | ( | LCBB | lcb, | |
unsigned short int | stall | |||
) |
Issues a Mark Time command to the LCB.
lcb | Pointer to the LCBB control structure | |
stall | The amount of time to stall, in units of 20MHz ticks |
Reads the event FIFO for descriptors.
lcb | Pointer to private LCBB structure |
If | there is a message, a pointer to the received message | |
If | these is no message, NUL, |
unsigned int LCBB_rxstats_access | ( | LCBB | lcb, | |
unsigned int | value, | |||
unsigned int | field_select, | |||
unsigned short int | timeout, | |||
unsigned int * | prv, | |||
unsigned int * | cur | |||
) |
Does an access of the LATp Receive Statistics/Status register.
lcb | Pointer to the LCBB control structure | |
value | The value to write to the register | |
field_select | A bit map indicating which fields of value should be written to the register. | |
timeout | The number of 20MHz ticks that the LCB should wait for a response before timing out. | |
prv | A pointer to receive the previous value | |
cur | A pointer to receive the current value |
unsigned int LCBB_send | ( | LCBB | lcb, | |
unsigned int | dst, | |||
unsigned int | proto, | |||
int | nbytes | |||
) |
Sends the data.
lcb | Pointer to private LCBB structure | |
dst | LATp destination fabric address, physical | |
proto | 2-bit LATp protocol to use when sending bulk data | |
nbytes | The number of bytes to send. Note that this length must include the 4 bytes of the LATP packet header |
unsigned int LCBB_start | ( | LCBB | lcb | ) |
Enables the LCB for taking event data.
lcb | Pointer to private LCBB structure |