GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCS / V1-5-4 > lcs_test / linux-gcc
#include <stdio.h>
#include <string.h>
#include "PBS/FFS.ih"
#include "PBS/FPA.h"
#include "PBS/MBA.h"
#include "PBS/WCT.h"
#include "PBS/WUT.h"
#include "LCBD/LCB_cr.h"
#include "LCBD/LCBD_drv.h"
#include "LCBD/LCBC.h"
#include "IMM/FPM_pubdefs.h"
#include "ITC/ITC_drvdefs.h"
#include "ITC/ITC_pubdefs.h"
#include "LCS/LCS_drvdefs.h"
#include "LCS/LCS_msgs.h"
#include "LCS_prvdefs.h"
#include "LCS_prvtest.h"
Defines | |
#define | LCS_L_CMD ( 8 ) |
Number of command buffers. | |
#define | LCS_L_MSG ( 16 ) |
Number of message buffers. | |
#define | LCS_L_PAGE ( 0x200 ) |
Length of a "page". | |
#define | LCS_K_PAGE ( 0x200 ) |
Number of pages per FPA buffer. | |
Functions | |
static FORK_cb_status | fragmentSet (FORK_cb_prm *prm, FORK_msg_hdr *msg) |
Force a fragmentation. | |
static WUT_cb_status | fragmentTimer (void *prm, WUT_tmr *wut) |
Timer callback routine to queue a message back to a fork. | |
void * | LRX_allocTest (ITC_Queue *queue, unsigned int siz, ITC_cb_Completion **rtn, void **cb0, void **cb1, void **cb2) |
Allocation plug-in (normal operation ... not testing). | |
unsigned int | LCS_accumRcv (void *prm, const ITC_QueueItem *qitem, void *pay, unsigned int len) |
Raw packet processing. | |
void | LCS_dumpHex (const void *buf, int bef, int aft) |
Simple hex dump. | |
void | LCS_dumpRcv (ITC_TaskID tid, ITC_QueueID qid) |
Raw packet processing. | |
void | LCS_clearRcv (ITC_TaskID tid, ITC_QueueID qid) |
Raw packet processing. | |
void | LCS_freeBuffer (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx) |
Free allocated buffer. | |
void | LCS_freeCCSDS (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx) |
Free allocated buffer. | |
unsigned int | LCS_testAttach (ITC_TaskID tid) |
Attach LCS testability features to a task. | |
unsigned int | LCS_testInitialize () |
One time initialization of resources needed for LCS testing. | |
unsigned int | LCS_sendCCSDS (unsigned int tst, unsigned int apid, int fst, int lst, int pgs, int beg, int end, ITC_cb_Completion *rtn, FPA_fcb *fcb, unsigned char *buf, LCS_Cmd *cmd) |
Send a message (no memory allocation). | |
unsigned int | LCS_sendCPU (ITC_NodeID nid, ITC_TaskID tid, ITC_QueueID qid, ITC_ProtID pid, int pgs, int beg, int end) |
Send a message (automatic memory allocation). | |
unsigned int | LCS_sendMessage (unsigned int tst, ITC_NodeID nid, ITC_TaskID tid, ITC_QueueID qid, ITC_ProtID pid, int pgs, int beg, int end, ITC_cb_Completion *rtn, FPA_fcb *fcb, unsigned char *buf, LCS_Cmd *cmd) |
Send a message (no memory allocation). | |
unsigned int | LCS_sendSDI (unsigned int apid, int fst, int lst, int pgs, int beg, int end) |
Send a message (automatic memory allocation). | |
Variables | |
LCS_TestControl * | LCS_tcb |
Control block for LCS testing. | |
LCS_Cmd * | cmd |
A command used in the fragmentation test. | |
unsigned int | nomore |
Flag to discontinue the fragmenetation wake-up timer. |
CVS $Id: LCS_common.c,v 1.9 2009/07/30 23:48:05 apw Exp $
static FORK_cb_status fragmentSet | ( | FORK_cb_prm * | prm, | |
FORK_msg_hdr * | msg | |||
) | [static] |
Force a fragmentation.
fragmentSet() sets the LCB CSR register to introduce a fragment.
static WUT_cb_status fragmentTimer | ( | void * | prm, | |
WUT_tmr * | wut | |||
) | [static] |
Timer callback routine to queue a message back to a fork.
prm | (in) User context parameter | |
wut | (in) Timer handle |
unsigned int LCS_accumRcv | ( | void * | prm, | |
const ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) |
Raw packet processing.
prm | (in) User context parameter | |
qitem | (in) Queue item | |
pay | (in) Queue item payload pointer | |
len | (in) Queue item payload length |
LCS_SUCCESS | Success |
void LCS_clearRcv | ( | ITC_TaskID | tid, | |
ITC_QueueID | qid | |||
) |
Raw packet processing.
tid | (in) ITC task ID (-1 for all) | |
qid | (in) ITC queue ID (-1 for all) |
void LCS_dumpHex | ( | const void * | buf, | |
int | bef, | |||
int | aft | |||
) |
Simple hex dump.
buf | Reference address | |
bef | Offset from buf to begin dump (inclusive) | |
aft | Offset from buf to end dump (exclusive) |
void LCS_dumpRcv | ( | ITC_TaskID | tid, | |
ITC_QueueID | qid | |||
) |
Raw packet processing.
tid | (in) ITC task ID | |
qid | (in) ITC queue ID |
void LCS_freeBuffer | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
void * | prm0, | |||
void * | prm1, | |||
void * | prm2, | |||
unsigned int | tx | |||
) |
Free allocated buffer.
qitem | (in) Queue item (unused) | |
status | (in) Processing completion code (unused) | |
prm0 | (in) User parameter 0 (unused) | |
prm1 | (in) User parameter 1 (unused) | |
prm2 | (in) User parameter 2 (unused) | |
tx | (in) Tx/Rx free (1/0) |
void LCS_freeCCSDS | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
void * | prm0, | |||
void * | prm1, | |||
void * | prm2, | |||
unsigned int | tx | |||
) |
Free allocated buffer.
qitem | (in) Queue item (unused) | |
status | (in) Processing completion code (unused) | |
prm0 | (in) User parameter 0 (unused) | |
prm1 | (in) User parameter 1 (unused) | |
prm2 | (in) User parameter 2 (unused) | |
tx | (in) Tx/Rx free (1/0) |
unsigned int LCS_sendCCSDS | ( | unsigned int | tst, | |
unsigned int | apid, | |||
int | fst, | |||
int | lst, | |||
int | pgs, | |||
int | beg, | |||
int | end, | |||
ITC_cb_Completion * | rtn, | |||
FPA_fcb * | fcb, | |||
unsigned char * | buf, | |||
LCS_Cmd * | cmd | |||
) |
Send a message (no memory allocation).
tst | (in) Test ID | |
apid | (in) APID | |
fst | (in) If true, set the "first" bit in CCSDS sequence flags | |
lst | (in) If true, set the "last" bit in CCSDS sequence flags | |
pgs | (in) Number of 512 byte pages to send | |
beg | (in) Offset from perfect alignment at send head | |
end | (in) Offset from perfect alignment at send tail | |
rtn | (in) ITC completion routine | |
fcb | (in) FPA control block | |
buf | (in) Message buffer | |
cmd | (in) Command buffer (can be null) |
LCS_GENERROR | Failure | |
LCS_SUCCESS | Success |
unsigned int LCS_sendCPU | ( | ITC_NodeID | nid, | |
ITC_TaskID | tid, | |||
ITC_QueueID | qid, | |||
ITC_ProtID | pid, | |||
int | pgs, | |||
int | beg, | |||
int | end | |||
) |
Send a message (automatic memory allocation).
nid | (in) Destination node ID | |
tid | (in) Destination task ID | |
qid | (in) Destination queue ID | |
pid | (in) Hardware protocol ID | |
pgs | (in) Number of 512 byte pages to send | |
beg | (in) Offset from perfect alignment at send head | |
end | (in) Offset from perfect alignment at send tail |
LCS_GENERROR | Failure | |
LCS_SUCCESS | Success |
unsigned int LCS_sendMessage | ( | unsigned int | tst, | |
ITC_NodeID | nid, | |||
ITC_TaskID | tid, | |||
ITC_QueueID | qid, | |||
ITC_ProtID | pid, | |||
int | pgs, | |||
int | beg, | |||
int | end, | |||
ITC_cb_Completion * | rtn, | |||
FPA_fcb * | fcb, | |||
unsigned char * | buf, | |||
LCS_Cmd * | cmd | |||
) |
Send a message (no memory allocation).
tst | (in) Test ID | |
nid | (in) Destination node ID | |
tid | (in) Destination task ID | |
qid | (in) Destination queue ID | |
pid | (in) Hardware protocol ID | |
pgs | (in) Number of 512 byte pages to send | |
beg | (in) Offset from perfect alignment at send head | |
end | (in) Offset from perfect alignment at send tail | |
rtn | (in) ITC completion routine | |
fcb | (in) FPA control block | |
buf | (in) Message buffer | |
cmd | (in) Command buffer (can be null) |
LCS_GENERROR | Failure | |
LCS_SUCCESS | Success |
unsigned int LCS_sendSDI | ( | unsigned int | apid, | |
int | fst, | |||
int | lst, | |||
int | pgs, | |||
int | beg, | |||
int | end | |||
) |
Send a message (automatic memory allocation).
apid | (in) APID | |
fst | (in) If true, set the "first" bit in CCSDS sequence flags | |
lst | (in) If true, set the "last" bit in CCSDS sequence flags | |
pgs | (in) Number of 512 byte pages to send | |
beg | (in) Offset from perfect alignment at send head | |
end | (in) Offset from perfect alignment at send tail |
LCS_GENERROR | Failure | |
LCS_SUCCESS | Success |
unsigned int LCS_testAttach | ( | ITC_TaskID | tid | ) |
Attach LCS testability features to a task.
tid | (in) Task to "instrument" |
void * LRX_allocTest | ( | ITC_Queue * | queue, | |
unsigned int | siz, | |||
ITC_cb_Completion ** | rtn, | |||
void ** | cb0, | |||
void ** | cb1, | |||
void ** | cb2 | |||
) |
Allocation plug-in (normal operation ... not testing).
queue | (in) Queue handle | |
siz | (in) Bytes to allocate | |
rtn | (out) Memory deallocation callback routine | |
cb0 | (out) Memory deallocation callback routine parameter 0 | |
cb1 | (out) Memory deallocation callback routine parameter 1 | |
cb2 | (out) Memory deallocation callback routine parameter 2 |