GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCS / dev > lcs / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

LRX_control.c File Reference

Basic control of CPU to CPU communications receivers. More...

#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.


Detailed Description

Basic control of CPU to CPU communications receivers.

CVS $Id: LRX_control.c,v 1.9 2011/03/28 22:49:56 apw Exp $
Author:
A.P.Waite

Function Documentation

static unsigned int checkState ( LCS_ControlState  creq,
LCS_ServiceState  sreq,
const char *  func 
) [inline, static]

Check the state of master and service control blocks.

Parameters:
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
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
checkState() is a state integrity checker. It demands that the master control exists and be in state creq, it also demands that the service control block exists and be in state sreq. If these conditions are met, the routine returns LCS_SUCCESS, otherwise it generates a message and returns with a non-LCS_SUCCESS message.

Warning:
If successful, the master control block will be returned with the mutex locked. Any failure and the mutex is returned unlocked.

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.

Parameters:
lrx LRX service handle
nid ITC node which this block of engines serves
want Mask of engines to create
Return values:
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.

Parameters:
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)
Return values:
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.

Parameters:
lrx LRX service handle
nid ITC node which this block of engines serves
want Mask of engines to delete
Return values:
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.

Parameters:
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.

Parameters:
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)
Return values:
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
LRX_createService() creates and intializes LRX services

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.

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_deleteService() deletes the LRX service task and associated resources.

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.

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.

unsigned int LRX_startService ( TASK_attr *  rst,
TASK_attr *  evt,
TASK_attr *  nut 
)

Start the LCB service tasks and configure LCB to use them.

Parameters:
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)
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_startService() starts the LCB service tasks, and configures the protocol 2 and 3 handlers for the "event" task.

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.

Parameters:
rtn (in) LRX service stop callback routine
prm (in) LRX service stop callback routine parameter
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_stopService() starts the process of draining the LRX service.

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.

Parameters:
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)
Return values:
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.

Parameters:
lrx (in) The LRX control block
Return values:
LCS_SUCCESS Success

References _LRX_Driver::itc, LRX_L_DRIVERS, and _LRX_Service::tsk.

Referenced by LRX_stopService().


Generated on Mon Mar 28 15:54:26 2011 by  doxygen 1.5.8