GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBD / V1-2-9
Constituent: lcbb     Tag: mv2304
#include <string.h>
#include "PBS/SPIN.h"
#include "PBS/SPIN.ih"
#include "PBS/BSWP.ih"
#include "LCBD/LCBB.h"
#include "LCBD/LATP.h"
#include "LCBD/LCBB_msgs.h"
#include "LCBD/LCB_cr.h"
Include dependency graph for LCBB.c:

Data Structures | |
| struct | _LCBB_err_evt_maps |
| Maps to take an event transfer/receive error/status value, into a standard message code. More... | |
| struct | _LCBB_err_maps |
| Provides mapping arrays to take an LCB hardware error code into a LCB message code. More... | |
| struct | _LCBB_err_rst_maps |
| Maps to take a result transfer/receive error/status value, into a standard message code. More... | |
Defines | |
| #define | CHECK_EQ(n, a, b) struct Check_ ## n { int x[1 / (a == b) ]; } |
| Checks is a = b, and if not the compiler will issue an error. | |
| #define | LCBB_XTIME_REGISTER 10000 |
| Estimate of a register access time, in nanoseconds. | |
| #define | LCBB_XTIME_FUNCTION 10000 |
| Estimate of a function execution time, in nanoseconds. | |
| #define | LCBB_XTIME_EVENT_TRANSFER 10000 |
| Estimate of a event transfer overhead, in nanoseconds. | |
| #define | LCBB_XTIME_TIMEOUT 60000000 |
| Estimate of LCB event transfer timeout period. | |
| #define | LCBB_CLK_FREQ 20000000 |
| The default LCB LATp clock frequency (nominally 20MHz). | |
| #define | LCBB_NSECS_PER_TICK 50 |
| The default LCB LATp clock speed (nominally 20MHz = 50nsec/tick). | |
| #define | LCBB_BITS_PER_TICK 1 |
| The default LCB DMA output transfer speed. This is always 1 bit/tick (20Mbits/sec) independent of the bit/byte of the input interface. | |
| #define | LCBB_RST_DRAIN_TIMEOUT ((unsigned int)(3 * LCBB_CLK_FREQ)) |
| The result drain timeout period, in units of LCBB clock ticks. This is the maximum time that the function will wait for the sweeping transaction to be returned. | |
| #define | LCBB_XTIME_EVENT_TRANSFER_BY_INTS(_nints) |
| Estimates the time to get submit and get the result descriptor back for an event transfer of _nints. | |
Typedefs | |
| typedef _LCBB_err_rst_maps | LCBB_err_rst_maps |
| Typedef for struct _LCBB_err_rst_maps. | |
| typedef _LCBB_err_evt_maps | LCBB_err_evt_maps |
| Typedef for struct _LCBB_err_evt_maps. | |
| typedef _LCBB_err_maps | LCBB_err_maps |
| Typedef for struct _LCBB_err_maps. | |
Functions | |
| __inline void | pciStore32 (volatile unsigned int *dst, unsigned int w) |
| Write a 32-bit integer to PCI Memory. | |
| __inline unsigned int | pciLoad32 (volatile unsigned int *src) |
| Read a 32-bit integer from PCI Memory. | |
| __inline unsigned int | clear_faults (LCBB lcb, unsigned short timeout) |
| Clears the FIFO faults register. | |
| unsigned int | access_function (LCBB lcb, unsigned short stall, unsigned int header, unsigned int poll_timeout) |
| Performs an access to the specified LCB slave-side LATP function. | |
| unsigned int | access_reg (LCBB lcb, unsigned int value, unsigned int field_select, unsigned short int stall, unsigned int *prv, unsigned int *cur, unsigned int header, unsigned int poll_timeout) |
| Performs an access to the specified LCB slave-side LATP register. | |
| unsigned int | poll (LCBB lcb, unsigned int poll_period, unsigned int timeout, unsigned short int op_len, const void *result, const LCB_ri_err *ri_err) |
| Polls the RESULT FIFO every nsecs for @ iterations. | |
| __inline unsigned int | submit (LCBB lcb, unsigned int request) |
| Submits the specified request list to the LCB for execution. | |
| unsigned int | execute (LCBB lcb, unsigned int request, unsigned int xtime, unsigned int timeout, unsigned short int op_len, void *result, LCB_ri_err *ri_err) |
| Has the LCB's command execution routine execute the specified single item request. The result list and result item is checked for successful completion. | |
| unsigned int | init_pci (LCBB lcb) |
| Initializes the LCB structure -- probes the PCI bus. | |
| unsigned int | init_latp (LCBB lcb) |
| Laundry list of LCB initializations to do on the LATp side. | |
| void | init_circ (LCBB lcb) |
| Allocates memory for and sets it up to be used as the circular buffer. | |
| unsigned int | drain_result (LCBB lcb) |
| Drains the result FIFOs. | |
| unsigned int | drain_event (LCBB lcb) |
| Drains the event FIFOs. | |
| __inline unsigned int | mapXfrErr (const LCBB_err_rst_maps *maps, unsigned int err) |
| Maps a result descriptor status into an error code. | |
| __inline unsigned int | mapRcvErr (const LCBB_err_rst_maps *maps, unsigned int err) |
| Maps a result item status into an error code. | |
| 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_check (LCBB lcb, LCBB_msg *msg) |
| Maps the LCB error codes to a LCB message code. | |
| unsigned int | LCBB_free (LCBB lcb, LCBB_msg *msg) |
| unsigned char * | LCBB_locate (LCBB lcb) |
| Returns a pointer to payload. | |
| LCBB_msg * | LCBB_receive (LCBB lcb) |
| Reads the event FIFO for descriptors. | |
| unsigned int | LCBB_send (LCBB lcb, unsigned int dst, unsigned int proto, int nbytes) |
| Sends the data. | |
| unsigned int | LCBB_start (LCBB lcb) |
| Enables the LCB for taking event data. | |
| 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. | |
Variables | |
| const LCBB_err_maps | LcbbErrMaps |
| Realization of the LCB error to message code mapping arrays. | |
| _LCBB | Lcbb |
| The LCB driver control block. | |
JJRussell -- russell@slac.stanford.edu
CVS $Id
|
|
Checks is a = b, and if not the compiler will issue an error.
|
|
|
Value: (LCBB_XTIME_EVENT_TRANSFER \ + (((_nints) * 32) * LCBB_NSECS_PER_TICK) / LCBB_BITS_PER_TICK);
|
|
|
Typedef for struct _LCBB_err_maps. Combines the Result and Event mapping data structures |
|
||||||||||||||||||||
|
Performs an access to the specified LCB slave-side LATP function.
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||||||||||
|
Performs an access to the specified LCB slave-side LATP register.
|
Here is the call graph for this function:

