GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCS / V1-5-6 > lcs / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

LCS_prvdefs.h File Reference

Private definitions for the LCS package. More...

#include <PBS/FORK.h>
#include <PBS/FPA.h>
#include <PBS/MTX.h>
#include <PBS/RW.ih>
#include <PBS/WCT.h>
#include <PBS/WUT.h>
#include <ITC/ITC_pubdefs.h>
#include <LCBD/LCBD_cr.h>
#include <LCBD/LCBD_evt.h>
#include <LCS/LCS_pubdefs.h>

Classes

struct  _LCS_ProtocolSDI
 Structure to describe the CPU/SDI protocol header. More...
struct  _LCS_ContextSDI
 Structure to save extra context the CPU/SDI protocol header. More...
struct  _LCS_HeaderSDI
 Structure incorporating both CPU/SDI protocol and extra context. More...
union  _LCS_Data
 Various ways of accessing the LCS_ProtocolCPU payload word. More...
struct  _LCS_ProtocolCPU
 Structure to describe the CPU/CPU protocol header. More...
struct  _LCS_ContextCPU
 Structure to save extra context the CPU/CPU protocol header. More...
struct  _LCS_HeaderCPU
 Structure incorporating both CPU/SDI protocol and extra context. More...
union  _LCS_Protocol
 Union of the possible LCS protocols. More...
union  _LCS_Header
 Union of the possible LCS header formats. More...
struct  _LCS_Reply
 Message structure that can be queued to a fork. More...
struct  _LCS_Timeout
 Message structure that can be queued to a fork. More...
struct  _LRX_Driver
 Message structure that can be queued to a fork. More...
struct  _LRX_Engine
 Structure to hold LCS receive engine information. More...
struct  _LRX_Service
 Structure to hold LCS receive service information. More...
struct  _LTX_Adapter
 Structure to describe a protocol adapter's size and callbacks. More...
struct  _LTX_Sync
 Synchronization structure for an LTX engine. More...
struct  _LTX_Timing
 Timing/performance instrumentation block. More...
struct  _LTX_Engine
 Structure to hold LCS transmit engine information. More...
struct  _LTX_Service
 Structure to hold LCS transmit service information. More...
struct  _LCS_Control
 LCS control block. More...

Defines

#define LCS_L_DATEASCII   ( 30 )
 Minimum length of a string buffer to use with LCS_wct2ascii().
#define LCS_K_HARDBASE   ( 0x21 )
 Base of CPU hardware addresses on EBM.
#define LCS_K_CL_PAT   ( 0xabcadaba )
 Pattern word used to fill out the lookaside command buffer.
#define LCS_K_CL_HDR   ( sizeof( LCBD_cl_event ) - sizeof( unsigned int ) )
 Offset in command list to protocol header.
#define LRX_K_PROT2   ( ITC_PID_NOACK - ITC_K_PROTS )
 Index for protocol 2 receive statistics.
#define LRX_K_PROT3   ( ITC_PID_ACK - ITC_K_PROTS )
 Index for protocol 3 receive statistics.
#define LRX_M_P2_PACKET   ( 0x0001 )
 Protocol 2 packet (fragment sequence == 0).
#define LRX_M_P2_SHARD   ( 0x0002 )
 Protocol 2 shard (fragment sequence != 0).
#define LRX_M_P3_PACKET   ( 0x0004 )
 Protocol 3 packet (fragment sequence == 0).
#define LRX_M_P3_SHARD   ( 0x0008 )
 Protocol 3 shard (fragment sequence != 0).
#define LRX_M_P3_ALLOC   ( 0x0010 )
 Protocol 3 allocation request.
#define LRX_M_STOPPED   ( 0x0020 )
 Receive engine is stopped.
#define LRX_M_OR_P2   ( LRX_M_P2_PACKET | LRX_M_P2_SHARD )
 Protocol 2 packet or shard.
#define LRX_M_OR_P3   ( LRX_M_P3_PACKET | LRX_M_P3_SHARD )
 Protocol 3 packet or shard.
#define LRX_M_OR_SHARD   ( LRX_M_P2_SHARD | LRX_M_P3_SHARD )
 Protocol 2 or 3 shard.
