GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-1 > lcbb / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LCBB.h File Reference

Defines public methods of the boot mode LCB driver. More...

#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 _LCBBLCBB
 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_msgLCBB_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.


Detailed Description

Defines public methods of the boot mode LCB driver.

Author:
Curt Brune -- curt@slac.stanford.edu

JJRussell -- russell@slac.stanford.edu

  CVS $Id

Define Documentation

#define LCBB_MSG_CHECK ( _msg   )     ((_msg)->hdr.ed.ui & LCB_EVT_DSC_STATUS)

Checks the message for both transmit and receive errors.

Returns:
Non-zero if there are errors, else 0 if OK
This macro checks an event descriptor for both transmit and receive errors. It is meant to be used as a quickie test. The user should see
See also:
LCBB_check to map the status of a message into a standard LCB message code.


Typedef Documentation

LCBB

Typedef for a pointer to struct.

See also:
_LCBB
Normally one would not expose this structure, but given that the only customer for this code is the primary boot code for the EPU and that in this context the code is physically linked in (not exported as a shareable, the need for high modularity diminishes somewhat.

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.

LCBB_cfg_latp_bf

Typedef for struct _LCBB_cfg_latp_bf.

For the most part, these set bits in the LATp side CSR. In general, the boot code when running on the EPU does not set any of these bits. The boot code, when running on the SIU will likely set the following fields

LCBB_cfg_latp_sv

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.

LCBB_msg

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.

LCBB_msg_hdr

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

LCBB_xtrace

Typedef for struct _LCBB_xtrace.

The trace records are stored in circular buffer fashion with the most recent buffer located by taking the cnt % 0.

LCBB_xtrace_ols

Typedef for union _LCBB_xtrace_ols.

The OLS word of a transaction trace record packs three fields into a 16 bit unsigned short int
  1. The opcode of the transaction (4 bits)
  2. The length, in units of 8-byte cells) of the transaction (10 bits)
  3. The disposal status of the transaction (2 bits)
The first two fields, the opcode and the length, are taken directly from the command header word, essentially just compressing out the MBZ bits. The disposal status can be one of four values (see LCBB_XTRACE_OLS_K_STATUS).

LCBB_xtrace_rec

Typedef for struct _LCBB_xtrace_rec.

The LCBB driver keeps a trace buffer of the last N (currently 8) transactions. This keeps track of useful information about the history of whats going on. It may prove to be useful in both testing and in diagnostics.


Enumeration Type Documentation

enum _LCBB_CFG_LATP_M

In place masks for each of the bit fields in the LATp configuration word.

Enumerator:
LCBB_CFG_LATP_M_USER0  User field 0, in place bit mask
LCBB_CFG_LATP_M_EVT_ENABLE  Event enable, in place bit mask
LCBB_CFG_LATP_M_USER1  User field 1, in place bit mask
LCBB_CFG_LATP_M_USER2  User field 2, in place bit mask
LCBB_CFG_LATP_M_HDR_PARITY  Header parity, in place bit mask
LCBB_CFG_LATP_M_PAYLOAD_PARITY  Payload parity, in place bit mask
LCBB_CFG_LATP_M_PAUSE_TEST  Pause test, in place bit mask
LCBB_CFG_LATP_M_USER3  User field 3, in place bit mask
LCBB_CFG_LATP_M_BOARD_ID  Board LATp adr, in place bit mask
LCBB_CFG_LATP_M_MUST_BE_1  Not settable, in place bit mask
LCBB_CFG_LATP_M_BYTE_WIDE  Bit/Byte path, in place bit mask
LCBB_CFG_LATP_M_RESET  LATp reset, in place bit mask

enum _LCBB_CFG_LATP_S

Size of each of the bit fields in the LATp configuration word.

Enumerator:
LCBB_CFG_LATP_S_USER0  User field 0, size in bits
LCBB_CFG_LATP_S_EVT_ENABLE  Event enable, size in bits
LCBB_CFG_LATP_S_USER1  User field 1, size in bits
LCBB_CFG_LATP_S_USER2  User field 2, size in bits
LCBB_CFG_LATP_S_HDR_PARITY  Header parity, size in bits
LCBB_CFG_LATP_S_PAYLOAD_PARITY  Payload parity,size in bits
LCBB_CFG_LATP_S_PAUSE_TEST  Pause test, size in bits
LCBB_CFG_LATP_S_USER3  User field 3, size in bits
LCBB_CFG_LATP_S_BOARD_ID  Board LATp adr,size in bits
LCBB_CFG_LATP_S_MUST_BE_1  Not settable, size in bits
LCBB_CFG_LATP_S_BYTE_WIDE  Bit/Byte path, size in bits
LCBB_CFG_LATP_S_RESET  LATp reset, size in bits