|
||||||||||||
|
Clears the FIFO faults register.
|
Here is the call graph for this function:

|
|
Drains the event FIFOs.
|
Here is the call graph for this function:

|
|
Drains the result FIFOs.
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||||||
|
Has the LCB's command execution routine execute the specified single item request. The result list and result item is checked for successful completion.
|
Here is the call graph for this function:

|
|
Allocates memory for and sets it up to be used as the circular buffer.
|
Here is the call graph for this function:

|
|
Laundry list of LCB initializations to do on the LATp side.
|
Here is the call graph for this function:

|
|
Initializes the LCB structure -- probes the PCI bus.
|
Here is the call graph for this function:

|
||||||||||||
|
Maps the LCB error codes to a LCB message code.
|
|
||||||||||||||||||||
|
Returns a pointer to the LCB control structure, with the specified configuration parameters.
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);
|
|
||||||||||||||||||||||||||||
|
Does an access of the LATp CSR register.
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
Does an access of the LATp CSR register.
|
Here is the call graph for this function:

|
||||||||||||
|
|
Here is the call graph for this function:

|
|
Initializes the LCB structure for polled mode.
|
Here is the call graph for this function:

|
||||||||||||
|
Issues a LAT reset.
|
Here is the call graph for this function:

|
|
Returns a pointer to payload.
|
|
||||||||||||
|
Issues a Mark Time command to the LCB.
|
Here is the call graph for this function:

|
|
Reads the event FIFO for descriptors.
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
Does an access of the LATp Receive Statistics/Status register.
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Sends the data.
|
Here is the call graph for this function:

|
|
Enables the LCB for taking event data.
|
Here is the call graph for this function:

|
||||||||||||
|
Maps a result item status into an error code.
|
|
||||||||||||
|
Maps a result descriptor status into an error code.
|
|
|
Read a 32-bit integer from PCI Memory.
|
|
||||||||||||
|
Write a 32-bit integer to PCI Memory.
|
|
||||||||||||||||||||||||||||
|
Polls the RESULT FIFO every nsecs for @ iterations.
Even a list of up to 3 seconds is possible (pretty bizarre), can be covered by the range of the SPIN counter. The smallest range is
MV2304, MCP750: 2**32 * 60 nsecs ~= 240 seconds
RAD750 : 2**32 * 120 nsecs ~= 480 seconds
|
Here is the call graph for this function:

|
||||||||||||
|
Submits the specified request list to the LCB for execution.
|
Here is the call graph for this function:

1.3.3