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


Interface   Data Structures   File List   Data Fields   Globals  

LTX_sync.c File Reference

Query/reply synchronization. More...

#include <string.h>
#include <PBS/FFS.ih>
#include <PBS/FORK.h>
#include <PBS/WUT.h>
#include <MSG/MSG_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCS/LCS_msgs.h>
#include <LCS_prvdefs.h>

Functions

static WUT_cb_status expireTimer (void *prm, WUT_tmr *wut)
 Timer callback routine to queue a message back to a fork.
static FORK_cb_status forkTimer (FORK_cb_prm *prm, FORK_msg_hdr *msg)
 Enter state wait for allocation reply.
void LTX_cancelTimer (LTX_Engine *txe)
 Cancel a synchronization timeout.
FORK_cb_status LTX_reset (LTX_Engine *txe, unsigned int status)
 Make the engine ready for new business.
FORK_cb_status LTX_sendSync (LTX_Engine *txe)
 Last packet synchronization.
void LTX_startTimer (LTX_Engine *txe, unsigned int key, unsigned int mto)
 Start synchronization timeout.
unsigned int LTX_sync (LTX_Engine *txe, ITC_NodeID nid, unsigned int key, unsigned int dat)
 LTX service response synchronization.


Detailed Description

Query/reply synchronization.

CVS $Id: LTX_sync.c,v 1.7 2011/03/28 22:49:57 apw Exp $
Author:
A.P.Waite

Function Documentation

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

Timer callback routine to queue a message back to a fork.

Parameters:
prm (in) User context parameter (an engine handle)
wut (in) Timer handle
expireTimer() is the routine called at interrupt level by the timeout timer. It simply places a prepared message on the service's meta-lo queue for processing by the allocExpire() routine.

References forkTimer(), _LTX_Service::fqi, _LTX_Engine::ltx, _LTX_Sync::msg, and _LTX_Engine::snc.

Referenced by LTX_startTimer().

static FORK_cb_status forkTimer ( FORK_cb_prm *  prm,
FORK_msg_hdr *  msg 
) [static]

Enter state wait for allocation reply.

Parameters:
prm (in) User context parameter (unused)
msg (in) Fork message
Return values:
FORK_C_CONTINUE Always
forkTimer() is the task level fork service routine that processes a timeout message. If this routine can establish that there's a live transaction to cancel, it will do so. Otherwise, it does nothing (and that last statement is the culmination of a long and tortuous logic maze).

References _LTX_Sync::key, _LCS_Timeout::key, LTX_reset(), _LTX_Timing::out, _LTX_Engine::snc, _LTX_Engine::tim, and _LCS_Timeout::txe.

Referenced by expireTimer().

void LTX_cancelTimer ( LTX_Engine txe  ) 

Cancel a synchronization timeout.

Parameters:
txe (in) Transmit engine

References _LTX_Timing::cnc, _LTX_Timing::hst, _LTX_Sync::mto, _LTX_Engine::snc, _LTX_Engine::tim, _LTX_Sync::tmr, and _LTX_Timing::tos.

Referenced by LTX_allocReply(), and LTX_sendReply().

FORK_cb_status LTX_reset ( LTX_Engine txe,
unsigned int  status 
)

Make the engine ready for new business.

Parameters:
txe (in) Transmit engine
status (in) Completion status for current transaction.
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References _LTX_Engine::adp, _LTX_Engine::beg, _LTX_Engine::clloc, _LTX_Engine::clsav, _LTX_Engine::cnt, _LTX_Engine::end, _LTX_Engine::iqm, _LTX_Sync::key, LCS_K_CL_HDR, LCS_K_CL_PAT, LTX_ENG_READY, _LTX_Engine::pat, _LTX_Engine::qitem, _LTX_Adapter::size, _LTX_Engine::snc, _LTX_Engine::state, _LTX_Engine::stloc, and _LTX_Engine::stsav.

Referenced by forkTimer(), LTX_allocSync(), LTX_resultList(), and LTX_sendNext().

FORK_cb_status LTX_sendSync ( LTX_Engine txe  ) 

Last packet synchronization.

Parameters:
txe (in) Transmit engine handle
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork
LTX_sendSync() synchronizes a reply to the last packet of a message.

References _LTX_Sync::dat, _LTX_Sync::have, LTX_sendNext(), and _LTX_Engine::snc.

Referenced by LTX_protocolCPU(), and LTX_protocolSDI().

void LTX_startTimer ( LTX_Engine txe,
unsigned int  key,
unsigned int  mto 
)

Start synchronization timeout.

Parameters:
txe (in) Transmit engine
key (in) Transaction matching key
mto (in) Message timeout period (usec)

References expireTimer(), _LCS_Timeout::key, _LTX_Sync::msg, _LTX_Sync::mto, _LTX_Engine::snc, _LTX_Engine::tim, _LTX_Sync::tmr, _LTX_Timing::tos, and _LCS_Timeout::txe.

Referenced by LTX_resultList().

unsigned int LTX_sync ( LTX_Engine txe,
ITC_NodeID  nid,
unsigned int  key,
unsigned int  dat 
)

LTX service response synchronization.

Parameters:
txe (in) Transmit engine
nid (in) ITC node id to accumulate into synchronization
key (in) Transaction matching key (integrity check)
dat (in) Protocol specific, but usually return code from response
Return values:
0 Current transaction not synchronized
1 Current transaction synchronized

References _LTX_Sync::dat, _LTX_Sync::have, _LTX_Sync::key, _LTX_Engine::snc, and _LTX_Sync::want.

Referenced by LTX_allocReply(), LTX_resultList(), and LTX_sendReply().


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