GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-6 > ebfio / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

LCBP.h File Reference

LCB packet device interface. More...

#include <EDS/LCBV.h>
#include <EDS/io/EBF_pkts.h>

Typedefs

typedef enum _LCBP_EDS_K LCBP_EDS_K
 Typedef for enum _LCBP_EDS_K.

Enumerations

enum  _LCBP_EDS_K {
  LCBP_EDS_K_NORMAL = 0,
  LCBP_EDS_K_TIMED = 1
}
 Enumerates the event delivery style. More...

Functions

int LCBP_sizeof (void)
 Returns the size, in bytes, of a virtual LCB control block.
void LCBP_construct (LCBP lcb)
 Constructs (initializes) the specified virtual LCB control block.
LCBP LCBP_get (void)
 Returns a pointer to the virtual LCB control block.
unsigned int LCBP_create (LCBP lcb)
 Initializes the LCB virtual device control block.
unsigned int LCBP_pktsConnect (LCBP lcb, EBF_pkts pkts)
 Connect a stream of packets to the virtual LCB.
unsigned int LCBP_pktsDeliver (LCBP lcb)
 Feeds one packet at a time to the user provided callback routine.
EBF_pkts LCBP_pktsQuery (LCBP lcb)
 Returns the current EBF_pkts.
unsigned int LCBP_pktCbSet (LCBP lcb, unsigned int proto, LCBV_pktCb rtn, void *prm)
unsigned int LCBP_pktsRngFree (LCBP lcb, EBF_pkt *from, EBF_pkt *to)
 Dummy implementation of the corresponds LCBD routine.
unsigned int LCBP_edm_configure (LCBP lcb, LCBP_EDS_K style, void *prm)
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_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.


Detailed Description

LCB packet device interface.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: LCBP.h,v 1.7 2011/03/25 22:16:55 russell Exp $

This is a realization of an LCB like device, satisfying the abstract interface defined in LCBV.h

Enumeration Type Documentation

Enumerates the event delivery style.

Enumerator:
LCBP_EDS_K_NORMAL  Normal event delivery
LCBP_EDS_K_TIMED  Timed event delivery


Function Documentation

void LCBP_construct ( LCBP  lcb  ) 

Constructs (initializes) the specified virtual LCB control block.

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

Returns:
Status
Parameters:
lcb The virtual LCB device handle

References _LCBP::init, and LCBP_construct().

Referenced by EBF_streamProcess().

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.

Returns:
Status
Parameters:
lcb The LCB control/context handle

References _LCBP::edm, _EDM::first, _EDM::nsecx, _EDM::offset, and _EDM::prv_truncated.

Referenced by EBF_streamProcess().

int LCBP_evt_cb_set ( LCBP  lcb,
unsigned int  proto,
LCBV_pktCb  rtn,
void *  prm 
)

Establishes a callback handler for the specified protocal.

Return values:
0,Success 
-1,Protocal out-of-range
Parameters:
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().

int LCBP_evt_enable ( LCBP  lcb,
int  enable 
)

Enables/Disables the flow of events.

Return values:
0,Event enable was not set before this call
1,Event enable was set before this call
Anything else, an LCBP error
Parameters:
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.

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

Return values:
Pointer to the fork que or NULL if non-existent
Parameters:
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.

Return values:
0,currently there is no failure mode
Parameters:
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.

Returns:
A pointer to the virtual LCB control block

unsigned int LCBP_pktsConnect ( LCBP  lcb,
EBF_pkts  pkts 
)

Connect a stream of packets to the virtual LCB.

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

Returns:
A bit mask of LCBP_PKT_FATE_M from the terminating callback or LCBP_PKT_FATE_M_EOF;
Parameters:
lcb The virtual LCB device handle
The signature and return values are built to match that of the actual LCBP driver. Therefore, the user callback routine should work in both environments. The cavaet is that there obviously non-portable things one can do in the callback, like manipulating the contents of the vector of packets. The point is, that with this routine, at least the capability of writing a portable processing routine exists.

References LCBP_EDS_K_NORMAL, LCBP_EDS_K_TIMED, normal_delivery(), _LCBP::style, and timed_delivery().

Referenced by EBF_streamProcess().

EBF_pkts LCBP_pktsQuery ( LCBP  lcb  ) 

Returns the current EBF_pkts.

Returns:
The current EBF_pkts
Parameters:
lcb The virtual LCB device handle

References _LCBP::pkts.

unsigned int LCBP_pktsRngFree ( LCBP  lcb,
EBF_pkt from,
EBF_pkt to 
)

Dummy implementation of the corresponds LCBD routine.

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

Returns:
The size, in bytes, of a virtual LCB control block.

Referenced by fileOpen().


Generated on Fri Dec 9 16:39:56 2011 by  doxygen 1.5.8