GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCS / dev > lcs / rhel5-32
#include <string.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCBD/LATP.h>
#include <LCS/LCS_msgs.h>
#include <LCS/LCS_pubdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBI/TBD_id.h>
#include <PBS/CACHE.h>
#include <PBS/FFS.ih>
#include <PBS/MBA.h>
#include <PBS/TBD.ih>
#include <LCS_prvdefs.h>
Functions | |
static unsigned int | checkState (LCS_ControlState creq, ITC_TaskID tid, LCS_ServiceState sreq, const char *func) |
Check the state of master and service control blocks. | |
static unsigned int | createEngines (LTX_Service *ltx, unsigned int want) |
Create a set of transmit engines. | |
static unsigned int | createQueues (ITC_Task *itc, unsigned int want, void *rtn, void *prm) |
Create a set of ITC queues. | |
static unsigned int | createService (ITC_TaskID tid, unsigned int nim, unsigned int qim, unsigned int pgs, unsigned int mto, ITC_cb_Memory *rtn, void *prm) |
Initialize an LTX service control block. | |
static unsigned int | deleteEngines (LTX_Service *ltx, unsigned int want) |
Delete a set of queues. | |
static unsigned int | deleteQueues (ITC_Task *itc, unsigned int want) |
Delete a set of queues. | |
static void | startMeta (void *prm) |
LCB based service task one time initialization (in context of task). | |
static void | stopMeta (void *prm) |
LCB based service task one time shutdown (in context of task). | |
unsigned int | LTX_createService (ITC_TaskID tid, unsigned int nim, unsigned int pgs, unsigned int mto, ITC_cb_Memory *rtn, void *prm) |
Create an LTX service task for CPU/CPU communications. | |
unsigned int | LTX_createServiceCPU (ITC_TaskID tid, unsigned int nim, unsigned int pgs, unsigned int mto, ITC_cb_Memory *rtn, void *prm) |
Create an LTX service task for CPU/CPU communications. | |
unsigned int | LTX_createServiceSDI (unsigned int pgs) |
Create an LTX service task for CPU/SDI communications. | |
unsigned int | LTX_deleteService (ITC_TaskID tid) |
Delete the LTX service task and associated resources. | |
unsigned int | LTX_startService (ITC_TaskID tid, TASK_attr *attr) |
Start an LTX communications service task. | |
unsigned int | LTX_stopService (ITC_TaskID tid) |
Stop the task implementing the LCS service layer. | |
Variables | |
const LTX_Adapter | LTX_adapter [LTX_L_ADAPTERS] |
Instantiations of the protocol adapters. |
CVS $Id: LTX_control.c,v 1.13 2011/03/28 22:49:57 apw Exp $
static unsigned int checkState | ( | LCS_ControlState | creq, | |
ITC_TaskID | tid, | |||
LCS_ServiceState | sreq, | |||
const char * | func | |||
) | [static] |
Check the state of master and service control blocks.
creq | (in) Required state of LCS master control block | |
tid | (in) ITC task ID (from service set of tasks) | |
sreq | (in) Required state of service control block | |
func | (in) Name of function calling this routine |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_SVCHNDL | Service control block does not exist | |
LCS_SVCSTAT | Service control block not in requested state |
References _LTX_Service::chk, LCS_ctl_states, LCS_lcb, LCS_svc_states, _LCS_Control::ltx, _LCS_Control::mtx, _LTX_Service::state, and _LCS_Control::state.
Referenced by LRX_deleteService(), LRX_startService(), LRX_stopService(), LTX_deleteService(), LTX_startService(), and LTX_stopService().
static unsigned int createEngines | ( | LTX_Service * | ltx, | |
unsigned int | want | |||
) | [static] |
Create a set of transmit engines.
ltx | Service handle | |
want | Mask of engines to create |
have | Mask of engines created (may not be all of them) |
References _LTX_Engine::bnd, _LTX_Engine::cl, _LTX_Engine::clsav, _LTX_Engine::cnt, _LTX_Engine::eid, _LTX_Engine::fit, _LTX_Engine::iqm, LCS_K_CL_HDR, LCS_K_CL_PAT, LCS_roundTo(), _LTX_Engine::ltx, LTX_ENG_READY, _LTX_Service::max, _LTX_Engine::pat, _LTX_Engine::rl, _LTX_Engine::snc, _LTX_Engine::state, _LTX_Engine::stsav, _LTX_Sync::tmr, and _LTX_Service::txe.
Referenced by createService(), and LRX_createService().
static unsigned int createQueues | ( | ITC_Task * | itc, | |
unsigned int | want, | |||
void * | rtn, | |||
void * | prm | |||
) | [static] |
Create a set of ITC queues.
itc | ITC task handle | |
want | Mask of queues to create | |
rtn | Raw routine to attach | |
prm | Raw routine parameter to attach |
have | Mask of queues created (may not be all of them) |
Referenced by createService().
unsigned int createService | ( | ITC_TaskID | tid, | |
unsigned int | nim, | |||
unsigned int | qim, | |||
unsigned int | pgs, | |||
unsigned int | mto, | |||
ITC_cb_Memory * | rtn, | |||
void * | prm | |||
) | [static] |
Initialize an LTX service control block.
tid | (in) ITC task ID (from service set of tasks) | |
nim | (in) Mask of ITC nodes served by this service | |
qim | (in) Mask of ITC queues served by this service | |
pgs | (in) Number of 512 byte pages per packet (maximum 7) | |
mto | (in) Message exchange timeout period (microseconds) | |
rtn | (in) Command confirmation memory allocator | |
prm | (in) Command confirmation memory allocator parameter |
LCS_ALOCFAIL | Memory allocation failure | |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_TXCBEXST | Task control block already exists | |
LCS_TXNGNINI | Cannot create transmit engines | |
LCS_TXQUEINI | Cannot create queues | |
LCS_TXSVCID | Task id is invalid for an LTX service task | |
LCS_TXSVCPGS | Packet page count out of range |
References _LTX_Service::chk, _LCS_Control::cnt, createEngines(), createQueues(), deleteEngines(), _LTX_Service::iqm, _LTX_Service::itc, LCS_CTL_INITIALIZED, LCS_ctl_states, LCS_lcb, LCS_SVC_INITIALIZED, _LCS_Control::ltx, LTX_K_PAGE, LTX_L_PAGES, LTX_service(), _LTX_Service::max, _LTX_Service::mto, _LCS_Control::mtx, _LTX_Service::nim, _LTX_Service::state, _LCS_Control::state, _LTX_Service::tid, and _LTX_Service::txe.
Referenced by LTX_createService(), LTX_createServiceCPU(), and LTX_createServiceSDI().
static unsigned int deleteEngines | ( | LTX_Service * | ltx, | |
unsigned int | want | |||
) | [static] |
Delete a set of queues.
ltx | Service handle | |
want | Mask of engines to delete |
have | Mask of engines deleted (may not be all of them) |
References _LTX_Engine::cl, _LTX_Engine::rl, _LTX_Engine::snc, _LTX_Sync::tmr, and _LTX_Service::txe.
Referenced by createService(), LRX_createService(), LRX_deleteService(), and LTX_deleteService().
static unsigned int deleteQueues | ( | ITC_Task * | itc, | |
unsigned int | want | |||
) | [static] |
Delete a set of queues.
itc | ITC task handle | |
want | Mask of queues to delete |
have | Mask of queues deleted (may not be all of them) |
Referenced by LTX_deleteService().
unsigned int LTX_createService | ( | ITC_TaskID | tid, | |
unsigned int | nim, | |||
unsigned int | pgs, | |||
unsigned int | mto, | |||
ITC_cb_Memory * | rtn, | |||
void * | prm | |||
) |
Create an LTX service task for CPU/CPU communications.
tid | (in) ITC task ID (from service set of tasks) | |
nim | (in) Mask of ITC nodes served by this service | |
pgs | (in) Number of 512 byte pages per packet (maximum 7) | |
mto | (in) Message exchange timeout period (nsecs) | |
rtn | (in) Command confirmation memory allocator | |
prm | (in) Command confirmation memory allocator parameter |
LCS_ALOCFAIL | Memory allocation failure | |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_TXCBEXST | Task control block already exists | |
LCS_TXNGNINI | Cannot create transmit engines | |
LCS_TXQUEINI | Cannot create queues | |
LCS_TXSVCID | Task id is invalid for an LTX service task | |
LCS_TXSVCPGS | Packet page count out of range |
References createService().
Referenced by LCS_configure().
unsigned int LTX_createServiceCPU | ( | ITC_TaskID | tid, | |
unsigned int | nim, | |||
unsigned int | pgs, | |||
unsigned int | mto, | |||
ITC_cb_Memory * | rtn, | |||
void * | prm | |||
) |
Create an LTX service task for CPU/CPU communications.
tid | (in) ITC task ID (from service set of tasks) | |
nim | (in) Mask of ITC nodes served by this service | |
pgs | (in) Number of 512 byte pages per packet (maximum 7) | |
mto | (in) Message exchange timeout period (nsecs) | |
rtn | (in) Command confirmation memory allocator | |
prm | (in) Command confirmation memory allocator parameter |
LCS_ALOCFAIL | Memory allocation failure | |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_TXCBEXST | Task control block already exists | |
LCS_TXNGNINI | Cannot create transmit engines | |
LCS_TXQUEINI | Cannot create queues | |
LCS_TXSVCID | Task id is invalid for an LTX service task | |
LCS_TXSVCPGS | Packet page count out of range |
References createService().
unsigned int LTX_createServiceSDI | ( | unsigned int | pgs | ) |
Create an LTX service task for CPU/SDI communications.
pgs | (in) Number of 512 byte pages per packet (maximum 7) |
LCS_ALOCFAIL | Memory allocation failure | |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_TXCBEXST | Task control block already exists | |
LCS_TXNGNINI | Cannot create transmit engines | |
LCS_TXQUEINI | Cannot create queues | |
LCS_TXSVCID | Task id is invalid for an LTX service task | |
LCS_TXSVCPGS | Packet page count out of range |
References createService().
unsigned int LTX_deleteService | ( | ITC_TaskID | tid | ) |
Delete the LTX service task and associated resources.
tid | (in) ITC task ID (from service set of tasks) |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_SVCHNDL | LTX service control block does not exist | |
LCS_SVCSTAT | LTX service control block not in requested state | |
LCS_TXSVCID | Task id is invalid for an LTX service task |
References checkState(), _LCS_Control::cnt, deleteEngines(), deleteQueues(), _LTX_Service::iqm, _LTX_Service::itc, LCS_CTL_INITIALIZED, LCS_lcb, LCS_SVC_INITIALIZED, _LCS_Control::ltx, _LCS_Control::mtx, and _LTX_Service::nim.
Referenced by LCS_rundown().
unsigned int LTX_startService | ( | ITC_TaskID | tid, | |
TASK_attr * | attr | |||
) |
Start an LTX communications service task.
tid | (in) ITC task ID (from service set of tasks) | |
attr | (in) Task attributes |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_SVCHNDL | LTX service control block does not exist | |
LCS_SVCSTAT | LTX service control block not in requested state | |
LCS_TXSVCID | Task id is invalid for an LTX service task |
References checkState(), _LTX_Service::itc, LCS_CTL_INITIALIZED, LCS_lcb, LCS_SVC_INITIALIZED, LCS_SVC_STARTED, _LCS_Control::ltx, _LCS_Control::mtx, and _LTX_Service::state.
Referenced by LCS_configure().
unsigned int LTX_stopService | ( | ITC_TaskID | tid | ) |
Stop the task implementing the LCS service layer.
tid | (in) ITC task ID (from service set of tasks) |
LCS_CTLSTAT | LCS master control block not in requested state | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_SUCCESS | Success | |
LCS_SVCHNDL | LTX service control block does not exist | |
LCS_SVCSTAT | LTX service control block not in requested state | |
LCS_TXSVCID | Task id is invalid for an LTX service task |
References checkState(), _LTX_Service::itc, LCS_CTL_INITIALIZED, LCS_lcb, LCS_SVC_INITIALIZED, LCS_SVC_STARTED, _LCS_Control::ltx, _LCS_Control::mtx, and _LTX_Service::state.
Referenced by LCS_rundown().
static void startMeta | ( | void * | prm | ) | [static] |
LCB based service task one time initialization (in context of task).
prm | (in) User context parameter |
References _LTX_Service::fqi, and _LTX_Service::tid.
static void stopMeta | ( | void * | prm | ) | [static] |
LCB based service task one time shutdown (in context of task).
prm | (in) User context parameter |
References _LTX_Service::fqi.
const LTX_Adapter LTX_adapter[LTX_L_ADAPTERS] |
Initial value:
{ { sizeof( LCS_ProtocolCPU ), LTX_startCPU2, LTX_protocolCPU }, { sizeof( LCS_ProtocolCPU ), LTX_startCPU3, LTX_protocolCPU }, { sizeof( LCS_ProtocolSDI ), LTX_startSDI2, LTX_protocolSDI } }
Referenced by LTX_service().