#define LRX_M_OR_READY   ( LRX_M_P2_PACKET | LRX_M_P3_ALLOC )
 Protocol 2 packet or protocol 3 allocation.
#define LTX_L_PAGES   ( 8 )
 Maximum pages per packet (plus one).
#define LTX_K_PAGE   ( 9 )
 Number of bits in page address.
#define LTX_M_PAGE   ( ( 1 << LTX_K_PAGE ) - 1 )
 Mask of page addressing bits.
#define LTX_M_SDI_APID   ( 0x07ff )
 Extract APID from CCSDS header.
#define LTX_M_SDI_END   ( 0x8000 )
 Extract end sequence bit from CCSDS header.
#define LTX_M_SDI_BEG   ( 0x4000 )
 Extract begin sequence bit from CCSDS header.
#define LTX_M_SDI_SEQ   ( 0x3fff )
 Extract sequence number from CCSDS header.
#define LTX_K_PAD_OVR   ( 5 )
 Number of bits to count oversend.
#define LTX_K_PAD_SEQ   ( 9 )
 Number of bits to sequence within transaction.
#define LTX_K_PAD_END   ( 1 )
 Number of bits to indicate transaction end.
#define LTX_K_PAD_BEG   ( 1 )
 Number of bits to indicate transaction begin.
#define LTX_V_PAD_OVR   ( 0 )
 Bit offset to the count oversend.
#define LTX_V_PAD_SEQ   ( LTX_V_PAD_OVR + LTX_K_PAD_OVR )
 Bit offset to sequence within transaction.
#define LTX_V_PAD_END   ( LTX_V_PAD_SEQ + LTX_K_PAD_SEQ )
 Bit offset to transaction end flag.
#define LTX_V_PAD_BEG   ( LTX_V_PAD_END + LTX_K_PAD_END )
 Bit offset to transaction begin flag.
#define LTX_M_PAD_OVR   ( ( ( 1 << LTX_K_PAD_OVR ) - 1 ) )
 In place mask for the count oversend.
#define LTX_M_PAD_SEQ   ( ( ( 1 << LTX_K_PAD_SEQ ) - 1 ) << LTX_V_PAD_SEQ )
 In place mask for sequence count.
#define LTX_M_PAD_END   ( ( ( 1 << LTX_K_PAD_END ) - 1 ) << LTX_V_PAD_END )
 In place mask for transaction end flag.
#define LTX_M_PAD_BEG   ( ( ( 1 << LTX_K_PAD_BEG ) - 1 ) << LTX_V_PAD_BEG )
 In place mask for transaction begin flag.
#define LCS_K_OPCODES   (1)
 Base of operation code range.
#define LCS_L_OPCODES   (2)
 Length of operation code range.
#define LCS_L_SVC_STATES   (4)
 Number of states an LCS service can be in.
#define LCS_L_CTL_STATES   (2)
 Number of LCS control states.
#define LTX_L_ADAPTERS   (3)
 Number of LTX protocol adapters.
#define LRX_L_COUNTERS   (12)
 Number of statistics counters.
#define LRX_L_DRIVERS   (3)
 Length of driver list.
#define LTX_L_ENG_STATES   (3)
 Number of states an LCS transmit engine can be in.

Typedefs

typedef enum _LCS_OpCode LCS_OpCode
 Typedef for enum _LCS_OpCode.
typedef enum _LCS_ServiceState LCS_ServiceState
 Typedef for enum _LCS_ServiceState.
typedef enum _LCS_ControlState LCS_ControlState
 Typedef for enum _LCS_ControlState.
typedef enum _LTX_AdapterList LTX_AdapterList
 Typedef for enum _LTX_AdapterList.
typedef enum _LRX_Counter LRX_Counter
 Typedef for enum _LRX_Counter.
typedef enum _LRX_DriverList LRX_DriverList
 Typedef for enum _LRX_DriverList.
typedef enum _LTX_EngineState LTX_EngineState
 Typedef for enum _LTX_EngineState.
typedef unsigned int LTX_cb_Start (struct _LTX_Engine *txe)
 Signature for the start routine of an adapter.
typedef unsigned int LTX_cb_Header (struct _LTX_Engine *txe, unsigned int siz)
 Signature for the header construction routine of an adapter.
