GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-5 > ebfio / rad750
#include <EDS/LCBV.h>
#include <EDS/io/LCBP.h>
#include <EDS/io/EBF_pkts.h>
#include <EDS/EBF_pkt.h>
#include <EDS/EBF_evt.h>
#include <EDS/EBF_edw.h>
#include <EDS/EBF_gem.h>
#include <EDS/EBF_gemLocate.h>
#include <PBS/FORK.h>
#include <PBS/TASK.h>
#include <PBS/MBA.h>
#include <PBI/Alias.h>
Classes | |
struct | _EDM |
EDM control/context handle for the Event Delivery Model. More... | |
struct | _LCBP_fork |
Event fork task. More... | |
struct | _LCBP_pktCbp |
Binds an event call back routine with its parameter. More... | |
struct | _LCBP |
Layout of the control block for the virtual LCB. More... | |
Typedefs | |
typedef struct _EDM | EDM |
Typedef for struct _EDM. | |
typedef struct _LCBP_fork | LCBP_fork |
Typedef for struct _LCBP_fork. | |
typedef struct _LCBP_pktCbp | LCBP_pktCbp |
Typedef for struct _LCBP_pktCbp. | |
typedef struct _LCBP * | LCBP |
Typedef for a pointer to the struct _LCBP. | |
Functions | |
ALIAS_FNC (unsigned int, LCBP_evt_cb_set, LCBP_pktCbSet) | |
ALIAS_END (LCBP) | |
int | EDM_construct (EDM *edm) |
Constructor for an EDM handle. | |
int | EDM_wait (EDM *edm, unsigned int edw, EBF_pkt *pkt) |
Standard event handler for EDM. | |
static unsigned int | defaultCb (void *prm, unsigned int edw, EBF_pkt *pkt) |
Default callback routine. | |
static int | evtHandler (LCBP lcb, EBF_pkt *pkt) |
FORK callback dispatch routine. | |
static unsigned int | normal_delivery (LCBP lcb) |
Normal packet delivery. | |
static unsigned int | timed_delivery (LCBP lcb) |
Normal packet delivery. | |
LCBP | LCBP_get () |
Returns a pointer to the virtual LCB control block. | |
unsigned int | LCBP_create (LCBP lcb) |
Initializes the LCB virtual device control block. | |
int | LCBP_sizeof () |
Returns the size, in bytes, of a virtual LCB control block. | |
void | LCBP_construct (LCBP lcb) |
Constructs (initializes) the specified virtual LCB control block. | |
unsigned int | LCBP_edm_configure (LCBP lcb, unsigned int style, void *prm) |
Sets the event deliver style. | |
unsigned int | LCBP_edm_reset (LCBP lcb) |
Resets the LCB handle, preparing it for a new set of data. This is generally called when switching to a new event stream. | |
unsigned int | LCBP_pktsDeliver (LCBP lcb) |
Feeds one packet at a time to the user provided callback routine. | |
unsigned int | LCBP_pktsConnect (LCBP lcb, EBF_pkts pkts) |
Connect a stream of packets to the virtual LCB. | |
EBF_pkts | LCBP_pktsQuery (LCBP lcb) |
Returns the current EBF_pkts. | |
unsigned int | LCBP_evt_cb_set (LCBP lcb, unsigned int proto, LCBV_pktCb rtn, void *prm) |
Establishes a callback handler for the specified protocal. | |
unsigned int | LCBP_evt_enable (LCBP lcb, int enable) |
Enables/Disables the flow of events. | |
unsigned int | LCBP_evt_handler_create (LCBP lcb, int priority) |
Creates the event que handler service task. | |
unsigned int | LCBP_evt_que_install (LCBP lcb, FORK_que *que) |
Installs queue from fcb as the task message queue for event traffic. | |
FORK_que * | LCBP_evt_que_get (LCBP lcb, int que_id) |
Installs queue from fcb as the task message queue for event traffic. | |
unsigned int | LCBP_pktsRngFree (LCBP lcb, EBF_pkt *from, EBF_pkt *to) |
Dummy implementation of the corresponds LCBD routine. | |
Variables | |
static struct _LCBP | Lcbp = { 0 } |
Static instance of the packet LCB control block. |
CVS $Id: LCBP.c,v 1.7 2011/03/25 22:16:57 russell Exp $
static int defaultCb | ( | void * | prm, | |
unsigned int | edw, | |||
EBF_pkt * | pkt | |||
) | [static] |
Default callback routine.
prm | The user parameter (ignored) | |
edw | The event descriptor word (ignored) | |
pkt | The data packet |
Referenced by LCBP_construct().
int EDM_construct | ( | EDM * | edm | ) |
Constructor for an EDM handle.
edm | The target EDM handle |
References _EDM::first, _EDM::nsecx, _EDM::offset, _EDM::ppstime, and _EDM::prv_truncated.
Referenced by LCBP_edm_configure().
Standard event handler for EDM.
edm | The EDM control/context handle | |
edw | The LCB's event descriptor word | |
pkt | The data packet |
References _EDM::base_tov, _EBF_edw::bf, EBF__gemLocate(), EBF_EDW_RSTATUS_K_PACKET_TRUNCATED, _EDM::first, _EDM::nsecx, _EDM::offset, _EDM::pps_idx, _EDM::ppstime, _EBF_gem::ppstime, _EDM::prv_truncated, _EBF_edw_bf::rstatus, _EDM::secs, _EBF_gem::trgtime, and _EBF_edw::ui.
Referenced by timed_delivery().
FORK callback dispatch routine.
lcb | The virtual LCB device handle | |
pkt | The data packet |
References _EBF_ebw::bf, _LCBP::cbps, _EBF_pkt::ebw, _LCBP::enabled, _EBF_pkt::hdr, LCBV_PKT_FATE_M_ABORT, LCBV_PKT_FATE_M_NO_MORE, _LCBP_pktCbp::prm, _LCBP_pktCbp::rtn, _EBF_ebw::ui, _EBF_edw::ui, and _EBF_pktHdr::undef.
Referenced by timed_delivery().
void LCBP_construct | ( | LCBP | lcb | ) |
Constructs (initializes) the specified virtual LCB control block.
lcb | The virtual LCB control block to construct |
References _LCBP::cbps, defaultCb(), _LCBP::enabled, _LCBP::init, _LCBP_pktCbp::prm, and _LCBP_pktCbp::rtn.
Referenced by fileOpen(), and LCBP_create().
unsigned int LCBP_create | ( | LCBP | lcb | ) |
Initializes the LCB virtual device control block.
lcb | The virtual LCB device handle |
References _LCBP::init, and LCBP_construct().
Referenced by EBF_streamProcess().
unsigned int LCBP_edm_configure | ( | LCBP | lcb, | |
unsigned int | style, | |||
void * | prm | |||
) |
Sets the event deliver style.
lcb | The virtual LCB device handle | |
style | The deliver style | |
prm | Parameter specific to the delivery style |
References _LCBP::edm, EDM_construct(), LCBP_EDS_K_NORMAL, LCBP_EDS_K_TIMED, and _LCBP::style.
unsigned int LCBP_edm_reset | ( | LCBP | lcb | ) |
Resets the LCB handle, preparing it for a new set of data. This is generally called when switching to a new event stream.
lcb | The LCB control/context handle |
References _LCBP::edm, _EDM::first, _EDM::nsecx, _EDM::offset, and _EDM::prv_truncated.
Referenced by EBF_streamProcess().
unsigned int LCBP_evt_cb_set | ( | LCBP | lcb, | |
unsigned int | proto, | |||
LCBV_pktCb | rtn, | |||
void * | prm | |||
) |
Establishes a callback handler for the specified protocal.
0,Success | ||
-1,Protocal | out-of-range |
lcb | The virtual LCB device handle | |
proto | The protocol number | |
rtn | The callback routine | |
prm | Parameter to the callback routine |
References _LCBP::cbps, _LCBP_pktCbp::prm, and _LCBP_pktCbp::rtn.
Referenced by EBF_streamProcess().
unsigned int LCBP_evt_enable | ( | LCBP | lcb, | |
int | enable | |||
) |
Enables/Disables the flow of events.
0,Event | enable was not set before this call | |
1,Event | enable was set before this call | |
Anything | else, an LCBP error |
lcb | The virtual LCB device handle | |
enable | Enable (1) / Disable (0) flag |
References _LCBP::enabled.
Referenced by EBF_streamProcess().
unsigned int LCBP_evt_handler_create | ( | LCBP | lcb, | |
int | priority | |||
) |
Creates the event que handler service task.
lcb | The LCBP driver handle | |
priority | The priority of the task. If specified as -1, then a default value is assigned. |
References _LCBP_fork::fcb, _LCBP::fork, and _LCBP_fork::que.
FORK_que* LCBP_evt_que_get | ( | LCBP | lcb, | |
int | que_id | |||
) |
Installs queue from fcb as the task message queue for event traffic.
Pointer | to the fork que or NULL if non-existent |
lcb | Pointer to private LCBP structure | |
que_id | The FORK que id |
References _LCBP::fork, and _LCBP_fork::que.
unsigned int LCBP_evt_que_install | ( | LCBP | lcb, | |
FORK_que * | que | |||
) |
Installs queue from fcb as the task message queue for event traffic.
0,currently | there is no failure mode |
lcb | Pointer to private LCBP structure | |
que | The FORK que to use |
References _LCBP_fork::fcb, _LCBP::fork, and _LCBP_fork::que.
LCBP LCBP_get | ( | void | ) |
Returns a pointer to the virtual LCB control block.
Connect a stream of packets to the virtual LCB.
lcb | The virtual LCB device handle | |
pkts | The vector of packets |
References _LCBP::pkts.
Referenced by EBF_streamProcess().
unsigned int LCBP_pktsDeliver | ( | LCBP | lcb | ) |
Feeds one packet at a time to the user provided callback routine.
lcb | The virtual LCB device handle |
References LCBP_EDS_K_NORMAL, LCBP_EDS_K_TIMED, normal_delivery(), _LCBP::style, and timed_delivery().
Referenced by EBF_streamProcess().
Returns the current EBF_pkts.
lcb | The virtual LCB device handle |
References _LCBP::pkts.
Dummy implementation of the corresponds LCBD routine.
lcb | The virtual LCB device handle | |
from | The address to start the free at. | |
to | The address of the last packet to free. |
int LCBP_sizeof | ( | void | ) |
Returns the size, in bytes, of a virtual LCB control block.
Referenced by fileOpen().
static unsigned int normal_delivery | ( | LCBP | lcb | ) | [static] |
Normal packet delivery.
lcb | The virtual LCB device handle |
References _EBF_ebw::bf, _LCBP::cbps, EBF__pktsAdvance(), EBF__pktSize(), EBF__pktsPkt(), EBF__pktsSize(), _EBF_pkt::ebw, _LCBP::enabled, _EBF_pkt::hdr, LCBV_PKT_FATE_M_ABORT, LCBV_PKT_FATE_M_EOF, LCBV_PKT_FATE_M_NO_MORE, LCBV_PKT_FATE_M_PAUSE, _LCBP::pkts, _LCBP_pktCbp::prm, _LCBP_pktCbp::rtn, _EBF_ebw::ui, _EBF_edw::ui, and _EBF_pktHdr::undef.
Referenced by LCBP_pktsDeliver().
static unsigned int timed_delivery | ( | LCBP | lcb | ) | [static] |
Normal packet delivery.
lcb | The virtual LCB device handle |
References _EBF_ebw::bf, _LCBP::cbps, EBF__pktsAdvance(), EBF__pktSize(), EBF__pktsPkt(), EBF__pktsSize(), _EBF_pkt::ebw, _LCBP::edm, EDM_wait(), _LCBP::enabled, evtHandler(), _LCBP::fork, _EBF_pkt::hdr, LCBV_PKT_FATE_M_ABORT, LCBV_PKT_FATE_M_EOF, _LCBP::pkts, _LCBP_pktCbp::prm, _LCBP_fork::que, _LCBP_pktCbp::rtn, _EBF_ebw::ui, _EBF_edw::ui, and _EBF_pktHdr::undef.
Referenced by LCBP_pktsDeliver().