enum _LCBB_CFG_LATP_V

Right justified bit offset of each of the bit fields in the LATp configuration word.

Enumerator:
LCBB_CFG_LATP_V_USER0  User field 0, right offset
LCBB_CFG_LATP_V_EVT_ENABLE  Event enable, right offset
LCBB_CFG_LATP_V_USER1  User field 1, right offset
LCBB_CFG_LATP_V_USER2  User field 2, right offset
LCBB_CFG_LATP_V_HDR_PARITY  Header parity, right offset
LCBB_CFG_LATP_V_PAYLOAD_PARITY  Payload parity,right offset
LCBB_CFG_LATP_V_PAUSE_TEST  Pause test, right offset
LCBB_CFG_LATP_V_USER3  User field 3, right offset
LCBB_CFG_LATP_V_BOARD_ID  Board LATp adr,right offset
LCBB_CFG_LATP_V_MUST_BE_1  Not settable, right offset
LCBB_CFG_LATP_V_BYTE_WIDE  Bit/Byte path, right offset
LCBB_CFG_LATP_V_RESET  LATp reset, right offset

enum _LCBB_XTRACE_OLS_M

Defines the in place masks of the opcode/length/status fields.

Enumerator:
LCBB_XTRACE_M_OLS_OPCODE  Opcode field, in place mask
LCBB_XTRACE_M_OLS_LENGTH  Length field, in place mask
LCBB_XTRACE_M_OLS_STATUS  Status field, in place mask

enum _LCBB_XTRACE_OLS_S

Defines the size, in bits, of the opcode/length/status fields.

Enumerator:
LCBB_XTRACE_S_OLS_OPCODE  Opcode field, size in bits
LCBB_XTRACE_S_OLS_LENGTH  Length field, size in bits
LCBB_XTRACE_S_OLS_STATUS  Status field, size in bits

enum _LCBB_XTRACE_OLS_STATUS_K

Defines the values for the transaction status field in the OLS (opcode, length, status) field of the trace buffer.

Enumerator:
LCBB_XTRACE_OLS_STATUS_K_SUCCESS  Transaction was successful
LCBB_XTRACE_OLS_STATUS_K_ROGUE  Transaction was a rogue
LCBB_XTRACE_OLS_STATUS_K_NULL  Transaction was a NULL dsc
LCBB_XTRACE_OLS_STATUS_K_TIMEOUT  Transaction timed out

enum _LCBB_XTRACE_OLS_STATUS_M

Defines the in place masks for the transaction status field in the OLS (opcode, length, status) field of the trace buffer.

Enumerator:
LCBB_XTRACE_OLS_STATUS_M_SUCCESS  Transaction was successful, in place mask
LCBB_XTRACE_OLS_STATUS_M_ROGUE  Transaction was a rogue, in place mask
LCBB_XTRACE_OLS_STATUS_M_NULL  Transacction was a null, in place mask
LCBB_XTRACE_OLS_STATUS_M_TIMEOUT  Transaction timed out, in place mask

enum _LCBB_XTRACE_OLS_V

Defines the right offset, in bits of the opcode/length/status fields.

Enumerator:
LCBB_XTRACE_OLS_V_OPCODE  Opcode field, right offset, in bits
LCBB_XTRACE_OLS_V_LENGTH  Length field, right offset, in bits
LCBB_XTRACE_OLS_V_STATUS  Status field, right offset, in bits


Function Documentation

unsigned int LCBB_check ( LCBB  lcb,
LCBB_msg msg 
)

Maps the LCB error codes to a LCB message code.

Return values:
LCBB_OK if message is okay
LCB message code if not
Parameters:
lcb Pointer to private LCB structure
msg The LCB message
This maps the LCB transfer and receive errors into standard LCBB message codes. If there are no transfer or receive errors, LCBB_OK is returned.

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.

