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


Interface   Data Structures   File List   Data Fields   Globals  

LCS_utility.c File Reference

Collection of utility routines. More...

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <PBI/TBD_id.h>
#include <PBS/TBD.ih>
#include <PBS/WCT.h>
#include <MSG/MSG_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCS/LCS_pubdefs.h>
#include <LCS/LCS_msgs.h>
#include <LCS_prvdefs.h>

Functions

LCS_ControlLCS_getControl ()
 Return the LCS control handle.
LCS_NodeAddress LCS_getNodeAddress (ITC_NodeID nid)
 Return the LCB hardware node address for a logical ITC node ID.
ITC_NodeID LCS_getNodeID (LCS_NodeAddress nih)
 Return the logical ITC node ID for an LCB hardware node address.
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_setNodeAddressSIU (LCS_NodeAddress nih)
 Set the hardware address of the SIU (on EPU only).
unsigned int LCS_sizeofRxEngine ()
 Return size of an LRX engine structure.
unsigned int LCS_sizeofTxEngine ()
 Return size of an LTX engine structure.
unsigned int LCS_wct2ascii (WCT_time tim, char *asc)
 Convert a time (absolute units) to an ASCII string.


Detailed Description

Collection of utility routines.

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

Function Documentation

LCS_Control* LCS_getControl ( void   ) 

Return the LCS control handle.

Return values:
x LCS control handle
NULL Cannot find handle

References LCS_lcb.

LCS_NodeAddress LCS_getNodeAddress ( ITC_NodeID  nid  ) 

Return the LCB hardware node address for a logical ITC node ID.

Parameters:
nid (in) ITC (logical) node ID
Return values:
LCS_NIH_NONE LCB (hardware) address not known
LCS_NIH_SIU0 LCB (hardware) address for SIU 0 (SC "redundant SIU")
LCS_NIH_SIU1 LCB (hardware) address for SIU 1 (SC "primary SIU")
LCS_NIH_EPU0 LCB (hardware) address for EPU 0
LCS_NIH_EPU1 LCB (hardware) address for EPU 1
LCS_NIH_EPU2 LCB (hardware) address for EPU 2
LCS_NIH_EPU3 LCB (hardware) address for EPU 3/external SIU
LCS_NIH_SDI LCB (hardware) address for science data interface
LCS_getNodeAddress() returns the LCB (hardware) address corresponding to an ITC (logical) node.

References LCS_CTL_UNINITIALIZED, LCS_lcb, LCS_NIH_NONE, _LCS_Control::map, and _LCS_Control::state.

Referenced by LRX_replySend(), LTX_service(), and LTX_submit().

ITC_NodeID LCS_getNodeID ( LCS_NodeAddress  nih  ) 

Return the logical ITC node ID for an LCB hardware node address.

Parameters:
nih (in) LCS (hardware) address
Return values:
ITC_NID_NONE ITC (logical) node ID not known
ITC_NID_SIU ITC (logical) node ID SIU
ITC_NID_EPU0 ITC (logical) node ID EPU 0
ITC_NID_EPU1 ITC (logical) node ID EPU 1
ITC_NID_EPU2 ITC (logical) node ID EPU 2
ITC_NID_EPU3 ITC (logical) node ID EPU 3/external SIU
ITC_NID_SSR ITC (logical) node ID SSR
LCS_getNodeID() returns the ITC (logical) node ID corresponding to an LCB (hardware) address.

References LCS_CTL_UNINITIALIZED, LCS_K_HARDBASE, LCS_lcb, _LCS_Control::rev, and _LCS_Control::state.

Referenced by LCS_completeEPU(), and LRX_process().

LRX_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_setNodeAddressSIU ( LCS_NodeAddress  nih  ) 

Set the hardware address of the SIU (on EPU only).

Parameters:
nih (in) Hardware address of the SIU
Return values:
LCS_NOTINIT LCS control block not available
LCS_NOTSIUND Node address is not valid for an SIU
LCS_SUCCESS Success
LCS_setNodeAddressSIU() sets up the SIU hardware node address in the LCS mapping tables. Written as a separate routine because the SIU's hardware address cannot be determined until the LCB is initialized. This functionality is only needed on an EPU.

References LCS_CTL_UNINITIALIZED, LCS_K_HARDBASE, LCS_lcb, LCS_NIH_SIU0, LCS_NIH_SIU1, LCS_NIH_SIUE, _LCS_Control::map, _LCS_Control::rev, and _LCS_Control::state.

Referenced by LCS_completeEPU(), and LCS_completeSIU().

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


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