GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MEM / V5-7-1

Constituent: mem     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

MEM_command.c File Reference

MEM application-level command handlers. More...

#include <string.h>
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_pubdefs.h"
#include "LSF/LSF.h"
#include "LSF/LSF_ids.h"
#include "MSG/MSG_pubdefs.h"
#include "MEM/MEM_apid.h"
#include "MEM/MEM_cmddefs.h"
#include "MEM/MEM_dump.h"
#include "MEM/MEM_load.h"
#include "MEM/MEM_msgs.h"
#include "MEM/MEM_tlmdefs.h"
#include "MEM/QMEM.h"
#include "PBS/MBA.h"
#include "PBS/WCT.h"
#include "PBS/WUT.h"
#include "MEM_control.h"

Include dependency graph for MEM_command.c:


Defines

#define MEM_DUMP_PKT_PERIOD_USEC   (250000)
 Period of memory dump packets, in microseconds.

Functions

static unsigned int mem_check_state (MEM_Control *mem_p)
 Verify that MEM system is in proper state to handle commands.
static unsigned int mem_forward_cmd (MEM_Control *mem_p, const ITC_QueueItem *qitem_p, void *pkt_p, unsigned int len, int *fwd_p)
 Common function to forward MEM commands to other nodes.
static void mem_fpa_free (ITC_QueueItem *qitem_p, unsigned int status, void *parm_0, void *parm_1, void *parm_2, unsigned int tx)
 ITC callback to free FPA memory.
static unsigned int mem_fpa_get (MEM_Control *mem_p, ITC_QueueItem **qitem_pp, char *desc)
 Allocate an ITC queue item from an FPA pool.
static unsigned int mem_send_pool_data (MEM_Control *mem_p, unsigned int pool_id, unsigned int tran_id)
 Send memory pool statistics telemetry.
static unsigned int mem_send_dump_next_cmd (MEM_Control *mem_p)
 Send the LMEMDUMPNEXT command.
static WUT_cb_status mem_wut_handler (void *prm, WUT_tmr *wut)
 Callback routine for the Memory Dump wake-up timer.
static void mem_free_dump_pkt (ITC_QueueItem *qitem_p, unsigned int status_in, void *parm_0_in, void *parm_1_in, void *parm_2_in, unsigned int tx)
 ITC callback to free a dump telemetry packet.
static unsigned int mem_build_dump_data_1553 (MEM_Control *mem_p, ITC_QueueItem **qitem_pp)
 Build a memory dump data telemetry packet to send to the 1553.
static unsigned int mem_build_dump_data_ssr (MEM_Control *mem_p, ITC_QueueItem **qitem_pp)
 Build a memory dump data telemetry packet to send to the SSR.
static unsigned int mem_build_dump_data (MEM_Control *mem_p, ITC_QueueItem **qitem_pp)
 Build a memory dump data telemetry packet.
static unsigned int mem_send_dump_data (MEM_Control *mem_p, ITC_QueueItem *qitem_p)
 Send a memory dump data telemetry packet.
static unsigned int mem_handle_dump (MEM_Control *mem_p, const ITC_QueueItem *qitem_p, void *pkt_p, unsigned int len, unsigned int min_len, unsigned int fcode_orig, unsigned int tran_id, ITC_NodeID dest_nid)
 Common Memory Dump command handling.
