GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / dev > lcbd / mv2304
#include <LCBD/LCB.h>
#include <PBS/FORK.h>
#include <PBI/PTR.h>
Classes | |
union | _LCBD_xcb_que |
Union of the possible data structures the LCBD_xcb can be linked to. More... | |
struct | _LCBD_xcb_sys |
The system portion of the transaction control block. More... | |
struct | _LCBD_xcb_usr |
The user portion of the XCB. More... | |
struct | _LCBD_xcb |
The transaction control block. More... | |
struct | _LCBD_rst_null_cbp |
Binds an null descriptor call back routine with its parameter. More... | |
Defines | |
#define | LCBD_CL_ALIGN LCB_COMMAND_LIST_ALIGN |
Necessary byte alignment for a command list. See Command and Result Lists, General Principles. | |
#define | LCBD_CL_PAD LCB_COMMAND_LIST_PAD |
The size of the padding, in bytes, needed to ensure that command list is protected against CPU accesses during the DMA operation. See Command and Result Lists, General Principles. | |
#define | LCBD_CL_SIZE(_nbytes) (LCBD_RNDDOWN_TO_CACHELINE (_nbytes) + LCBD_CL_PAD) |
Computes the number of bytes needed to properly pad a command list of _nbytes to protect against CPU memory accesses while the DMA transfer is in progress. See Command and Result Lists, General Principles. | |
#define | LCBD_RL_ALIGN LCB_RESULT_LIST_ALIGN |
Necessary byte alignment for a result list See Command and Result Lists, General Principles. | |
#define | LCBD_RL_MIN (LCB_RESULT_LIST_MIN + sizeof (LCBD_xcb)) |
The minimum size, in bytes, needed to ensure that result list is protected against CPU accesses during the DMA operation. See Command and Result Lists, General Principles. | |
#define | LCBD_RL_SIZE(_nbytes) |
Computes the number of bytes needed to properly pad a result list of _nbytes to provide protected against CPU memory accesses while the DMA transfer is in progress. See Command and Result Lists, General Principles. | |
#define | LCBD_RNDDOWN_TO_CACHELINE(_nbytes) |
Utility macro used to round _nbytes down to the nearest multiple of a cache line. | |
#define | LCBD_RNDUP_TO_CACHELINE(_nbytes) |
Utility macro used to round _nbytes up to the nearest multiple of a cache line. | |
#define | LCBD_OK 0 |
Success return code, note that this is not an LCBD message code, but may be used as one. | |
#define | LCBD_EXP_DSC_COMPOSE(_cl, _clLen, _lcl2pci) (((PTR_as_uint)(_cl) + (_lcl2pci)) | (_clLen)) |
Composes a command list export descriptor. | |
#define | LCBD_EXP_DSC_REPLACE_LEN(_export, _clLen) (((_export) & ~(LCB_REQUEST_LIST_ALIGN - 1)) | (_clLen)) |
Replaces the length field in the specified export descriptor. | |
#define | LCBD_RST_K_DEFAULT_PRIORITY -1 |
Instructs the result service task creation routine LCBD_rst_handler_create to use a system defined default priority. | |
Typedefs | |
typedef struct _LCBD_xcb | LCBD_xcb |
Typedef for struct _LCBD_xcb. | |
typedef enum _LCBD_SEQ | LCBD_SEQ |
Typedef for enum _LCBD_SEQ. | |
typedef LI_head | LCBD_post_head |
Typedef for the type of list head that LCBD_post_remove uses. | |
typedef enum _LCBD_RST_FATE_M | LCBD_RST_FATE_M |
Typedef for enum _LCBD_RST_FATE_M. | |
typedef unsigned int(* | LCBD_rst_cb )(void *prm, LCBD_xcb *xcb) |
Driver supplied callback routine for LCBD result processing. | |
typedef union _LCBD_xcb_que | LCBD_xcb_que |
Typedef for union _LCBD_xcb_que. | |
typedef struct _LCBD_xcb_sys | LCBD_xcb_sys |
Typedef for struct _LCBD_xcb_sys. | |
typedef struct _LCBD_xcb_usr | LCBD_xcb_usr |
Typedef for struct _LCBD_xcb_usr. | |
typedef unsigned int(* | LCBD_rst_null_cb )(void *prm, LCBD lcb) |
Typedef for LCBD NULL descriptor handling callback routine. | |
typedef struct _LCBD_rst_null_cbp | LCBD_rst_null_cbp |
Typedef for struct _LCBD_rst_null_cbp. | |
Enumerations | |
enum | _LCBD_SEQ { LCBD_SEQ_SUCCESS = 0, LCBD_SEQ_ORDER = 1, LCBD_SEQ_UNKNOWN = 2, LCBD_SEQ_EMPTY = 3, LCBD_SEQ_CNT = 4 } |
Enumerates the sequencing status of command lists. More... | |
enum | _LCBD_RST_FATE_M { LCBD_RST_FATE_M_NO_MORE = (1 << 0), LCBD_RST_FATE_M_NO_REARM = (1 << 1) } |
Bit masks defining the options available on the return values of the result callback routine. More... | |
Functions | |
unsigned int | LCBD_rst_handler_create (LCBD lcb, int priority) |
Creates the result service task. | |
unsigned int | LCBD_rst_null_cb_set (LCBD lcb, LCBD_rst_null_cb cb, void *prm) |
Establish callback for handling null result descriptors. | |
LCBD_rst_null_cbp | LCBD_rst_null_cbp_get (LCBD lcb) |
Returns the callback routine for the null result descriptor handler plus its parameter. | |
unsigned int | LCBD_rst_que_install (LCBD lcb, FORK_que *que) |
Installs queue from fcb as the ISR -> task message queue for result traffic. | |
unsigned int | LCBD_rst_rcv_err_map (unsigned int err) |
Maps a receive error to a standard LCB message code. | |
unsigned int | LCBD_rst_xfr_err_map (unsigned int err) |
Maps a generalize result error to a standard LCB message code. | |
LCBD_cl * | LCBD_cl_alloc (unsigned int nbytes) |
Allocates a DMA-safe LCBD command list for the specified number of bytes. See Command and Result Lists, General Principles. | |
LCBD_rl * | LCBD_rl_alloc (unsigned int nbytes) |
Allocates a DMA-safe LCBD result list for the specified number of bytes. See Command and Result Lists, General Principles. | |
LCBD_cl * | LCBD_cl_alloc8 (unsigned int n8bytes) |
Allocates a DMA-safe LCBD command list consisting of n8bytes of command items. See Command and Result Lists, General Principles. | |
LCBD_rl * | LCBD_rl_alloc8 (unsigned int n8bytes) |
Allocates a DMA-safe LCBD result list consisting of n8bytes of result items. See Command and Result Lists, General Principles. | |
LCBD_cl * | LCBD_cl_alloc_unprotected (unsigned int nbytes) |
Allocates a correctly aligned but minimally-sized LCBD command list for the specified number of bytes. See Command and Result Lists, General Principles. | |
LCBD_rl * | LCBD_rl_alloc_unprotected (unsigned int nbytes) |
Allocates a correctly aligned but minimally-sized LCBD result list for the specified number of bytes. See Command and Result Lists, General Principles. | |
LCBD_cl * | LCBD_cl_alloc8_unprotected (unsigned int n8bytes) |
Allocates a correctly aligned but minimally-sized LCBD command list for the specified number of n8bytes command items. See Command and Result Lists, General Principles. | |
LCBD_rl * | LCBD_rl_alloc8_unprotected (unsigned int n8bytes) |
Allocates a correctly aligned but minimally-sized LCBD result list for the specified number of n8byte result items. See Command and Result Lists, General Principles. | |
unsigned short int | LCBD_cl_size (unsigned int nbytes) |
Computes the size needed for a command list of nbytes to protect it from the bridge chip hangs. See Command and Result Lists, General Principles. | |
unsigned short int | LCBD_rl_size (unsigned int nbytes) |
Computes the size needed for a result list of nbytes to protect it from the bridge chip hangs. See Command and Result Lists, General Principles. | |
static __inline unsigned short int | LCBD__cl_len (unsigned int nbytes) |
Calculates the number of 8-byte cells in the specified number of bytes. | |
static __inline unsigned short int | LCBD__cl_dlen (const void *beg, const void *end) |
Calculates the length, in 8-byte cells, between the specified beginning and ending pointers. | |
static __inline unsigned short int | LCBD__rl_len (unsigned int nbytes) |
Calculates the number of 8-byte cells in the specified number of bytes. | |
static __inline unsigned short int | LCBD__rl_dlen (const void *beg, const void *end) |
Calculates the length, in 8-byte cells, between the specified beginning and ending pointers. | |
LCBD_xcb * | LCBD_bind (const LCBD lcb, unsigned short int clLen, LCBD_cl *cl, unsigned short int rlLen, LCBD_rl *rl, LCBD_rst_cb cb, void *prm, void *user0, void *user1, void *user2, void *user3) |
Binds the XCB with everything needed to submit it to the LCB. | |
unsigned int | LCBD_qioW (LCBD lcb, unsigned short int clLen, LCBD_cl *cl, LCBD_rl *rl) |
A convenience routine to synchronously submit, execute and wait for the completion of the specified command list.. | |
unsigned int | LCBD_submit (LCBD_xcb *xcb) |
Submits the command request. | |
unsigned int | LCBD_submitW (LCBD_xcb *xcb) |
Submits the command request and waits for completion. | |
LCBD_xcb * | LCBD_fork_bind (LCBD lcb, unsigned short int clLen, LCBD_cl *cl, unsigned short int rlLen, LCBD_rl *rl, FORK_que *que, FORK_cb_rtn rtn, void *user0, void *user1, void *user2, void *user3) |
Completes a transaction block using the FORK dispatch routines as the synchronization mechanism. | |
LCBD_xcb * | LCBD_post_bind (LCBD lcb, unsigned short int clLen, LCBD_cl *cl, unsigned short int rlLen, LCBD_rl *rl, LCBD_post_head *head, void *user0, void *user1, void *user2, void *user3) |
Completes a transaction block that uses a queue as the synchronization mechanism. | |
unsigned int | LCBD_post_create (LCBD_post_head *head) |
Creates and initializes the head of the list that the LCBD_post routines use. | |
unsigned int | LCBD_post_destroy (LCBD_post_head *head) |
Destroys the head of the list created by LCBD_post_create. | |
LCBD_xcb * | LCBD_post_pendW (LCBD_post_head *head) |
Removes, with a wait, the next XCB posted to the indicated list head. |
CVS $Id
Where possible, the naming convention was used.
#define LCBD_CL_SIZE | ( | _nbytes | ) | (LCBD_RNDDOWN_TO_CACHELINE (_nbytes) + LCBD_CL_PAD) |
Computes the number of bytes needed to properly pad a command list of _nbytes to protect against CPU memory accesses while the DMA transfer is in progress. See Command and Result Lists, General Principles.
_nbytes | The actual number of bytes in the command list |
Referenced by LCBD_cl_size().
#define LCBD_EXP_DSC_COMPOSE | ( | _cl, | |||
_clLen, | |||||
_lcl2pci | ) | (((PTR_as_uint)(_cl) + (_lcl2pci)) | (_clLen)) |
Composes a command list export descriptor.
_cl | Properly align command list address | |
_clLen | Length of the command list in 8 byte cells | |
_lcl2pci | Address translation value, local CPU address to PCI address |
Referenced by LCBD_bind().
#define LCBD_EXP_DSC_REPLACE_LEN | ( | _export, | |||
_clLen | ) | (((_export) & ~(LCB_REQUEST_LIST_ALIGN - 1)) | (_clLen)) |
Replaces the length field in the specified export descriptor.
_export | The export descriptor | |
_clLen | Length of the command list in 8 byte cells |
#define LCBD_RL_MIN (LCB_RESULT_LIST_MIN + sizeof (LCBD_xcb)) |
The minimum size, in bytes, needed to ensure that result list is protected against CPU accesses during the DMA operation. See Command and Result Lists, General Principles.
#define LCBD_RL_SIZE | ( | _nbytes | ) |
Value:
({ \ int n =_nbytes; \ n = (n < LCBD_RL_MIN) \ ? LCBD_RL_MIN \ : LCBD_RNDUP_TO_CACHELINE (n); \ })
_nbytes | The actual number of bytes in the result list. Note that since all properly formed LCBD result lists are prefaced by an LCBD_xcb, the number of bytes is passed in is assumed to include the LCBD_xcb. |
Referenced by LCBD_rl_size().
#define LCBD_RST_K_DEFAULT_PRIORITY -1 |
Instructs the result service task creation routine LCBD_rst_handler_create to use a system defined default priority.
Referenced by LCBD_rst_handler_create().
unsigned int(* LCBD_rst_cb)(void *prm, LCBD_xcb *xcb) |
Driver supplied callback routine for LCBD result processing.
prm | Arbitrary User parameter | |
xcb | Pointer to the result IO completion block |
Typedef for enum _LCBD_RST_FATE_M.
unsigned int(* LCBD_rst_null_cb)(void *prm, LCBD lcb) |
Typedef for LCBD NULL descriptor handling callback routine.
prm | User provided parameter | |
lcb | The LCBD driver handle |
Typedef for enum _LCBD_SEQ.
The LCBD driver keeps track of command list transactions as they are submitted to the hardware. The LCBD driver expects that the hardware maintains a FIFO discipline, that is transaction are retired in the order they are submitted.
LCBD_SEQ enumerates the 3 possible scenerios when a result from the RESULT queue is being processed
Typedef for struct _LCBD_xcb.
Typedef for union _LCBD_xcb_que.
Typedef for struct _LCBD_xcb_sys.
Typedef for struct _LCBD_xcb_usr.
enum _LCBD_RST_FATE_M |
Bit masks defining the options available on the return values of the result callback routine.
enum _LCBD_SEQ |
static __inline unsigned short int LCBD__cl_dlen | ( | const void * | beg, | |
const void * | end | |||
) | [static] |
Calculates the length, in 8-byte cells, between the specified beginning and ending pointers.
beg | A pointer to the beginning of either the command list or the first command item. | |
end | A pointer to (in the usual C fashion) to address one past the last command item (i.e. where the next command item would go if there were one). |
LCBD_rl *rl = LCBD_rl_alloc (4096); LCBD_cl *cl = LCBD_cl_alloc (4096); LCB_ci *ci = &cl->ci; LCB_ri *ri = rl->rl.ri; ci = LCBC__mark_time_fill (&ci->mark, 200); ri = LCBR__advance ( ri, sizeof (LCB_ri_mark_time)); ci = LCBC__csr_access_fill (&ci->csr, val, select, timeout); ri = LCBR__advance ( ri, sizeof (LCB_ri_csr)); ci = LCBC__mark_time_fill (&ci->mark, 400); ri = LCBR__advance ( ri, sizeof (LCB_ri_mark_time)): ci = LCBC__faults_access_fill (&ci->faults, 0, -1, timeout); ri = LCBR__advance ( ri, sizeof (LCB_ri_faults)); status = LCBD_post_bind (lcb, LCBD_cl_dlen (cl, ci), cl, LCBD_rl_dlen (&rl->rl, ri), rl, head, 0, 0, 0, 0); //.. or status = LCBD_post_bind (lcb, LCBD_cl_dlen (&cl.ci, ci), cl, LCBD_rl_dlen (&rl->rl.ri, ri), rl, head, 0, 0, 0, 0);
static __inline unsigned short int LCBD__cl_len | ( | unsigned int | nbytes | ) | [static] |
Calculates the number of 8-byte cells in the specified number of bytes.
nbytes | The number of bytes to convert to 8-byte cells |
Please absorb the import of the warning above, issued here again, the low three bits are discarded. This routine believes that nbytes represents a legitimate length.
// Define the command items typedef struct _MyCmdItems { LCB_ci_mark_time mark1; LCB_ci_csr csr; LCB_ci_mark_time mark2; LCB_ci_faults faults; } MyCmdItems; // Assemble into a command list typedef struct _MyCmdList { LCB_cl hdr; MyCmdItems ci; } MyCmdList; // Define the corresponding result items typedef struct _MyRstItems { LCB_ri_mark_time mark1; LCB_ri_csr csr; LCB_ci_mark_time mark2; LCB_ci_faults faults; } MyRstItems; // Assemble into a hardward result list typedef struct _MyRstList { unsigned int *command; MyRstItems ri; } MyRstList; // Tack on the XCB that the driver needs typedef struct MyRstList { LCBD_xcb xcb; MyRstList rl; } MyRstList; LCBC__mark_time_fill (&cl.ci.mark1, 200); LCBC__csr_access_fill (&cl.ci.csr, val, select, timeout); LCBC__mark_time_fill (&cl.ci.mark2, 400); LCBC__faults_access_fill (&cl.ci.cfaults, 0, -1, timeout); xcb = LCBD_post_bind (lcb, LCBD_cl_len (sizeof (*cl)), cl, LCBD_rl_len (sizeof (&rl->rl)), rl, head, 0, 0, 0, 0);
static __inline unsigned short int LCBD__rl_dlen | ( | const void * | beg, | |
const void * | end | |||
) | [static] |
Calculates the length, in 8-byte cells, between the specified beginning and ending pointers.
beg | A pointer to the beginning of either the result list (make sure it is the start of the hardward result list, not the result list + XCB) or the first result item (the safer, less ambigious thing to use). | |
end | A pointer to (in the usual C fashion) to address one past the last result item (i.e. where the next resultitem would go if there were one). |
static __inline unsigned short int LCBD__rl_len | ( | unsigned int | nbytes | ) | [static] |
Calculates the number of 8-byte cells in the specified number of bytes.
nbytes | The number of bytes to convert to 8-byte cells |
LCBD_xcb * LCBD_bind | ( | const LCBD | lcb, | |
unsigned short int | clLen, | |||
LCBD_cl * | cl, | |||
unsigned short int | rlLen, | |||
LCBD_rl * | rl, | |||
LCBD_rst_cb | cb, | |||
void * | prm, | |||
void * | user0, | |||
void * | user1, | |||
void * | user2, | |||
void * | user3 | |||
) |
Binds the XCB with everything needed to submit it to the LCB.
LCBD_bind_post
LCBD_bind_fork
lcb | The LCB driver handle | |
cl | The command list address | |
clLen | The length of the command items in units of 8-byte cells see LCBD__cl_len and LCBD__cl_dlen for help in calculating this value. | |
rl | The address of the result list | |
rlLen | The length of the result items in units of 8-byte cells see LCBD__rl_len and LCBD__rl_dlen for help in calculating this value. | |
cb | The callback routine | |
prm | The callback prameter | |
user0 | User parameter 0 | |
user1 | User parameter 1 | |
user2 | User parameter 2 | |
user3 | User parameter 3 |
References _LCBD_xcb_usr::cl, _LCBD_xcb_usr::clLen, _LCBD_xcb_sys::export, _LCBD_xcb_sys::lcb, LCB_REQUEST_LIST_ALIGN, LCB_REQUEST_LIST_MAX, LCBD_EXP_DSC_COMPOSE, _LCBD_xcb_sys::prm, _LCBD_rl::rl, _LCBD_xcb_usr::rl, _LCBD_xcb_usr::rlLen, _LCBD_xcb_sys::rtn, _LCBD_xcb::sys, _LCBD_xcb_usr::user, _LCBD_xcb::usr, and _LCBD_rl::xcb.
Referenced by LCBD_fork_bind(), and LCBD_post_bind().
LCBD_cl * LCBD_cl_alloc | ( | unsigned int | nbytes | ) |
Allocates a DMA-safe LCBD command list for the specified number of bytes. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_cl | |
NULL,the | allocation failed |
nbytes | The number of bytes to allocate for the entire list |
typedef struct _RequestCsrStallFaults { LCB_cl_hdr hdr; // Command list header LCB_ci_csr csr; // Command item for CSR access LCB_ci_mark_time stall; // Command item a mark time command LCB_ci_faults faults; // Command item for FAULT register access } RequestCsrStallFaults; LCBD_cl *cl = LCBD_cl_alloc (sizeof (RequestCsrStallFaults));
References LCBD_CL_ALIGN, and LCBD_cl_size().
Referenced by LCBD_cl_alloc8().
LCBD_cl * LCBD_cl_alloc8 | ( | unsigned int | n8bytes | ) |
Allocates a DMA-safe LCBD command list consisting of n8bytes of command items. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_rl | |
NULL,the | allocation failed |
n8bytes | The number of 8 byte cells to allocate.for the command items only. |
LCBD_cl *cl; // Generic command list LCB_ci *ci; // Generic command item cl = LCBD_cl_alloc8 (n_8byte_cells); // Need @e n 8 byte cells ci = &cl->cl.ci; // Locate the first command item fill (ci...) // Start filling them
References LCBD_cl_alloc().
LCBD_cl * LCBD_cl_alloc8_unprotected | ( | unsigned int | n8bytes | ) |
Allocates a correctly aligned but minimally-sized LCBD command list for the specified number of n8bytes command items. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_rl | |
NULL,the | allocation failed |
n8bytes | The number of 8 byte cells to allocate.for the command items only. |
References LCBD_cl_alloc_unprotected().
LCBD_cl * LCBD_cl_alloc_unprotected | ( | unsigned int | nbytes | ) |
Allocates a correctly aligned but minimally-sized LCBD command list for the specified number of bytes. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_cl | |
NULL,the | allocation failed |
nbytes | The number of bytes to allocate for the entire list |
References LCBD_CL_ALIGN.
Referenced by LCBD_cl_alloc8_unprotected().
unsigned short int LCBD_cl_size | ( | unsigned int | nbytes | ) |
Computes the size needed for a command list of nbytes to protect it from the bridge chip hangs. See Command and Result Lists, General Principles.
nbytes | The active size, in bytes, of the command list. |
References LCBD_CL_SIZE.
Referenced by LCBD_cl_alloc().
LCBD_xcb * LCBD_fork_bind | ( | LCBD | lcb, | |
unsigned short int | clLen, | |||
LCBD_cl * | cl, | |||
unsigned short int | rlLen, | |||
LCBD_rl * | rl, | |||
FORK_que * | que, | |||
FORK_cb_rtn | rtn, | |||
void * | user0, | |||
void * | user1, | |||
void * | user2, | |||
void * | user3 | |||
) |
Completes a transaction block using the FORK dispatch routines as the synchronization mechanism.
LCBD_bind_post
LCBD_bind_fork
lcb | Pointer to private LCBD structure | |
clLen | The length of the command list in units of 8-byte cells, see LCBD__cl_len and LCBD__cl_dlen for help in calculating this value. | |
cl | The command list | |
rlLen | The length of the result list in units of 8-byte cells, see LCBD__cl_len and LCBD__cl_dlen for help in calculating this value. | |
rl | The result list | |
*que | The target FORK que | |
rtn | The FORK dispatch routine | |
user0 | User parameter 0 | |
user1 | User parameter 1 | |
user2 | User parameter 2 | |
user3 | User parameter 3 |
References fork(), LCBD_bind(), _LCBD_xcb_sys::rsvd, _LCBD_xcb::sys, and _LCBD_rl::xcb.
LCBD_xcb * LCBD_post_bind | ( | LCBD | lcb, | |
unsigned short int | clLen, | |||
LCBD_cl * | cl, | |||
unsigned short int | rlLen, | |||
LCBD_rl * | rl, | |||
LCBD_post_head * | head, | |||
void * | user0, | |||
void * | user1, | |||
void * | user2, | |||
void * | user3 | |||
) |
Completes a transaction block that uses a queue as the synchronization mechanism.
lcb | Pointer to private LCBD structure | |
clLen | The length of the command items in units of 8-byte cells | |
cl | The command list | |
rlLen | The length of the result items in units of 8-byte cells | |
rl | The result list | |
*head | The target list head | |
user0 | User parameter 0 | |
user1 | User parameter 1 | |
user2 | User parameter 2 | |
user3 | User parameter 3 |
References LCBD_bind(), and post().
unsigned int LCBD_post_create | ( | LCBD_post_head * | head | ) |
Creates and initializes the head of the list that the LCBD_post routines use.
head | The list head to initialize |
unsigned int LCBD_post_destroy | ( | LCBD_post_head * | head | ) |
Destroys the head of the list created by LCBD_post_create.
head | The list head to destroy |
LCBD_xcb * LCBD_post_pendW | ( | LCBD_post_head * | head | ) |
Removes, with a wait, the next XCB posted to the indicated list head.
head | The list head to remove from |
A convenience routine to synchronously submit, execute and wait for the completion of the specified command list..
LCBD_CLTOOBIG,the | command/request list was too big for the LCB too handle | |
LCBD_CLMISALN,the | command/request list was not properly aligned. |
LCBD_bind_post
LCBD_bind_fork
lcb | Pointer to private LCBD structure | |
clLen | The length of the command items in units of 8-byte cells see LCBD__cl_len and LCBD__cl_dlen for help in calculating this value. | |
cl | The command list | |
rl | The result list |
References _LCBD_xcb_sys::export, _LCBD_xcb_sys::lcb, LCB_REQUEST_LIST_ALIGN, LCB_REQUEST_LIST_MAX, LCBD_submit(), _LCBD_xcb_sys::prm, _LCBD_rl::rl, _LCBD_xcb_sys::rtn, _LCBD_xcb::sys, wake(), and _LCBD_rl::xcb.
Referenced by LCBC_cmd_xmit(), and LCBC_cmdr_xmit().
LCBD_rl * LCBD_rl_alloc | ( | unsigned int | nbytes | ) |
Allocates a DMA-safe LCBD result list for the specified number of bytes. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_rl | |
NULL,the | allocation failed |
nbytes | The number of bytes to allocate for the entire list |
typedef struct _ResultCsrStallFaults { LCBD_xcb xcb; // Include the transaction control block LCB_rl_hdr hdr; // Result list header LCB_ri_csr csr; // Result item for CSR access LCB_ri_mark_time stall; // Result item a mark time command LCB_ri_faults faults; // Result list for FAULT register access } ResultCsrStallFaults; LCBC_rl *rl = LCBD_rl_alloc (sizeof (ResultCsrStallFaults);
References LCBD_RL_ALIGN, and LCBD_rl_size().
Referenced by LCBD_rl_alloc8().
LCBD_rl * LCBD_rl_alloc8 | ( | unsigned int | n8bytes | ) |
Allocates a DMA-safe LCBD result list consisting of n8bytes of result items. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_rl | |
NULL,the | allocation failed |
n8bytes | The number of 8 byte cells to allocate.for the result items only. |
LCBD_rl *rl; // Generic result list LCB_ri *ri; // Generic result item rl = LCBD_rl_alloc8 (n_8byte_cells); // Need @e n 8 byte cells ri = &rl->rl.ri; // Locate the first command item fill (ri...) // Start filling them
References LCBD_rl_alloc().
LCBD_rl * LCBD_rl_alloc8_unprotected | ( | unsigned int | n8bytes | ) |
Allocates a correctly aligned but minimally-sized LCBD result list for the specified number of n8byte result items. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_rl | |
NULL,the | allocation failed |
n8bytes | The number of 8 byte cells to allocate.for the result items only. |
References LCBD_rl_alloc_unprotected().
LCBD_rl * LCBD_rl_alloc_unprotected | ( | unsigned int | nbytes | ) |
Allocates a correctly aligned but minimally-sized LCBD result list for the specified number of bytes. See Command and Result Lists, General Principles.
Non-NULL,a | pointer to the an LCBD_rl | |
NULL,the | allocation failed |
nbytes | The number of bytes to allocate for the entire list |
References LCBD_RL_ALIGN.
Referenced by LCBD_rl_alloc8_unprotected().
unsigned short int LCBD_rl_size | ( | unsigned int | nbytes | ) |
Computes the size needed for a result list of nbytes to protect it from the bridge chip hangs. See Command and Result Lists, General Principles.
nbytes | The active size, in bytes, of the result list. |
References LCBD_RL_SIZE.
Referenced by LCBD_rl_alloc().
unsigned int LCBD_rst_handler_create | ( | LCBD | lcb, | |
int | priority | |||
) |
Creates the result service task.
lcb | The LCBD driver handle | |
priority | The priority of the task. If specified as 0, a default value is used. |
References lcbd_create_handler(), and LCBD_RST_K_DEFAULT_PRIORITY.
unsigned int LCBD_rst_null_cb_set | ( | LCBD | lcb, | |
LCBD_rst_null_cb | cb, | |||
void * | prm | |||
) |
Establish callback for handling null result descriptors.
LCBD_OK |
lcb | The LCB driver handle | |
cb | The LCB null result descriptor handler | |
prm | The LCB null result descriptor parameter |
LCBD_rst_null_cbp LCBD_rst_null_cbp_get | ( | LCBD | lcb | ) |
Returns the callback routine for the null result descriptor handler plus its parameter.
lcb | The LCB driver handle |
unsigned int LCBD_rst_que_install | ( | LCBD | lcb, | |
FORK_que * | que | |||
) |
Installs queue from fcb as the ISR -> task message queue for result traffic.
lcb | Pointer to private LCBD structure | |
que | The FORK que to use |
LCBD_OK,on | success; currently there is no failure mode |
TASK_attr attributes; // Fill out the task attribute information attributes.options = 0; attributes.stack_addr = 0; attributes.stack_size = 0; attributes.name = "tLCBDresult"; attributes.priority = 60; // Allocate enough memory to support the FORK task fcb = (FORK_fcb *)MBA_alloc(FORK_fcb_sizeof(1)); // Create FORK queue status = FORK_create(fcb, // fork control block &attributes, // use task attributes NULL, // default callback lcb, // callback parm NULL, // timeout callback parm TOC_FOREVER, // timeout 1, // define a single que NULL, // No queue configuration 0, // No system messages NULL, // No system messages 0); // No system messages // Locate the que to use and install it que = FORK_que_get (0); status = LCBD_rst_que_install (lcb, que);
References LCBD_OK.
unsigned int LCBD_rst_rcv_err_map | ( | unsigned int | err | ) |
Maps a receive error to a standard LCB message code.
err | The receive error to map |
References _LCBD_rst_err_maps::rcv.
Referenced by check(), LCBC_cmd_xmit(), and LCBC_cmdr_xmit().
unsigned int LCBD_rst_xfr_err_map | ( | unsigned int | err | ) |
Maps a generalize result error to a standard LCB message code.
err | The result transfer error code. |
References _LCBD_rst_err_maps::xfr.
Referenced by check().
unsigned int LCBD_submit | ( | LCBD_xcb * | xcb | ) |
Submits the command request.
xcb | The completely bound transaction control block |
References _LCBD_xcb_sys::lcb, LCBD_OK, LCBD_STATE_ONLINE, LCBD_STATS_RST_TX_PENDED, LCBD_STATS_RST_TX_POSTED, _LCBD_xcb_que::node, _LCBD_xcb::que, submit(), and _LCBD_xcb::sys.
Referenced by LCBD_qioW(), and LCBD_submitW().
unsigned int LCBD_submitW | ( | LCBD_xcb * | xcb | ) |
Submits the command request and waits for completion.
xcb | The completely bound transaction control block |
References LCBD_submit(), _LCBD_xcb_sys::prm, _LCBD_xcb_sys::rtn, _LCBD_xcb::sys, and wake().