GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCS / dev > lcs / rhel5-32
#include <string.h>
#include <PBS/FFS.ih>
#include <PBS/MBA.h>
#include <PBS/FPA.h>
#include <MSG/MSG_pubdefs.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCBD/LCBD_drv.h>
#include <LCBD/LCBD_evt.h>
#include <LCBD/LCBD_nut.h>
#include <LCS/LCS_pubdefs.h>
#include <LCS/LCS_msgs.h>
#include <LCS_prvdefs.h>
Functions | |
static unsigned int | checkState (LCS_ControlState creq, LCS_ServiceState sreq, const char *func) |
Check the state of master and service control blocks. | |
static unsigned int | createEngines (LRX_Service *lrx, ITC_NodeID nid, unsigned int want) |
Create a set of receive engines for one node. | |
static unsigned int | createTasks (LRX_Service *lrx, ITC_TaskID rst, ITC_TaskID evt, ITC_TaskID nut) |
Create the LCB driver tasks. | |
static unsigned int | deleteEngines (LRX_Service *lrx, ITC_NodeID nid, unsigned int want) |
Delete a set of queues. | |
static void | deleteTasks (LRX_Service *lrx) |
Delete the LCB driver tasks. | |
static unsigned int | startTasks (LRX_Service *lrx, TASK_attr *rst, TASK_attr *evt, TASK_attr *nut) |
Start the LCB driver tasks. | |
static void | stopTasks (LRX_Service *lrx) |
Stop the LCB driver tasks. | |
unsigned int | LRX_createService (ITC_TaskID rst, ITC_TaskID evt, ITC_TaskID nut) |
Create and initialize LRX services. | |
unsigned int | LRX_deleteService () |
Delete the LTX service task and associated resources. | |
unsigned int | LRX_setAlloc (LRX_cb_Alloc *rtn) |
Set the allocation plug-in. | |
unsigned int | LRX_startService (TASK_attr *rst, TASK_attr *evt, TASK_attr *nut) |
Start the LCB service tasks and configure LCB to use them. | |
unsigned int | LRX_stopService (LRX_cb_Stop *rtn, void *prm) |
Stop the LRX service. |
CVS $Id: LRX_control.c,v 1.9 2011/03/28 22:49:56 apw Exp $
static unsigned int checkState | ( | LCS_ControlState | creq, | |
LCS_ServiceState | sreq, | |||
const char * | func | |||
) | [inline, static] |
Check the state of master and service control blocks.
creq | (in) Required state of LCS master control block | |
sreq | (in) Required state of LRX 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 | LRX service control block does not exist | |
LCS_SVCSTAT | LRX service control block not in requested state |
References _LRX_Service::chk, LCS_ctl_states, LCS_lcb, LCS_svc_states, _LCS_Control::lrx, _LCS_Control::mtx, _LRX_Service::state, and _LCS_Control::state.
static unsigned int createEngines | ( | LRX_Service * | lrx, | |
ITC_NodeID | nid, | |||
unsigned int | want | |||
) | [static] |
Create a set of receive engines for one node.
lrx | LRX service handle | |
nid | ITC node which this block of engines serves | |
want | Mask of engines to create |
have | Mask of engines created (may not be all of them) |
References _LRX_Engine::eid, _LRX_Engine::fcb, _LRX_Engine::frg, _LRX_Engine::key, LCS_roundTo(), _LRX_Engine::lrx, LRX_M_OR_READY, _LRX_Engine::mem, _LRX_Engine::nxt, _LRX_Engine::rof, _LRX_Service::rxe, _LRX_Service::sav, and _LRX_Engine::seq.
static unsigned int createTasks | ( | LRX_Service * | lrx, | |
ITC_TaskID | rst, | |||
ITC_TaskID | evt, | |||
ITC_TaskID | nut | |||
) | [inline, static] |
Create the LCB driver tasks.
lrx | (in) The LRX control block | |
rst | (in) Task ID for "result" task (command/response fabric) | |
evt | (in) Task ID for "event: task (event fabric) | |
nut | (in) Task ID for "nut" task (change of LCB state) |
LCS_SUCCESS | Success |
References _LRX_Driver::itc, LRX_L_DRIVERS, _LRX_Driver::tid, and _LRX_Service::tsk.
Referenced by LRX_createService().
static unsigned int deleteEngines | ( | LRX_Service * | lrx, | |
ITC_NodeID | nid, | |||
unsigned int | want | |||
) | [static] |
Delete a set of queues.
lrx | LRX service handle | |
nid | ITC node which this block of engines serves | |
want | Mask of engines to delete |
have | Mask of queues deleted (may not be all of them) |
References _LRX_Engine::fcb, _LRX_Engine::mem, and _LRX_Service::rxe.
static void deleteTasks | ( | LRX_Service * | lrx | ) | [static] |
Delete the LCB driver tasks.
lrx | (in) The LRX control block |
References _LRX_Driver::itc, LRX_L_DRIVERS, and _LRX_Service::tsk.
Referenced by LRX_deleteService().
unsigned int LRX_createService | ( | ITC_TaskID | rst, | |
ITC_TaskID | evt, | |||
ITC_TaskID | nut | |||
) |
Create and initialize LRX services.
rst | (in) Task ID for "result" task (command/response fabric) | |
evt | (in) Task ID for "event: task (event fabric) | |
nut | (in) Task ID for "nut" task (change of LCB state) |
LCS_ALOCFAIL | Memory allocation failure | |
LCS_CTLSTAT | Invalid control state for this operation | |
LCS_NOTINIT | LCS master control block does not exist | |
LCS_RXCBEXST | LRX control block already exists | |
LCS_RXNGNINI | Cannot create LRX receive engines | |
LCS_SUCCESS | Success |
References _LRX_Service::allocRtn, _LRX_Service::chk, _LCS_Control::cnt, createEngines(), createTasks(), deleteEngines(), LCS_CTL_INITIALIZED, LCS_ctl_states, LCS_lcb, LCS_SVC_INITIALIZED, _LCS_Control::lrx, LRX_allocNormal(), _LCS_Control::mtx, _LRX_Service::sav, _LRX_Service::state, _LCS_Control::state, _LRX_Service::stopPrm, and _LRX_Service::stopRtn.
Referenced by LCS_configure().
unsigned int LRX_deleteService | ( | void | ) |
Delete the LTX service task and associated resources.
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 |
References checkState(), _LCS_Control::cnt, deleteEngines(), deleteTasks(), LCS_CTL_INITIALIZED, LCS_lcb, LCS_SVC_INITIALIZED, _LCS_Control::lrx, and _LCS_Control::mtx.
Referenced by LCS_rundown().
unsigned int LRX_setAlloc | ( | LRX_cb_Alloc * | rtn | ) |
Set the allocation plug-in.
rtn | (in) LRX allocation plug-in |
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 |
References _LRX_Service::allocRtn, LCS_lcb, and _LCS_Control::lrx.
unsigned int LRX_startService | ( | TASK_attr * | rst, | |
TASK_attr * | evt, | |||
TASK_attr * | nut | |||
) |
Start the LCB service tasks and configure LCB to use them.
rst | (in) Task attributes for "result" task (command/response fabric) | |
evt | (in) Task attributes for "event: task (event fabric) | |
nut | (in) Task attributes for "nut" task (change of LCB state) |
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 |
References _LRX_Service::cb2, _LRX_Service::cb3, checkState(), LCS_CTL_INITIALIZED, LCS_lcb, LCS_SVC_INITIALIZED, LCS_SVC_STARTED, _LCS_Control::lrx, LRX_DRV_EVENT, LRX_DRV_NUT, LRX_DRV_RESULT, LRX_L_DRIVERS, LRX_service2(), LRX_service3(), _LCS_Control::mtx, startTasks(), _LRX_Service::state, _LRX_Driver::tid, and _LRX_Service::tsk.
Referenced by LCS_configure().
unsigned int LRX_stopService | ( | LRX_cb_Stop * | rtn, | |
void * | prm | |||
) |
Stop the LRX service.
rtn | (in) LRX service stop callback routine | |
prm | (in) LRX service stop callback routine parameter |
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 |
References _LRX_Service::cb2, _LRX_Service::cb3, checkState(), _LRX_Driver::itc, LCS_CTL_INITIALIZED, LCS_lcb, LCS_SVC_STARTED, LCS_SVC_STOPPING, _LCS_Control::lrx, LRX_DRV_EVENT, _LCS_Control::mtx, _LRX_Service::state, _LRX_Service::stopPrm, _LRX_Service::stopRtn, stopTasks(), and _LRX_Service::tsk.
Referenced by LCS_rundown().
static unsigned int startTasks | ( | LRX_Service * | lrx, | |
TASK_attr * | rst, | |||
TASK_attr * | evt, | |||
TASK_attr * | nut | |||
) | [static] |
Start the LCB driver tasks.
lrx | (in) The LRX control block | |
rst | (in) Task ID for "result" task (command/response fabric) | |
evt | (in) Task ID for "event: task (event fabric) | |
nut | (in) Task ID for "nut" task (change of LCB state) |
LCS_SUCCESS | Success |
References _LRX_Driver::itc, LRX_L_DRIVERS, and _LRX_Service::tsk.
Referenced by LRX_startService().
static void stopTasks | ( | LRX_Service * | lrx | ) | [static] |
Stop the LCB driver tasks.
lrx | (in) The LRX control block |
LCS_SUCCESS | Success |
References _LRX_Driver::itc, LRX_L_DRIVERS, and _LRX_Service::tsk.
Referenced by LRX_stopService().