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


Interface   Data Structures   File List   Data Fields   Globals  

LCS_control.c File Reference

Management of the LCS master control block. More...

#include <string.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
#include <LCBD/LCBC.h>
#include <LCBD/LCBD_drv.h>
#include <LCBD/LCBD_msgs.h>
#include <ITC/ITC_pubdefs.h>
#include <ITC/ITC_msgs.h>
#include <LCS/LCS_pubdefs.h>
#include <LCS/LCS_msgs.h>
#include <LCS_prvdefs.h>

Defines

#define LCB_CSR_S_SIU   ( 3 )
 SIU's CPU ID field in LCBD's CSR user field: width (bits).
#define LCB_CSR_V_SIU   ( 17 )
 SIU's CPU ID field in LCBD's CSR user field: offset.
#define LCB_CSR_M_SIU   ((( 1 << LCB_CSR_S_SIU ) - 1) << LCB_CSR_V_SIU)
 SIU's CPU ID field in LCBD's CSR user field: in-place mask.
#define LCB_CSR_K_SIU   ( 0x20 )
 SIU's CPU ID field in LCBD's CSR user field: implied upper bits.
#define LCB_CSR_T_SIU   ( 500 )
 Timeout for accessing the LCBD's CSR register.

Functions

unsigned int completeLCB (LCBD lcbd)
 Complete the initialization of the LCB (SIU/EPU common).
unsigned int enableEvent (LCBD lcbd)
 Enable the event fabric.
unsigned int LCS_initialize (LCS_NodeAddress deprecated)
 Initialize the LCS master control block.
unsigned int LCS_completeEPU ()
 Complete the initialization of the LCB (EPU specific).
unsigned int LCS_completeSIU (unsigned int latpAddr)
 Complete the initialization of the LCB (SIU specific).
unsigned int LCS_enableEvent ()
 Enable the event fabric.
unsigned int LCS_shutdown ()
 Shut down the LCS master control block and release resources.

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.


Detailed Description

Management of the LCS master control block.

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

Function Documentation

unsigned int completeLCB ( LCBD  lcbd  ) 

Complete the initialization of the LCB (SIU/EPU common).

Parameters:
lcbd (in) LCB driver handle
Return values:
LCS_LCBFAIL LCB initialization failed
LCS_SUCCESS Success
Warning:
This routine can block, waiting for the GASU 20 MHz clock

This routine does not bring the event fabric online

completeLCB() completes the part of the LCB initialization that requires the GASU 20 MHz clock. This routine will enable clock-on, clock-off interrupts, then wait for the appearance of the GASU clock. It should only be called if there's a reasonable expectation that the GASU clock is already available. This is not so hard to achieve because the SIU is in control of GASU power and thus knows when the clock turns on, and EPUs are always in the position that without the GASU clock, they couldn't have been booted.

Referenced by LCS_completeEPU(), and LCS_completeSIU().

unsigned int enableEvent ( LCBD  lcbd  ) 

Enable the event fabric.

Parameters:
lcbd (in) LCB driver handle
Return values:
LCS_SUCCESS Success
enableEvent() brings the event fabric online.

Referenced by LCS_completeEPU(), and LCS_enableEvent().

unsigned int LCS_completeEPU ( void   ) 

Complete the initialization of the LCB (EPU specific).

Return values:
LCS_LCBFAIL LCB initialization failed
LCS_SUCCESS Success
LRX_completeEPU() completes LCB initialization of an EPU LCB. This includes bringing the event fabric online.

References completeLCB(), enableEvent(), LCB_CSR_K_SIU, LCB_CSR_M_SIU, LCB_CSR_T_SIU, LCB_CSR_V_SIU, LCS_getNodeID(), and LCS_setNodeAddressSIU().

unsigned int LCS_completeSIU ( unsigned int  latpAddr  ) 

Complete the initialization of the LCB (SIU specific).

Parameters:
latpAddr (in) SIU's EBM hardware address
Return values:
LCS_NOTSIUND Illegal SIU hardware address
LCS_SUCCESS Success
LCS_completeSIU() completes LCB initialization of an SIU LCB, with the exception that the event fabric is not brought online.

References completeLCB(), LCB_CSR_T_SIU, LCS_NIH_SIU0, LCS_NIH_SIU1, LCS_NIH_SIUE, and LCS_setNodeAddressSIU().

unsigned int LCS_enableEvent ( void   ) 

Enable the event fabric.

Return values:
LCS_SUCCESS Success
LCS_enableEvent() brings the event fabric online.

References enableEvent().

unsigned int LCS_initialize ( LCS_NodeAddress  deprecated  ) 

Initialize the LCS master control block.

Parameters:
deprecated (in) This parameter is no longer used (ignored)
Return values:
LCS_ALOCFAIL Memory allocation failure
LCS_CTLSTAT Invalid control state for this operation
LCS_MUALOCFL Mutex allocation failure
LCS_SUCCESS Success
LCS_initialize() initializes the LCS master control block.

References LCS_CTL_INITIALIZED, LCS_CTL_UNINITIALIZED, LCS_K_HARDBASE, LCS_NIH_BCST, LCS_NIH_EPU0, LCS_NIH_EPU1, LCS_NIH_EPU2, LCS_NIH_EPU3, LCS_NIH_NONE, LCS_NIH_SDI, LCS_NIH_SIU0, LCS_NIH_SIU1, _LCS_Control::map, _LCS_Control::mtx, _LCS_Control::nto, _LCS_Control::rev, _LCS_Control::rwi, and _LCS_Control::state.

unsigned int LCS_shutdown ( void   ) 

Shut down the LCS master control block and release resources.

Return values:
LCS_CTLSTAT Invalid control state for this operation
LCS_NOTINT Control block not initialized
LCS_SUCCESS Success
LCS_shutdown() shuts down the LCS master control block and releases assocoated resources

References LCS_CTL_INITIALIZED, LCS_CTL_UNINITIALIZED, _LCS_Control::mtx, and _LCS_Control::state.


Variable Documentation

const char* LCS_ctl_states[LCS_L_CTL_STATES]

Initial value:

{
    "uninitialized",
    "initialized"
}
String constants for LCS control block states.

Referenced by checkState(), createService(), and LRX_createService().

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().

const char* LCS_svc_states[LCS_L_SVC_STATES]

Initial value:

{
    "uninitialized",
    "initialized",
    "started",
    "stopping"
}
String constants for LCS service block states.

Referenced by checkState().


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