GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LPA / dev > lpa_epu / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LPA_grb_post.c File Reference

Manage post buffers for GRB event packets. More...

#include <LPA_grb_post_p.h>
#include <LPA_slvdefs.h>
#include <LPA_utils.h>
#include <LPA/LPA_msgs.h>
#include <GRBS/../src/GRBS_epu_p.h>
#include <GRB/GRB_epu.h>
#include <GRB/GRB_msgdef.h>
#include <GRB/GRB_pktdef.h>
#include <GRB_DB/GRB_DB_schema.h>
#include <LPA_DB/LPA_DB_grb_epu_schema.h>
#include <LSF/LSF_reason.h>
#include <EDS/EDS_fw.h>
#include <EDS/EDS_fwServices.h>
#include <ITC/ITC_pubdefs.h>
#include <IMM/RBM_pubdefs.h>
#include <LCBD/LCBD_drv.h>
#include <LCBD/LCBD_evt.h>
#include <CDM/CDM_pubdefs.h>
#include <CMX/CMX_lookupPub.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/WCT.h>
#include <stdio.h>
#include <string.h>

Functions

static int LPA_grbPostStart (void *prm, int reason, unsigned int run_id, unsigned int startTime, unsigned int mode, unsigned int hw_key, unsigned int cfg_key)
 The post start routine.
static void LPA_grbPostWrite (void *prm, EDS_fwIxb *ixb)
 The post write routine.
static int LPA_grbPostNotify (void *prm, unsigned int mode, unsigned int active, const unsigned char cfgs[32], void *rsdTbl)
 The post notify routine.
static int LPA_grbPostFlush (void *prm, int reason)
 The post flush routine.
static WUT_cb_status LPA_grbWutExpire (void *prm, WUT_tmr *wut)
 Fork a message to GRB slave processing to force a packet to be sent.
static FORK_cb_status LPA_grbWutFork (FORK_cb_prm *prm, FORK_msg_hdr *hdr)
 Fork routine for processing "GRB packet flush on time" operations.
static unsigned int LPA_grbPostIt (LPA_GrbPostCtl *gpc, GRB_pktCloseReason closeOn, GRB_pktOpenReason openOn)
 Utility to do some management and call the actual flush routine.
const EDS_fwPostServices * LPA_constructGrbPostSvc (LPA_GrbPostCtl *gpc, EDS_fw *eds, void *postRtn, void *postPrm, unsigned int *buf, int buf_size)
 Construct the GRB output services.
unsigned int LPA_grbPostCtlSizeOf (void)
 Retrieves the GRB post services control block size.
int LPA_setGrbProcessor (void *prm, unsigned int id)
 Select the GRB processor to use.


Detailed Description

Manage post buffers for GRB event packets.

CVS $Id: LPA_grb_post.c,v 1.8 2011/03/28 22:24:21 russell Exp $
Author:
S.Maldonado

A.P.Waite


Function Documentation

const EDS_fwPostServices * LPA_constructGrbPostSvc ( LPA_GrbPostCtl gpc,
EDS_fw *  eds,
void *  postRtn,
void *  postPrm,
unsigned int *  buf,
int  buf_size 
)

Construct the GRB output services.

Parameters:
gpc (in) The GRB poster control handle
eds (in) The EDS framework handle
postRtn (in) Routine to post the formatted GRB summary
postPrm (in) Parameter passed to the post routine
buf (in) The first, preallocated buffer to fill
buf_size (in) The size, in bytes, of the ouptut buffer. Events will be packed into this buffer until full
Return values:
NULL Failure
x Success (pointer to EDS_fwPostServices)

References _LPA_GrbPostCtl::act, _LPA_GrbFlushOnTimeout::delta, _LPA_GrbPostCtl::fot, _LPA_GrbFlushOnTimeout::fqi, _LPA_GrbPostCtl::gfm, _LPA_GrbPostCtl::gpm, _LPA_GrbPostCtl::hdr, LPA_grbPostFlush(), LPA_grbPostNotify(), LPA_grbPostStart(), LPA_grbPostWrite(), _LPA_GrbPostCtl::max, _LPA_GrbPostCtl::msg, _LPA_GrbPostCtl::nid, _LPA_GrbFlushMethod::prm, _LPA_GrbProcessMethod::prm, _LPA_GrbFlushMethod::rtn, _LPA_GrbPostCtl::siz, _LPA_GrbProcessMethod::svc, and _LPA_GrbFlushOnTimeout::wut.

Referenced by LPA_configOutput().

unsigned int LPA_grbPostCtlSizeOf ( void   ) 

Retrieves the GRB post services control block size.

Returns:
Size of GRB post services control block

Referenced by LPA_configOutput().

int LPA_grbPostFlush ( void *  prm,
int  reason 
) [static]

The post flush routine.

Parameters:
prm (in) Flush parameter (the GRB posting control block)
reason (in) Flush reason
Return values:
0 Always

References _LPA_GrbPostCtl::fot, LPA_grbPostIt(), and _LPA_GrbFlushOnTimeout::wut.

Referenced by LPA_constructGrbPostSvc().