unsigned int MEM_LMEMDUMPMEM (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Memory Data Dump command.
unsigned int MEM_LMEMDUMPCANCEL (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Memory Dump Cancel command.
unsigned int MEM_LMEMDUMPPCI (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the PCI Device Header Dump telecommand.
unsigned int MEM_LMEMDUMPREG (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Processor Register Dump telecommand.
unsigned int MEM_LMEMDUMPPOOL (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Memory Pool Status Dump telecommand.
unsigned int MEM_LMEMDUMPSYMREL (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Memory Dump Symbol Relative telecommand.
unsigned int MEM_LMEMDUMPSYMVAL (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Memory Symbol Lookup telecommand.
unsigned int MEM_LMEMDUMPNEXT (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Dump-Next telecommand.
static unsigned int mem_handle_load (MEM_Control *mem_p)
 Common Memory Write command handling.
unsigned int MEM_LMEMLOADMEM (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Memory Write command.
unsigned int MEM_LMEMLOADPCI (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the PCI Device Header Write telecommand.
unsigned int MEM_LMEMLOADREG (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Handle the Processor Register Write telecommand.

Detailed Description

MEM application-level command handlers.

    CVS $Id: MEM_command.c,v 1.27 2006/05/23 14:08:49 dmay Exp $
    

Application-level handlers for the MEM dump and load commands. These handlers simply forward the commands to a target node.


Function Documentation

unsigned int mem_build_dump_data MEM_Control mem_p,
ITC_QueueItem **  qitem_pp
[static]
 

Build a memory dump data telemetry packet.

Parameters:
mem_p Pointer to MEM control block.
qitem_pp Location to return pointer to packet queue item.
Returns:
MSG code.

unsigned int mem_build_dump_data_1553 MEM_Control mem_p,
ITC_QueueItem **  qitem_pp
[static]
 

Build a memory dump data telemetry packet to send to the 1553.

Parameters:
mem_p Pointer to MEM control block.
qitem_pp Location to return pointer to packet queue item.
Returns:
MSG code.

unsigned int mem_build_dump_data_ssr MEM_Control mem_p,
ITC_QueueItem **  qitem_pp
[static]
 

Build a memory dump data telemetry packet to send to the SSR.

Parameters:
mem_p Pointer to MEM control block.
qitem_pp Location to return pointer to packet queue item.
Returns:
MSG code.

unsigned int mem_check_state MEM_Control mem_p  )  [static]
 

Verify that MEM system is in proper state to handle commands.

This function checks the state of the MEM system to determine if it has been initialized.

Parameters:
mem_p Pointer to MEM control block.
Returns:
MSG code.

unsigned int mem_forward_cmd MEM_Control mem_p,
const ITC_QueueItem *  qitem_p,
void *  pkt_p,
unsigned int  len,
int *  fwd_p
[static]
 

Common function to forward MEM commands to other nodes.

This function looks at a MEM telecommand packet and determines if it should be forwarded to another node (CPU). It assumes that the ID of the target node is located in the same place within all MEM telecommand packets.

Parameters:
mem_p Pointer to MEM control block.
qitem_p Pointer to telecommand queue item.
pkt_p Pointer to telecommand packet.
len Length of telecommand packet, in bytes.
fwd_p Location to store pkt disposition (nonzero=>forwarded).
Returns:
MSG code.

void mem_fpa_free ITC_QueueItem *  qitem_p,
unsigned int  status,
void *  parm_0,
void *  parm_1,
void *  parm_2,
unsigned int  tx
[static]
 

ITC callback to free FPA memory.

Parameters:
qitem_p Pointer to packet's queue item.
status Status of packet transmission.
parm_0 Callback parameter 0 (pointer to MEM control block).
parm_1 Callback parameter 1 (pointer to FPA packet).
parm_2 Callback parameter 2 (unused).
tx Flag indicating sender-side failure (unused).
Returns:
Nothing.

ITC_QueueItem * mem_fpa_get MEM_Control mem_p,
ITC_QueueItem **  qitem_pp,
char *  desc
[static]
 

Allocate an ITC queue item from an FPA pool.

Parameters:
mem_p Pointer to MEM control block.
qitem_pp Location to return pointer to allocated queue item.
desc Description of the queue item.
Returns:
MSG code.

void mem_free_dump_pkt ITC_QueueItem *  qitem_p,
unsigned int  status_in,
void *  parm_0_in,
void *  parm_1_in,
void *  parm_2_in,
unsigned int  tx
[static]
 

ITC callback to free a dump telemetry packet.

Parameters:
qitem_p Pointer to packet's queue item.
status_in Status of packet transmission.
parm_0_in Callback parameter 0 (pointer to MEM control block).
parm_1_in Callback parameter 1 (pointer to FPA packet).
parm_2_in Callback parameter 2 (unused).
tx Flag indicating sender-side failure.
Returns:
Nothing.

unsigned int mem_handle_dump MEM_Control mem_p,
const ITC_QueueItem *  qitem_p,
void *  pkt_p,
unsigned int  len,
unsigned int  min_len,
unsigned int  fcode_orig,
unsigned int  tran_id,
ITC_NodeID  dest_nid
[static]
 

Common Memory Dump command handling.

Parameters:
mem_p Pointer to MEM control block.
qitem_p Pointer to received queue item.
pkt_p Pointer to received command packet.
len Length of received command packet, in bytes.
min_len Minimum required length of command packet, in bytes.
fcode_orig Original function code from command packet.
tran_id Transaction ID from command packet.
dest_nid Telemetry destination node ID.
Returns:
MSG code.

unsigned int mem_handle_load MEM_Control mem_p  )  [static]
 

Common Memory Write command handling.

Parameters:
mem_p Pointer to MEM control block.
Returns:
MSG code.

unsigned int MEM_LMEMDUMPCANCEL void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Memory Dump Cancel command.

Callback function for ITC that handles the Memory Dump Cancel telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item.
pay Pointer to command payload.
len Length of the command payload, in bytes.
Returns:
MSG code.

unsigned int MEM_LMEMDUMPMEM void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Memory Data Dump command.

Callback function for ITC that handles the Memory Data Dump telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item.
pay Pointer to command payload.
len Length of the command payload, in bytes.
Returns:
MSG code.

unsigned int MEM_LMEMDUMPNEXT void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Dump-Next telecommand.

Callback function for ITC that handles the Dump-Next telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMDUMPPCI void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the PCI Device Header Dump telecommand.

Callback function for ITC that handles the PCI Device Header Dump telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMDUMPPOOL void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Memory Pool Status Dump telecommand.

Callback function for ITC that handles the Memory Pool Status Dump telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMDUMPREG void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Processor Register Dump telecommand.

Callback function for ITC that handles the Processor Register Dump telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMDUMPSYMREL void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Memory Dump Symbol Relative telecommand.

Callback function for ITC that handles the Memory Dump Symbol Relative telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMDUMPSYMVAL void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Memory Symbol Lookup telecommand.

Callback function for ITC that handles the Memory Symbol Lookup telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMLOADMEM void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Memory Write command.

Callback function for ITC that handles the Memory Write telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item.
pay Pointer to command payload.
len Length of the command payload, in bytes.
Returns:
MSG code.

unsigned int MEM_LMEMLOADPCI void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the PCI Device Header Write telecommand.

Callback function for ITC that handles the PCI Device Header Write telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int MEM_LMEMLOADREG void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len
 

Handle the Processor Register Write telecommand.

Callback function for ITC that handles the Processor Register Write telecommand.

Parameters:
prm Unused.
qitem Pointer to queue item from ITC.
pay Pointer to CCSDS packet containing the command.
len Length of the CCSDS packet, in bytes.
Returns:
A MEM MSG code.

unsigned int mem_send_dump_data MEM_Control mem_p,
ITC_QueueItem *  qitem_p
[static]
 

Send a memory dump data telemetry packet.

Parameters:
mem_p Pointer to MEM control block.
qitem_p Pointer to packet queue item.
Returns:
MSG code.

unsigned int mem_send_dump_next_cmd MEM_Control mem_p  )  [static]
 

Send the LMEMDUMPNEXT command.

Parameters:
mem_p Pointer to MEM control block.
Returns:
MSG code.

unsigned int mem_send_pool_data MEM_Control mem_p,
unsigned int  pool_id,
unsigned int  tran_id
[static]
 

Send memory pool statistics telemetry.

Parameters:
mem_p Pointer to MEM control block.
pool_id ID of the pool to query.
tran_id Transaction ID to send in the telemetry.
Returns:
MSG code.

WUT_cb_status mem_wut_handler void *  prm,
WUT_tmr *  wut
[static]
 

Callback routine for the Memory Dump wake-up timer.

Parameters:
prm Pointer to MEM control block.
wut Pointer to wake-up timer.
Returns:
Wake-up timer callback status.


Generated on Tue Aug 8 23:13:54 2006 by  doxygen 1.4.4