GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LPA / dev > lpa_siu / rhel5-64
#include <LPA/LPA_cmdxtrn.h>
#include <LPA/LPA_cmddefs.h>
#include <LPA/LPA_tlmdefs.h>
#include <LPA/LPA_msgs.h>
#include <LPA/LPA_siu.h>
#include <LPA_prvdefs.h>
#include <LPA_siu_p.h>
#include <LPA_inline.ih>
#include <LPA_utils.h>
#include <LPA_DB/LPA_DB_modes.h>
#include <ITC/ITC_pubdefs.h>
#include <IMM/FPM_pubdefs.h>
#include <LCBD/LCBD.h>
#include <LCS/LCS_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <LEM/list.h>
#include <LEM/list_structs.h>
#include <LEM/decode.h>
#include <LCFG/LCFG.h>
#include <PBS/MBA.h>
#include <PBS/WUT.h>
#include <PBS/WCT.h>
#include <PBS/TOV.h>
#include <MSG/MSG_pubdefs.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
Functions | |
static unsigned int | LPA_proc_ctl (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len) |
Process raw task messages from the ctl queue. | |
static unsigned int | LPA_proc_bulk (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len) |
Process raw task messages from the bulk queue. | |
static unsigned int | LPA_send_cpus (unsigned short fcode, unsigned int cpus, ITC_TaskID tid, ITC_QueueID qid, void *pay, unsigned int size, unsigned int ack) |
Send a message to cpus. | |
static unsigned int | LPA_send_lim (unsigned int fcode, unsigned int epu_stat) |
Send a message to LIM. | |
static unsigned int | LPA_cpu_response (ITC_NodeID node, LPA_MsgHdr *mhdr) |
Gather cpu response messages and send LIM ack. | |
static unsigned int | LPA_cpu_complete (void) |
Process a cpu response completion. | |
static unsigned int | LPA_cpu_error (void) |
Process a cpu response failure from timeout or error status. | |
static WUT_cb_status | LPA_wut_cb (void *ptr, WUT_tmr *wut) |
The cpu response timeout callback routine. | |
static unsigned int | LPA_cfg_ebm (void) |
Configure the EBM destination enables register. | |
static unsigned int | LPA_latc (unsigned int file, unsigned int ignore, unsigned int consign, unsigned int *key) |
Configure the instrument with LATC (LCFG). | |
static unsigned int | LPA_proc_start (void *pay) |
Process a start run command. | |
static unsigned int | LPA_set_default (void *pay) |
Set start run parameter defaults. | |
static unsigned int | LPA_set_grb (void *pay) |
Set GRB processing parameters. | |
static unsigned int | LPA_start_run (void) |
Start physics run. | |
static unsigned int | LPA_stop_run (void) |
Stop physics run. | |
static unsigned int | LPA_stop_complete (void) |
Stop completion of physics run. | |
static unsigned int | LPA_send_siu_tlm (void) |
Send diagnostic telemetry packet. | |
unsigned int | LPA_siu_init (void) |
Initialize the LPA system on the SIU. | |
unsigned int | LPA_siu_start (void) |
Start the LPA system. | |
unsigned int | LPA_proc_cmd (unsigned short fcode, void *pay) |
Process and dispatch commands. | |
unsigned int | LPA_set_mode (unsigned int mode) |
Set current mode. | |
void | LPA_get_siu_tlm (LPA_SIUCFG_Tlm *pkt) |
Get current telemetry packet data. | |
unsigned int | LPA_gbm_int (void) |
Notify LPA of a GBM interrupt. | |
void | LPA_cb_siu_reset (unsigned short fmt, unsigned short len, const void *dat) |
Restore LPA siu operation after turbo reset. | |
Variables | |
LPA_Siu | Lpa_siu |
The static instance of the LPA task control structure. |
CVS $Id: LPA_siu.c,v 1.38 2011/03/28 22:24:21 russell Exp $
void LPA_cb_siu_reset | ( | unsigned short | fmt, | |
unsigned short | len, | |||
const void * | dat | |||
) |
Restore LPA siu operation after turbo reset.
fmt | (in) Format of global context data | |
len | (in) Length of global context data | |
dat | (in) Global context data |
References _LPA_GRBPRMVALID::bf, _LPA_LATCPRMVALID::bf, _LPA_Siu::crx_fcb, _LPA_SetDefault_Prm::db, _LPA_SetGrb_Prm::epu, _LPA_SetGrb_Prm::gbm, _LPA_SetGrb_Prm::grb, _LPA_SetDefault_Prm::ignore, _LPA_SetGrb_Prm::intv, _LPA_SetDefault_Prm::latc, LPA_CFG_CMD_APID, LPA_free_fpm(), LPA_K_SIU_RESET_FORMAT_0, LPA_set_grb(), LPA_SETDEFAULT_FCODE, _LPA_SetGrb_Prm::mode, _LPA_SetDefault_Pkt::pay, _LPA_SetGrb_Prm::rpt, _LPA_Siu_Reset::setdef, _LPA_Siu_Reset::setgrb, _LPA_LATCPRMVALID::us, _LPA_SetGrb_Prm::valid, and _LPA_SetDefault_Prm::valid.
static unsigned int LPA_cfg_ebm | ( | void | ) | [static] |
Configure the EBM destination enables register.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cmdRsp, and _LPA_Siu::cpus.
Referenced by LPA_latc().
static unsigned int LPA_cpu_complete | ( | void | ) | [static] |
Process a cpu response completion.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::err_cpus, LPA_COMPLETE_FCODE, LPA_cpu_error(), LPA_send_cpus(), LPA_send_lim(), LPA_send_siu_tlm(), LPA_start_run(), LPA_stop_complete(), LPA_stop_run(), _LPA_Siu::mode, _LPA_Siu::opcode, and _LPA_Siu::req_mode.
Referenced by LPA_cpu_response().
static unsigned int LPA_cpu_error | ( | void | ) | [static] |
Process a cpu response failure from timeout or error status.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, _LPA_Siu::err_cpus, _LPA_Siu::latc_consign, LPA_COMPLETE_FCODE, LPA_send_cpus(), LPA_send_lim(), LPA_stop_complete(), _LPA_Siu::mode, _LPA_Siu::opcode, _LPA_Siu::req_mode, and _LPA_Siu::resp_cpus.
Referenced by LPA_cpu_complete(), LPA_cpu_response(), and LPA_proc_bulk().
static unsigned int LPA_cpu_response | ( | ITC_NodeID | node, | |
LPA_MsgHdr * | mhdr | |||
) | [static] |
Gather cpu response messages and send LIM ack.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::err_cpus, LPA_cpu_complete(), LPA_cpu_error(), _LPA_Siu::opcode, _LPA_MsgHdr::opcode, _LPA_Siu::resp_cpus, _LPA_MsgHdr::status, _LPA_Siu::tx_id, _LPA_MsgHdr::tx_id, and _LPA_Siu::wut.
Referenced by LPA_proc_bulk().
unsigned int LPA_gbm_int | ( | void | ) |
Notify LPA of a GBM interrupt.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References LPA_send_cpus().
void LPA_get_siu_tlm | ( | LPA_SIUCFG_Tlm * | pkt | ) |
Get current telemetry packet data.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::db_id, _LPA_Siu::db_run, _LPA_SIUCFG_Tlm::def_dbid, _LPA_SIUCFG_Tlm::def_ignid, _LPA_SIUCFG_Tlm::def_latcid, _LPA_SIUCFG_Tlm::epu, _LPA_Siu::epu_enab, _LPA_SIUCFG_Tlm::gbm, _LPA_Siu::gbm_enab, _LPA_Siu::grb_id, _LPA_SIUCFG_Tlm::grb_id, _LPA_Siu::ignore_id, _LPA_Siu::ignore_key, _LPA_Siu::ignore_run, _LPA_SIUCFG_Tlm::last_dbid, _LPA_SIUCFG_Tlm::last_ignid, _LPA_SIUCFG_Tlm::last_ignkey, _LPA_SIUCFG_Tlm::last_latcid, _LPA_SIUCFG_Tlm::last_latckey, _LPA_SIUCFG_Tlm::last_mode, _LPA_SIUCFG_Tlm::last_run, _LPA_SIUCFG_Tlm::last_start, _LPA_Siu::latc_id, _LPA_Siu::latc_key, _LPA_Siu::latc_run, _LPA_Siu::mode, _LPA_Siu::run_id, _LPA_Siu::sim_intv, _LPA_SIUCFG_Tlm::sim_intv, _LPA_Siu::sim_mode, _LPA_SIUCFG_Tlm::sim_mode, _LPA_Siu::sim_rpt, _LPA_SIUCFG_Tlm::sim_rpt, and _LPA_Siu::start_time.
static unsigned int LPA_latc | ( | unsigned int | file, | |
unsigned int | ignore, | |||
unsigned int | consign, | |||
unsigned int * | key | |||
) | [static] |
Configure the instrument with LATC (LCFG).
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References LPA_cfg_ebm(), LPA_wut_cb(), _LPA_Siu::opcode, _LPA_Siu::run_id, and _LPA_Siu::wut.
Referenced by LPA_start_run().
static unsigned int LPA_proc_bulk | ( | void * | prm, | |
const struct _ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) | [static] |
Process raw task messages from the bulk queue.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_MsgHdr::fcode, LPA_cpu_error(), LPA_cpu_response(), and _LPA_MsgHdr::opcode.
Referenced by LPA_siu_init().
unsigned int LPA_proc_cmd | ( | unsigned short | fcode, | |
void * | pay | |||
) |
Process and dispatch commands.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, _LPA_Siu::err_cpus, LPA_proc_start(), LPA_send_cpus(), LPA_set_default(), LPA_set_grb(), _LPA_Siu::opcode, and _LPA_Siu::resp_cpus.
Referenced by LPA_Associate(), LPA_Configure(), LPA_Noop(), LPA_SetCompress(), LPA_SetDefault(), LPA_SetGrb(), LPA_SetOutput(), LPA_Start(), and LPA_Stop().
static unsigned int LPA_proc_ctl | ( | void * | prm, | |
const struct _ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) | [static] |
Process raw task messages from the ctl queue.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, _LPA_MsgHdr::fcode, LPA_send_cpus(), _LPA_MsgHdr::opcode, _LPA_Siu::opcode, and _LPA_Siu::req_mode.
Referenced by LPA_siu_init().
static unsigned int LPA_proc_start | ( | void * | pay | ) | [static] |
Process a start run command.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Start_Prm::consign, _LPA_Siu::cpus, _LPA_Start_Prm::cpus, _LPA_Start_Prm::db, _LPA_Siu::db_id, _LPA_Siu::db_run, _LPA_Start_Prm::ignore, _LPA_Siu::ignore_id, _LPA_Siu::ignore_key, _LPA_Siu::ignore_run, _LPA_Start_Prm::latc, _LPA_Siu::latc_consign, _LPA_Siu::latc_id, _LPA_Siu::latc_key, _LPA_Siu::latc_run, LPA_get_key(), _LPA_Start_Prm::mode, _LPA_Siu::req_mode, _LPA_Start_Prm::run, and _LPA_Siu::run_id.
Referenced by LPA_proc_cmd().
static unsigned int LPA_send_cpus | ( | unsigned short | fcode, | |
unsigned int | cpus, | |||
ITC_TaskID | tid, | |||
ITC_QueueID | qid, | |||
void * | pay, | |||
unsigned int | size, | |||
unsigned int | ack | |||
) | [static] |
Send a message to cpus.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_MsgHdr::fcode, LPA_COMPLETE_FCODE, LPA_free_fpm(), LPA_wut_cb(), _LPA_Siu::resp_cpus, _LPA_Siu::siu_fpm, _LPA_Siu::start_time, _LPA_MsgHdr::time, _LPA_Siu::tx_id, _LPA_MsgHdr::tx_id, and _LPA_Siu::wut.
Referenced by LPA_cpu_complete(), LPA_cpu_error(), LPA_gbm_int(), LPA_proc_cmd(), LPA_proc_ctl(), LPA_send_lim(), LPA_set_grb(), LPA_set_mode(), and LPA_wut_cb().
static unsigned int LPA_send_lim | ( | unsigned int | fcode, | |
unsigned int | lim_stat | |||
) | [static] |
Send a message to LIM.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_MsgHdr::fcode, _LPA_CompleteMsg::hdr, LPA_send_cpus(), and _LPA_CompleteMsg::status.
Referenced by LPA_cpu_complete(), and LPA_cpu_error().
static unsigned int LPA_send_siu_tlm | ( | void | ) | [static] |
Send diagnostic telemetry packet.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::db_id, _LPA_Siu::db_run, _LPA_SIUCFG_Tlm::def_dbid, _LPA_SIUCFG_Tlm::def_ignid, _LPA_SIUCFG_Tlm::def_latcid, _LPA_SIUCFG_Tlm::epu, _LPA_Siu::epu_enab, _LPA_SIUCFG_Tlm::gbm, _LPA_Siu::gbm_enab, _LPA_Siu::grb_id, _LPA_SIUCFG_Tlm::grb_id, _LPA_Siu::ignore_id, _LPA_Siu::ignore_key, _LPA_Siu::ignore_run, _LPA_SIUCFG_Tlm::last_dbid, _LPA_SIUCFG_Tlm::last_ignid, _LPA_SIUCFG_Tlm::last_ignkey, _LPA_SIUCFG_Tlm::last_latcid, _LPA_SIUCFG_Tlm::last_latckey, _LPA_SIUCFG_Tlm::last_mode, _LPA_SIUCFG_Tlm::last_run, _LPA_SIUCFG_Tlm::last_start, _LPA_Siu::latc_id, _LPA_Siu::latc_key, _LPA_Siu::latc_run, LPA_free_fpm(), LPA_SIUCFG_TLM_APID, _LPA_Siu::mode, _LPA_Siu::run_id, _LPA_Siu::sim_intv, _LPA_SIUCFG_Tlm::sim_intv, _LPA_Siu::sim_mode, _LPA_SIUCFG_Tlm::sim_mode, _LPA_Siu::sim_rpt, _LPA_SIUCFG_Tlm::sim_rpt, _LPA_Siu::start_time, and _LPA_Siu::tlm_fpm.
Referenced by LPA_cpu_complete(), LPA_set_default(), and LPA_set_grb().
static unsigned int LPA_set_default | ( | void * | pay | ) | [static] |
Set start run parameter defaults.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_LATCPRMVALID::bf, _LPA_SetDefault_Prm::db, _LPA_Siu::db_id, _LPA_SetDefault_Prm::ignore, _LPA_Siu::ignore_id, _LPA_SetDefault_Prm::latc, _LPA_Siu::latc_id, LPA_K_SIU_RESET_FORMAT_0, LPA_send_siu_tlm(), _LPA_Siu_Reset::setdef, _LPA_Siu::siu_reset, _LPA_Siu::trd, and _LPA_SetDefault_Prm::valid.
Referenced by LPA_proc_cmd().
static unsigned int LPA_set_grb | ( | void * | pay | ) | [static] |
Set GRB processing parameters.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_GRBPRMVALID::bf, _LPA_SetGrb_Prm::cpus, _LPA_SetGrb_Prm::epu, _LPA_Siu::epu_enab, _LPA_SetGrb_Prm::gbm, _LPA_Siu::gbm_enab, _LPA_SetGrb_Prm::grb, _LPA_Siu::grb_id, _LPA_SetGrb_Prm::intv, LPA_K_SIU_RESET_FORMAT_0, LPA_send_cpus(), LPA_send_siu_tlm(), _LPA_SetGrb_Prm::mode, _LPA_SetGrb_Prm::rpt, _LPA_Siu_Reset::setgrb, _LPA_Siu::sim_intv, _LPA_Siu::sim_mode, _LPA_Siu::sim_rpt, _LPA_Siu::siu_reset, _LPA_Siu::trd, _LPA_GRBPRMVALID::us, and _LPA_SetGrb_Prm::valid.
Referenced by LPA_cb_siu_reset(), and LPA_proc_cmd().
unsigned int LPA_set_mode | ( | unsigned int | mode | ) |
Set current mode.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, and LPA_send_cpus().
unsigned int LPA_siu_init | ( | void | ) |
Initialize the LPA system on the SIU.
LPA_SUCCESS | Success |
References _LPA_Siu::cmdRsp, _LPA_SetGrb_Prm::cpus, _LPA_Siu::crx_fcb, _LPA_Siu::ctx_fcb, _LPA_SetDefault_Prm::db, _LPA_SetGrb_Prm::epu, _LPA_SetGrb_Prm::gbm, _LPA_SetGrb_Prm::grb, _LPA_SetDefault_Prm::ignore, _LPA_SetGrb_Prm::intv, _LPA_Siu::itc_task, _LPA_SetDefault_Prm::latc, LPA_Apid660, LPA_Apid674, LPA_Apid675, LPA_K_SIU_RESET_FORMAT_0, LPA_proc_bulk(), LPA_proc_ctl(), _LPA_SetGrb_Prm::mode, _LPA_SetGrb_Prm::rpt, _LPA_Siu_Reset::setdef, _LPA_Siu_Reset::setgrb, _LPA_Siu::siu_fpm, _LPA_Siu::siu_reset, _LPA_Siu::state, _LPA_Siu::tlm_fpm, _LPA_Siu::trd, _LPA_GRBPRMVALID::us, _LPA_LATCPRMVALID::us, _LPA_SetGrb_Prm::valid, _LPA_SetDefault_Prm::valid, and _LPA_Siu::wut.
unsigned int LPA_siu_start | ( | void | ) |
Start the LPA system.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::itc_task, and _LPA_Siu::state.
static unsigned int LPA_start_run | ( | void | ) | [static] |
Start physics run.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, _LPA_Siu::err_cpus, _LPA_Siu::ignore_run, _LPA_Siu::latc_consign, _LPA_Siu::latc_run, LPA_latc(), and _LPA_Siu::resp_cpus.
Referenced by LPA_cpu_complete().
static unsigned int LPA_stop_complete | ( | void | ) | [static] |
Stop completion of physics run.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, _LPA_Siu::latc_consign, _LPA_Siu::mode, _LPA_Siu::req_mode, and _LPA_Siu::run_id.
Referenced by LPA_cpu_complete(), and LPA_cpu_error().
static unsigned int LPA_stop_run | ( | void | ) | [static] |
Stop physics run.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, _LPA_Siu::err_cpus, LPA_wut_cb(), _LPA_Siu::opcode, _LPA_Siu::resp_cpus, and _LPA_Siu::wut.
Referenced by LPA_cpu_complete().
static WUT_cb_status LPA_wut_cb | ( | void * | prm, | |
WUT_tmr * | wut | |||
) | [static] |
The cpu response timeout callback routine.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Siu::cpus, LPA_send_cpus(), _LPA_Siu::opcode, and _LPA_Siu::resp_cpus.
Referenced by LPA_latc(), LPA_send_cpus(), and LPA_stop_run().