static unsigned int LPA_grbPostIt ( LPA_GrbPostCtl gpc,
GRB_pktCloseReason  closeOn,
GRB_pktOpenReason  openOn 
) [static]

Utility to do some management and call the actual flush routine.

Parameters:
gpc (in) GRB posting control
closeOn (in) Close reason
openOn (in) Open reason
Return values:
LPA_SUCCESS Always

References _LPA_GrbFlushOnTimeout::cnt, _LPA_GrbPostCtl::fot, _LPA_GrbPostCtl::gfm, _LPA_GrbPostCtl::hdr, _LPA_GrbPostCtl::lft, _LPA_GrbPostCtl::msg, _LPA_GrbPostCtl::nid, _LPA_GrbFlushMethod::prm, _LPA_GrbFlushMethod::rtn, _LPA_GrbPostCtl::seq, _LPA_GrbPostCtl::siz, and _LPA_GrbFlushOnTimeout::tim.

Referenced by LPA_grbPostFlush(), LPA_grbPostWrite(), and LPA_grbWutFork().

static int LPA_grbPostNotify ( void *  prm,
unsigned int  mode,
unsigned int  active,
const unsigned char  cfgs[32],
void *  rsdTbl 
) [static]

The post notify routine.

Parameters:
prm (in) Notify parameter (the GRB posting control block)
mode (in) Notification mode
active (in) Active
cfgs (in) Configurations
rsdTbl (in) Result descriptor table
Return values:
0 Always

Referenced by LPA_constructGrbPostSvc().

static int LPA_grbPostStart ( void *  prm,
int  reason,
unsigned int  run_id,
unsigned int  startTime,
unsigned int  mode,
unsigned int  hw_key,
unsigned int  cfg_key 
) [static]

The post start routine.

Parameters:
prm (in) Start parameter (the GRB posting control block)
reason (in) Start reason
run_id (in) Run ID
startTime (in) Run start time
mode (in) Run mode
hw_key (in) Hardware cfg file key
cfg_key (in) Software cfg file key
Return values:
0 Always

References _LPA_GrbFlushOnTimeout::cnt, _LPA_GrbFlushOnTimeout::delta, _LPA_GrbPostCtl::fot, _LPA_GrbPostCtl::hdr, _LPA_GrbPostCtl::lft, LPA_grbWutExpire(), _LPA_GrbPostCtl::msg, _LPA_GrbPostCtl::nid, _LPA_GrbPostCtl::seq, _LPA_GrbPostCtl::siz, _LPA_GrbFlushOnTimeout::tim, _LPA_GrbFlushOnTimeout::tmo, and _LPA_GrbFlushOnTimeout::wut.

Referenced by LPA_constructGrbPostSvc().

static void LPA_grbPostWrite ( void *  prm,
EDS_fwIxb *  ixb 
) [static]

The post write routine.

Parameters:
prm (in) Write parameter (the GRB posting control block)
ixb (in) Pointer to information exchange block

References _LPA_GrbPostCtl::act, _LPA_GrbPostCtl::hdr, _LPA_GrbPostCtl::lft, LPA_grbPostIt(), _LPA_GrbPostCtl::max, _LPA_GrbPostCtl::msg, _LPA_GrbProcessMethod::prm, and _LPA_GrbProcessMethod::svc.

Referenced by LPA_constructGrbPostSvc().

static WUT_cb_status LPA_grbWutExpire ( void *  prm,
WUT_tmr *  wut 
) [static]

Fork a message to GRB slave processing to force a packet to be sent.

Parameters:
prm (in) WUT callback routine user parameter
wut (in) Wake up timer
Return values:
WUT_K_STATE_CHANGE_NO Always
Force the posting of a GRB packet to the master GRB processing task at a maximum interval.

References _LPA_GrbPostCtl::fot, _LPA_GrbFlushOnTimeout::fqi, and LPA_grbWutFork().

Referenced by LPA_grbPostStart().

FORK_cb_status LPA_grbWutFork ( FORK_cb_prm *  prm,
FORK_msg_hdr *  hdr 
) [static]

Fork routine for processing "GRB packet flush on time" operations.

Parameters:
prm (in) FORK parameter (unused)
hdr (in) FORK message
Return values:
FORK_C_CONTINUE Always

References _LPA_GrbFlushOnTimeout::cnt, _LPA_GrbFlushOnTimeout::delta, _LPA_GrbPostCtl::fot, _LPA_GrbPostCtl::hdr, LPA_getRunState(), LPA_grbPostIt(), _LPA_GrbFlushOnTimeout::tim, _LPA_GrbFlushOnTimeout::tmo, and _LPA_GrbFlushOnTimeout::wut.

Referenced by LPA_grbWutExpire().

int LPA_setGrbProcessor ( void *  prm,
unsigned int  id 
)

Select the GRB processor to use.

Parameters:
prm (in) GRB post control handle
id (in) GRB processor ID
Return values:
0 Success
-1 Failure

References _LPA_GrbPostCtl::act, _LPA_GrbPostCtl::gpm, and _LPA_GrbProcessMethod::prm.

Referenced by LPA_change_grb().


Generated on Mon Mar 28 16:13:13 2011 by  doxygen 1.5.8