typedef FORK_cb_status LTX_cb_Next (LTX_Engine *txe)
 Signature for a synchronize callable routine.
typedef unsigned int LTX_cb_Test (void *prm, LTX_Engine *txe, LCBD_cl_event *cl)
 Signature for an LCS transmit test point callback routine.
typedef struct _LCS_ProtocolSDI LCS_ProtocolSDI
 Typedef for struct _LCS_ProtocolSDI.
typedef struct _LCS_ContextSDI LCS_ContextSDI
 Typedef for struct _LCS_ContextSDI.
typedef struct _LCS_HeaderSDI LCS_HeaderSDI
 Typedef for struct _LCS_HeaderSDI.
typedef union _LCS_Data LCS_Data
 Typedef for union _LCS_Data.
typedef struct _LCS_ProtocolCPU LCS_ProtocolCPU
 Typedef for struct _LCS_ProtocolCPU.
typedef struct _LCS_ContextCPU LCS_ContextCPU
 Typedef for struct _LCS_ContextCPU.
typedef struct _LCS_HeaderCPU LCS_HeaderCPU
 Typedef for struct _LCS_HeaderCPU.
typedef union _LCS_Protocol LCS_Protocol
 Typedef for union _LCS_Protocol.
typedef union _LCS_Header LCS_Header
 Typedef for union _LCS_Header.
typedef struct _LCS_Reply LCS_Reply
 Typedef for struct _LCS_Reply.
typedef struct _LCS_Timeout LCS_Timeout
 Typedef for struct _LCS_Timeout.
typedef struct _LRX_Driver LRX_Driver
 Typedef for struct _LRX_Driver.
typedef struct _LRX_Service LRX_Service
 Typedef for struct _LRX_Service.
typedef struct _LTX_Adapter LTX_Adapter
 Typedef for struct _LTX_Adapter.
typedef struct _LTX_Sync LTX_Sync
 Typedef for struct _LTX_Sync.
typedef struct _LTX_Service LTX_Service
 Typedef for struct _LTX_Service.

Enumerations

enum  _LCS_OpCode {
  LCS_OPCD_NONE = 0,
  LCS_OPCD_SEND = 1,
  LCS_OPCD_ALLOC = 2
}
 Enumeration of operation codes. More...
enum  _LCS_ServiceState {
  LCS_SVC_UNINITIALIZED = 0,
  LCS_SVC_INITIALIZED = 1,
  LCS_SVC_STARTED = 2,
  LCS_SVC_STOPPING = 3
}
 Enumeration of states an LCS service can be in. More...
enum  _LCS_ControlState {
  LCS_CTL_UNINITIALIZED = 0,
  LCS_CTL_INITIALIZED = 1
}
 Enumeration of LCS control states. More...
enum  _LTX_AdapterList {
  LTX_ADAPTER_CPU2 = 0,
  LTX_ADAPTER_CPU3 = 1,
  LTX_ADAPTER_SDI2 = 2
}
 Enumeration of LTX protocol adapters. More...
enum  _LRX_Counter {
  LRX_CNT_RQALOC = 0,
  LRX_CNT_PACKET = 1,
  LRX_CNT_SHARD = 2,
  LRX_CNT_FSM_READY_ERR = 3,
  LRX_CNT_FSM_ACTIVE_ERR = 4,
  LRX_CNT_ALLOCATION_ERR = 5,
  LRX_CNT_TRANSACTION_ERR = 6,
  LRX_CNT_SEQ_CNT_ERR = 7,
  LRX_CNT_FRG_CNT_ERR = 8,
  LRX_CNT_OVERRUN_ERR = 9,
  LRX_CNT_UNDERRUN_ERR = 10,
  LRX_CNT_DISPATCH_ERR = 11
}
 Enumeration of LRX statistics counters. More...
enum  _LRX_DriverList {
  LRX_DRV_RESULT = 0,
  LRX_DRV_EVENT = 1,
  LRX_DRV_NUT = 2
}
 Enumeration of driver tasks. More...
enum  _LTX_EngineState {
  LTX_ENG_NONE = 0,
  LTX_ENG_READY = 1,
  LTX_ENG_BUSY = 2
}
 Enumeration of states an LCS transmit engine can be in. More...

Functions