Returns:
A pointer to the LCB control structure
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,
See also:
LCBB_send, is carved.
Parameters:
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.
The last three parameters are self-explanatory. The latp parameter deserves some special attention. There are a number of values that configure the LATp side behaviour of the LCB. The latp parameter provides a method of altering only those values that the caller wishes. It does this by defining the lower 16 bits as the value bits and the upper 16 bits as the selection bits. Only value bits with corresponding field selection bits set will be altered.
The set-up of this parameter is largely determined by whether the LCB is acting as a commander (SIU) or a responder (EPU). A typical configuration might be
                           SIU     EPU
       commander             1       -
       evt_path              -       -
       cmd_path              -       -
       hdr_parity            -       -
       payload_parity        -       -
       pause_test            -       -
       pause_stick           -       -
       board_id              v       -
       byte_wide             v       -

Where the v's represent a configurable value and the @ -'s represent bits that should not be altered. The corresponding code would look like for an SIU would look like
      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);

The EPU would simple passs a 0, since it does wish to alter any fields.
Note:
For the most current usage of these bits, see the corresponding fields in the LCB_csr definitions (LCB_cr.h). Some of these bits have only have meaning in on the SIU or EPU and some only have meaning when not in a system with a GASU. An example of the latter is the commander select. In a GASU based system, this functionality is set on the

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.

Returns:
Status
Parameters:
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.

Returns:
Status
Parameters:
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_free ( LCBB  lcb,
LCBB_msg msg 
)

Parameters:
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.

Parameters:
lcb Pointer to private LCB structure
Returns:
LCBB_OK for success
Probe the PCI bus looking for the LCB. When the board is found store the mapping for the PCI I/O space and PCI Memory space.

unsigned int LCBB_lat_reset ( LCBB  lcb,
unsigned short int  stall 
)

Issues a LAT reset.

Parameters:
lcb Pointer to the LCBB control structure
stall The stall time, in units of 20MHz ticks until the next command can be issued.
It would be rare to issue a LAT reset in the context of the boot code, but it has been included for completeness.

unsigned char* LCBB_locate ( LCBB  lcb  ) 

Returns a pointer to payload.

Parameters:
lcb Pointer to private LCB structure
Returns:
Pointer to store the payload
The pointer is guaranteed to be 32-bit aligned.

Warning:
It is the user responsibility to limit the transfer to LCB_TRANSFER_MAX bytes.

unsigned int LCBB_mark_time ( LCBB  lcb,
unsigned short int  stall 
)

Issues a Mark Time command to the LCB.

Returns:
Status
Parameters:
lcb Pointer to the LCBB control structure
stall The amount of time to stall, in units of 20MHz ticks
It would be rare that a mark time command would be issued in the boot code environment. Mainly, this is a command to meter out items in a command list. The one possible use is as a 'innocous' command to see if the LATp side of the LCB is alive; i.e. a probe usage.

LCBB_msg* LCBB_receive ( LCBB  lcb  ) 

Reads the event FIFO for descriptors.

Parameters:
lcb Pointer to private LCBB structure
Return values:
If there is a message, a pointer to the received message
If these is no message, NUL,
Call this function to check if any event data has been received. When a descriptor is found the LCBB_msg pointer is initialized and the event descriptor read from the FIFO is returned. Since this is a non-blocking routine, it is meant to be used in a polling mode style, returning a non-NULL LCBB_msg pointer only when there is a message available. Note that the user data starts after the pad area, defined bu LCB_msg_hdr.
The caller of this function must absolutely check the event descriptor for errors before trying to use the LCBB_msg pointer. This can be done either by the user directly accessing the status fields in the event descriptor (stored in the LCBB_msg itself) or by using the LCBB_check function.

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.

Returns:
Status
Parameters:
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.

Parameters:
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
Returns:
LCBB_OK for success
Warning:
Make sure the nbytes parameter includes the length of the data plus the 4 bytes of the LATP packet header word. This was a struggle, trying to define whether the length word should be only the length of what has traditionally been called the user data (excludes the the LATp header and the word that the EBM would fill) or whether it should include the 4 bytes of the LATp and EBM word. In the end, the decision was driven by the fact that the numbers floating around describing the limits on the data transfer size have been quoted as including the 4 bytes.

unsigned int LCBB_start ( LCBB  lcb  ) 

Enables the LCB for taking event data.

Parameters:
lcb Pointer to private LCBB structure
Returns:
LCBB_OK for success


Generated on Tue Aug 31 18:53:47 2010 by  doxygen 1.5.3