LRX_EngineLCS_getRxEngine (ITC_NodeID nid, ITC_QueueID qid)
 Return the LRX engine handle.
LTX_EngineLCS_getTxEngine (ITC_TaskID tid, ITC_QueueID qid)
 Return the LTX engine handle.
unsigned int LCS_roundTo (unsigned int val, unsigned int off, unsigned int rnd)
 Round a number up to the next (off + n * rnd) boundary.
unsigned int LCS_sizeofRxEngine (void)
 Return size of an LRX engine structure.
unsigned int LCS_sizeofTxEngine (void)
 Return size of an LTX engine structure.
void * LRX_allocNormal (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 LRX_service2 (void *prm, unsigned int dsc, LCBD_evt *evt)
 Service LCB protocol 2 messages.
unsigned int LRX_service3 (void *prm, unsigned int dsc, LCBD_evt *evt)
 Service LCB protocol 2 messages.
unsigned int LRX_setAlloc (LRX_cb_Alloc *rtn)
 Set the allocation plug-in.
FORK_cb_status LTX_allocReply (FORK_cb_prm *prm, FORK_msg_hdr *msg)
 Process a reply to an allocation request.
void LTX_cancelTimer (LTX_Engine *txe)
 Cancel a synchronization timeout.
unsigned int LTX_protocolCPU (LTX_Engine *txe, unsigned int siz)
 Form the protocol header for one packet of a CPU/CPU transaction.
unsigned int LTX_protocolSDI (LTX_Engine *txe, unsigned int siz)
 Form the protocol header for one packet of a CPU/SDI transaction.
FORK_cb_status LTX_reset (LTX_Engine *txe, unsigned int status)
 Make the engine ready for new business.
unsigned int LTX_sendFirst (LTX_Engine *txe)
 LTX service task send first packet.
FORK_cb_status LTX_sendNext (LTX_Engine *txe, unsigned int status)
 Field the result item resulting from an event message send.
FORK_cb_status LTX_sendReply (FORK_cb_prm *prm, FORK_msg_hdr *msg)
 Process a reply to the last packet of a message.
FORK_cb_status LTX_sendSync (LTX_Engine *txe)
 Last packet synchronization.
unsigned int LTX_service (void *prm, const ITC_QueueItem *qitem, void *pay, unsigned int len)
 LTX service task queue item callback routine.
unsigned int LTX_startCPU2 (LTX_Engine *txe)
 Start a protocol 2 CPU to CPU transaction.
unsigned int LTX_startCPU3 (LTX_Engine *txe)
 Start a protocol 3 CPU to CPU transaction.
unsigned int LTX_startSDI2 (LTX_Engine *txe)
 Start a protocol 2 CPU to SDI transaction.
void LTX_startTimer (LTX_Engine *txe, unsigned int lcsp, unsigned int mto)
 Start synchronization timeout.
unsigned int LTX_submit (LTX_Engine *txe, LCBD_cl_event *cl, unsigned int siz)
 Construct an LTX packet (all kinds) and submit to the LCB.
unsigned int LTX_sync (LTX_Engine *txe, ITC_NodeID nid, unsigned int key, unsigned int dat)
 LTX service response synchronization.
unsigned int LCS_wct2ascii (WCT_time tim, char *asc)
 Convert a time (absolute units) to an ASCII string.

Variables

LCS_ControlLCS_lcb
 Master control block for the LCS system.
const char * LCS_ctl_states [LCS_L_CTL_STATES]
 String constants for LCS control block states.
const char * LCS_svc_states [LCS_L_SVC_STATES]
 String constants for LCS service block states.
const LTX_Adapter LTX_adapter [LTX_L_ADAPTERS]
 Instantiations of the protocol adapters.


Detailed Description

Private definitions for the LCS package.

CVS $Id: LCS_prvdefs.h,v 1.14 2011/03/28 22:49:56 apw Exp $
Author:
A.P.Waite

Enumeration Type Documentation

Enumeration of LCS control states.

Enumerator:
LCS_CTL_UNINITIALIZED  Uninitialized
LCS_CTL_INITIALIZED  Initialized

Enumeration of operation codes.

Enumerator:
LCS_OPCD_NONE  Guard value
LCS_OPCD_SEND  Plain packet transaction
LCS_OPCD_ALLOC  Memory allocation transaction

Enumeration of states an LCS service can be in.

Enumerator:
LCS_SVC_UNINITIALIZED  Service description uninitialized
LCS_SVC_INITIALIZED  Service description initialized
LCS_SVC_STARTED  Service started
LCS_SVC_STOPPING  Service stopping

Enumeration of LRX statistics counters.

Enumerator:
LRX_CNT_RQALOC  Allocation requests
LRX_CNT_PACKET  Packets
LRX_CNT_SHARD  Shards/fragments
LRX_CNT_FSM_READY_ERR  Sequencing error
LRX_CNT_FSM_ACTIVE_ERR  Sequencing error
LRX_CNT_ALLOCATION_ERR  Allocation error
LRX_CNT_TRANSACTION_ERR  Transaction ID error
LRX_CNT_SEQ_CNT_ERR  Sequence counter error
LRX_CNT_FRG_CNT_ERR  Fragment count error
LRX_CNT_OVERRUN_ERR  Buffer over-run error
LRX_CNT_UNDERRUN_ERR  Buffer under-run error
LRX_CNT_DISPATCH_ERR  Transaction dispatch error

Enumeration of driver tasks.

Enumerator:
LRX_DRV_RESULT  Result task
LRX_DRV_EVENT  Event task
LRX_DRV_NUT  NUT task

Enumeration of LTX protocol adapters.

Enumerator:
LTX_ADAPTER_CPU2  Protocol 2, CPU to CPU
LTX_ADAPTER_CPU3  Protocol 3, CPU to CPU
LTX_ADAPTER_SDI2  Protocol 2, CPU to SDI

Enumeration of states an LCS transmit engine can be in.

Enumerator:
LTX_ENG_NONE  Guard value
LTX_ENG_READY  Engine available
LTX_ENG_BUSY  Engine busy


Function Documentation

LTX_Engine * LCS_getRxEngine ( ITC_NodeID  nid,
ITC_QueueID  qid 
)

Return the LRX engine handle.

Parameters:
nid (in) ITC node ID
qid (in) ITC queue ID
Return values:
x Handle for LRX engine
NULL Cannot find handle
LCS_getRxEngine() returns the handle for an LRX engine.

References LCS_lcb, _LCS_Control::lrx, and _LRX_Service::rxe.

LTX_Engine * LCS_getTxEngine ( ITC_TaskID  tid,
ITC_QueueID  qid 
)

Return the LTX engine handle.

Parameters:
tid (in) ITC task ID
qid (in) ITC queue ID
Return values:
x Handle for LTX engine
NULL Cannot find handle
LCS_getTxEngine() returns the handle for an LTX engine.

References LCS_lcb, _LCS_Control::ltx, and _LTX_Service::txe.

unsigned int LCS_roundTo ( unsigned int  val,
unsigned int  off,
unsigned int  rnd 
)

Round a number up to the next (off + n * rnd) boundary.

Parameters:
val (in) Value to round off
off (in) Offset from boundary
rnd (in) Boundary
Return values:
x Rounded off value

Referenced by createEngines().

unsigned int LCS_sizeofRxEngine ( void   ) 

Return size of an LRX engine structure.

Return values:
x Size (bytes) of LRX engine

unsigned int LCS_sizeofTxEngine ( void   ) 

Return size of an LTX engine structure.

Return values:
x Size (bytes) of LRX engine

unsigned int LCS_wct2ascii ( WCT_time  tim,
char *  asc 
)

Convert a time (absolute units) to an ASCII string.

Parameters:
tim (in) Hardware address of the SIU
asc (out) ASCII datestamp string
Return values:
LCS_NOTINIT LCS control block not available
LCS_NOTSIUND Node address is not valid for an SIU
LCS_SUCCESS Success
LCS_wct2ascii() converts a WCT time (i.e. a time in absolute units) to an ASCII string representation: YYYY-MO-DD HH:MM:SS.uuuuuuuuu

Warning:
asc is assumed to point to a buffer that can accomodate the full return string. There is no protection against overwriting other memory if the buffer area is too short. The minimum buffer length is 30 (including the string terminator ... this number is available as a #define). Now you know why this is strictly an LCS private routine!

Referenced by LRX_replySent(), and LTX_resultList().

void * LRX_allocNormal ( ITC_Queue *  queue,
unsigned int  siz,
ITC_cb_Completion **  rtn,
void **  cb0,
void **  cb1,
void **  cb2 
)

Allocation plug-in (normal operation ... not testing).

Parameters:
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
LRX_allocNormal() is the canonical method for LCS to allocate memory from a destination task/queue using the memory management that the destination task has set up.

This routine is constructed as a plug-in so that the LCS test suite can substitute in a more elaborate allocator complete with buffer pre-painting and other such test-only gizmos.

Referenced by LRX_createService().

unsigned int LRX_service2 ( void *  prm,
unsigned int  dsc,
LCBD_evt *  evt 
)

Service LCB protocol 2 messages.

Parameters:
prm (in) User context parameter
dsc (in) Uninterpreted event descriptor
evt (in) Event
Return values:
0 Always

References _LRX_Service::broken, LRX_K_PROT2, LRX_M_P2_PACKET, LRX_M_P2_SHARD, and LRX_process().

Referenced by LRX_startService().

unsigned int LRX_service3 ( void *  prm,
unsigned int  dsc,
LCBD_evt *  evt 
)

Service LCB protocol 2 messages.

Parameters:
prm (in) User context parameter
dsc (in) Uninterpreted event descriptor
evt (in) Event
Return values:
0 Always

References _LRX_Service::broken, _LCS_ProtocolCPU::dat, LCS_OPCD_ALLOC, LCS_PRT_M_OPCD, LCS_PRT_M_RSP, LCS_PRT_V_OPCD, _LCS_ProtocolCPU::lcsp, LRX_K_PROT3, LRX_M_P3_ALLOC, LRX_M_P3_PACKET, LRX_M_P3_SHARD, LRX_process(), and LRX_replyDispatch().

Referenced by LRX_startService().

unsigned int LRX_setAlloc ( LRX_cb_Alloc rtn  ) 

Set the allocation plug-in.

Parameters:
rtn (in) LRX allocation plug-in
Return values:
LCS_CTLSTAT LCS master control block not in requested state
LCS_NOTINIT LCS master control block does not exist
LCS_SUCCESS Success
LCS_SVCHNDL LRX service control block does not exist
LCS_SVCSTAT LRX service control block not in requested state
LRX_setAlloc() changes the allocation plug-in

References _LRX_Service::allocRtn, LCS_lcb, and _LCS_Control::lrx.

FORK_cb_status LTX_allocReply ( FORK_cb_prm *  prm,
FORK_msg_hdr *  msg 
)

Process a reply to an allocation request.

Parameters:
prm (in) User context parameter (unused)
msg (in) Fork message
Return values:
FORK_C_CONTINUE Always
LTX_allocReply() is the fork routine to process a memory allocation response.

References _LCS_ProtocolCPU::dat, _LCS_Reply::hdr, LCS_PRT_M_KEY, LCS_PRT_M_SEID, LCS_PRT_M_SNID, LCS_PRT_V_KEY, LCS_PRT_V_SEID, LCS_PRT_V_SNID, _LCS_ProtocolCPU::lcsp, LTX_allocSync(), LTX_cancelTimer(), LTX_sync(), _LTX_Timing::qar, _LTX_Engine::tim, _LTX_Service::txe, and _LCS_Data::ui.

Referenced by LRX_replyDispatch().

void LTX_cancelTimer ( LTX_Engine txe  ) 

Cancel a synchronization timeout.

Parameters:
txe (in) Transmit engine

References _LTX_Timing::cnc, _LTX_Timing::hst, _LTX_Sync::mto, _LTX_Engine::snc, _LTX_Engine::tim, _LTX_Sync::tmr, and _LTX_Timing::tos.

Referenced by LTX_allocReply(), and LTX_sendReply().

unsigned int LTX_protocolCPU ( LTX_Engine txe,
unsigned int  siz 
)

unsigned int LTX_protocolSDI ( LTX_Engine txe,
unsigned int  siz 
)

Form the protocol header for one packet of a CPU/SDI transaction.

Parameters:
txe (in) LTX transmit engine
siz (in) Size (bytes) of packet payload
Return values:
cel The number of cells (16 byte objects) needed to send the message

References _LCS_ContextSDI::aid, _LCS_ContextSDI::apid, _LTX_Engine::beg, _LCS_ContextSDI::beg, _LCS_HeaderSDI::ctx, _LTX_Engine::end, _LCS_ContextSDI::end, _LTX_Sync::have, _LTX_Engine::hdr, _LTX_Sync::key, LTX_M_SDI_BEG, LTX_M_SDI_END, LTX_M_SDI_SEQ, LTX_sendSync(), _LTX_Sync::next, _LCS_ProtocolSDI::pad, _LCS_HeaderSDI::prt, _LCS_Header::sdi, _LCS_ProtocolSDI::seq, _LCS_ProtocolSDI::siz, _LTX_Engine::snc, _LCS_ProtocolSDI::tim, and _LTX_Sync::want.

FORK_cb_status LTX_reset ( LTX_Engine txe,
unsigned int  status 
)

Make the engine ready for new business.

Parameters:
txe (in) Transmit engine
status (in) Completion status for current transaction.
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References _LTX_Engine::adp, _LTX_Engine::beg, _LTX_Engine::clloc, _LTX_Engine::clsav, _LTX_Engine::cnt, _LTX_Engine::end, _LTX_Engine::iqm, _LTX_Sync::key, LCS_K_CL_HDR, LCS_K_CL_PAT, LTX_ENG_READY, _LTX_Engine::pat, _LTX_Engine::qitem, _LTX_Adapter::size, _LTX_Engine::snc, _LTX_Engine::state, _LTX_Engine::stloc, and _LTX_Engine::stsav.

Referenced by forkTimer(), LTX_allocSync(), LTX_resultList(), and LTX_sendNext().

unsigned int LTX_sendFirst ( LTX_Engine txe  ) 

FORK_cb_status LTX_sendNext ( LTX_Engine txe,
unsigned int  status 
)

Field the result item resulting from an event message send.

Parameters:
txe (in) Transmit engine
status (in) Status from previous packet
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References _LTX_Engine::adp, _LTX_Engine::beg, _LTX_Engine::cl, _LTX_Engine::clloc, _LTX_Engine::clnxt, _LTX_Engine::clsav, _LTX_Engine::end, _LTX_Engine::fit, _LTX_Engine::hdr, _LTX_Adapter::header, LCS_K_CL_HDR, _LTX_Engine::ltx, LTX_reset(), LTX_submit(), _LTX_Service::max, _LTX_Engine::qilen, _LTX_Engine::qipay, _LTX_Adapter::size, _LTX_Engine::stloc, and _LTX_Engine::stsav.

Referenced by LTX_sendSync().

FORK_cb_status LTX_sendReply ( FORK_cb_prm *  prm,
FORK_msg_hdr *  msg 
)

Process a reply to the last packet of a message.

Parameters:
prm (in) User context parameter (unused)
msg (in) Fork message
Return values:
FORK_C_CONTINUE Always
LTX_sendReply() is the fork routine to process a last packet response.

References _LCS_ProtocolCPU::dat, _LCS_Reply::hdr, LCS_PRT_M_KEY, LCS_PRT_M_SEID, LCS_PRT_M_SNID, LCS_PRT_V_KEY, LCS_PRT_V_SEID, LCS_PRT_V_SNID, _LCS_ProtocolCPU::lcsp, LTX_cancelTimer(), LTX_sync(), _LTX_Sync::next, _LTX_Timing::qsr, _LTX_Engine::snc, _LTX_Engine::tim, _LTX_Service::txe, and _LCS_Data::ui.

Referenced by LRX_replyDispatch().

FORK_cb_status LTX_sendSync ( LTX_Engine txe  ) 

Last packet synchronization.

Parameters:
txe (in) Transmit engine handle
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork
LTX_sendSync() synchronizes a reply to the last packet of a message.

References _LTX_Sync::dat, _LTX_Sync::have, LTX_sendNext(), and _LTX_Engine::snc.

Referenced by LTX_protocolCPU(), and LTX_protocolSDI().

unsigned int LTX_service ( void *  prm,
const ITC_QueueItem *  qitem,
void *  qipay,
unsigned int  qilen 
)

LTX service task queue item callback routine.

Parameters:
prm (in) User context parameter
qitem (in) Queue item
qipay (in) Queue item payload pointer
qilen (in) Queue item payload length
Return values:
x Assorted

References _LTX_Engine::adp, _LTX_Engine::iqm, LCS_getNodeAddress(), LCS_NIH_NONE, LTX_adapter, LTX_ADAPTER_CPU2, LTX_ADAPTER_CPU3, LTX_ADAPTER_SDI2, LTX_ENG_BUSY, LTX_ENG_READY, _LTX_Engine::pid, _LTX_Engine::pnid, _LTX_Engine::qilen, _LTX_Engine::qipay, _LTX_Engine::qitem, _LTX_Adapter::start, and _LTX_Engine::state.

Referenced by createService().

unsigned int LTX_startCPU2 ( LTX_Engine txe  ) 

Start a protocol 2 CPU to CPU transaction.

Parameters:
txe (in) LTX transmit engine
Return values:
LCS_SUCCESS Success
LCS_TXNGNSIZ Protocol 2 message size exceeds maximum

References _LTX_Engine::adp, _LTX_Engine::fit, LCS_K_CL_HDR, LTX_sendFirst(), _LTX_Engine::qilen, and _LTX_Adapter::size.

unsigned int LTX_startCPU3 ( LTX_Engine txe  ) 

unsigned int LTX_startSDI2 ( LTX_Engine txe  ) 

void LTX_startTimer ( LTX_Engine txe,
unsigned int  key,
unsigned int  mto 
)

Start synchronization timeout.

Parameters:
txe (in) Transmit engine
key (in) Transaction matching key
mto (in) Message timeout period (usec)

References expireTimer(), _LCS_Timeout::key, _LTX_Sync::msg, _LTX_Sync::mto, _LTX_Engine::snc, _LTX_Engine::tim, _LTX_Sync::tmr, _LTX_Timing::tos, and _LCS_Timeout::txe.

Referenced by LTX_resultList().

unsigned int LTX_submit ( LTX_Engine txe,
LCBD_cl_event *  cl,
unsigned int  cel 
)

Construct an LTX packet (all kinds) and submit to the LCB.

Parameters:
txe (in) LTX transmit engine
cl (in) LCB command list
cel (in) Cell count (complete message)
Return values:
LCS_LCBBIND LCB bind failed
LCS_LCBSUBMT LCB submit failed
LCS_SUCCESS Success

References _LTX_Service::fqi, _LTX_Sync::key, LCS_getNodeAddress(), _LTX_Engine::ltx, LTX_resultList(), _LTX_Engine::pid, _LTX_Engine::pnid, _LTX_Engine::rl, and _LTX_Engine::snc.

Referenced by LTX_sendFirst(), LTX_sendNext(), and LTX_startCPU3().

unsigned int LTX_sync ( LTX_Engine txe,
ITC_NodeID  nid,
unsigned int  key,
unsigned int  dat 
)

LTX service response synchronization.

Parameters:
txe (in) Transmit engine
nid (in) ITC node id to accumulate into synchronization
key (in) Transaction matching key (integrity check)
dat (in) Protocol specific, but usually return code from response
Return values:
0 Current transaction not synchronized
1 Current transaction synchronized

References _LTX_Sync::dat, _LTX_Sync::have, _LTX_Sync::key, _LTX_Engine::snc, and _LTX_Sync::want.

Referenced by LTX_allocReply(), LTX_resultList(), and LTX_sendReply().


Variable Documentation

Master control block for the LCS system.

Master control block for the LCS system. This is global, so care must be taken when writing elements of this block that the code is properly protected.

Referenced by checkState(), createService(), LCS_getControl(), LCS_getNodeAddress(), LCS_getNodeID(), LCS_getRxEngine(), LCS_getTxEngine(), LCS_setNodeAddressSIU(), LRX_createService(), LRX_deleteService(), LRX_process(), LRX_replyDispatch(), LRX_replySent(), LRX_reset(), LRX_setAlloc(), LRX_startService(), LRX_stopService(), LTX_deleteService(), LTX_resultList(), LTX_startService(), and LTX_stopService().


Generated on Tue Nov 29 17:11:24 2011 by  doxygen 1.5.8