GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LPA / dev > lpa_epu / linux-gcc
#include <LPA_utils.h>
#include <LPA/LPA_epu.h>
#include <LPA/LPA_siu.h>
#include <LPA/LPA_msgs.h>
#include <LPA/LPA_tlmdefs.h>
#include <LPA_prvdefs.h>
#include <LPA_slvdefs.h>
#include <LPA/LPA_cmddefs.h>
#include <LPA_DB/LPA_DB_schema.h>
#include <LPA_DB/LPA_DB_modes.h>
#include <LPA_inline.ih>
#include <LSF/LSF_reason.h>
#include <LSE/LFR_key.h>
#include <TRD/TRD_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <ITC/ITC_msgs.h>
#include <IMM/FPM_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <LCBD/LCBD.h>
#include <CDM/CDM_pubdefs.h>
#include <CPU_DB/CPU_DB_pubdefs.h>
#include <PBS/MBA.h>
#include <PBS/WCT.h>
#include <MSG/MSG_pubdefs.h>
#include <PBI/FFS.ih>
#include <string.h>
#include <stdio.h>
Classes | |
struct | _LPA_Epu_Reset |
Structure to restore LPA operation after a turbo reset. More... | |
struct | _LPA_Cfg |
Structure to hold the LPA mode configuration. More... | |
struct | _LPA_Epu |
Structure to hold the LPA task application control block. More... | |
Defines | |
#define | LPA_K_EPU_RESET_FORMAT_0 0 |
Format of LPA EPU entries in the turbo reset database. | |
Typedefs | |
typedef struct _LPA_Epu_Reset | LPA_Epu_Reset |
Typedef for struct _LPA_Epu_Reset. | |
typedef struct _LPA_Cfg | LPA_Cfg |
Typedef for struct _LPA_Cfg. | |
typedef struct _LPA_Epu | LPA_Epu |
Typedef for struct _LPA_Epu. | |
Functions | |
static unsigned int | LPA_epu_proc (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len) |
Process raw task messages. | |
static unsigned int | LPA_scan_db (CDM_Database *cdb, void *prm) |
Scan for LPA_DB files. | |
static unsigned int | LPA_set_config (void *pay) |
Change the mode handler association. | |
static unsigned int | LPA_set_output (void *pay) |
Change the output stream state. | |
static unsigned int | LPA_set_compress (void *pay) |
Change the data compression level. | |
static unsigned int | LPA_set_grb (void *pay) |
Change the active GRB processor. | |
static unsigned int | LPA_associate (void *pay) |
Associates handler internal configurations with modes. | |
static unsigned int | LPA_start (void *pay, unsigned int time) |
Process start config command. | |
static unsigned int | LPA_stop (void) |
Process stop config command. | |
static unsigned int | LPA_abort (void) |
Process abort command. | |
static unsigned int | LPA_select_mode (unsigned int mode) |
Select the active handler mode. | |
static unsigned int | LPA_swap (unsigned int list) |
Reverse handler list bit order to LSB == bit 0. | |
static FORK_cb_status | LPA_fork_cb (FORK_cb_prm *prm, FORK_msg_hdr *hdr) |
Process forked task messages. | |
static unsigned int | LPA_fork_msg (unsigned int opcode, void *pay, unsigned int prm) |
Fork a message to the event task. | |
static unsigned int | LPA_send_response (unsigned int opcode, unsigned int siu_stat) |
Send response status message to SIU. | |
static unsigned int | LPA_send_epu_tlm (void) |
Send diagnostic telemetry packet. | |
unsigned int | LPA_epu_init (void) |
Initialize the LPA system. | |
unsigned int | LPA_epu_start (void) |
Start the LPA system. | |
unsigned int | LPA_getRunState () |
Returns the LPA run state. | |
void | LPA_get_epu_tlm (LPA_EPU0CFG_Tlm *pkt) |
Get current telemetry packet data. | |
void | LPA_cb_epu_reset (unsigned short fmt, unsigned short len, const void *dat) |
Restore LPA epu operation after turbo reset. | |
Variables | |
static LPA_Epu | Lpa_epu |
The static instance of the LPA task control structure. |
CVS $Id: LPA_epu.c,v 1.37 2011/03/28 22:24:21 russell Exp $
static unsigned int LPA_abort | ( | void | ) | [static] |
Process abort command.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Cfg::handlers, _LPA_Cfg::lpa, LPA_disconnect(), LPA_flush(), and _LPA_Epu::run_state.
Referenced by LPA_fork_cb().
static unsigned int LPA_associate | ( | void * | pay | ) | [static] |
Associates handler internal configurations with modes.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Cfg::assoc, _LPA_Cfg::last_cfgid, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_modeAssociate(), LPA_swap(), and _LPA_Epu::run_state.
Referenced by LPA_epu_proc().
void LPA_cb_epu_reset | ( | unsigned short | fmt, | |
unsigned short | len, | |||
const void * | dat | |||
) |
Restore LPA epu 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_Epu::epu_fpm, LPA_free_fpm(), LPA_K_EPU_RESET_FORMAT_0, _LPA_Epu::node_id, _LPA_Epu_Reset::setgrb, and _LPA_Epu_Reset::setout.
unsigned int LPA_epu_init | ( | void | ) |
Initialize the LPA system.
LPA_SUCCESS | Success |
References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Epu::epu_fpm, _LPA_Epu::epu_reset, _LPA_Epu::evt_que, _LPA_Epu::fpa, _LPA_Epu::fpa_pool, _LPA_Epu::itc_task, LPA_epu_proc(), LPA_getSbcKey(), LPA_K_EPU_RESET_FORMAT_0, LPA_scan_db(), _LPA_Epu::node_id, _LPA_Epu::sbc_key, _LPA_Epu_Reset::setgrb, _LPA_Epu_Reset::setout, _LPA_Epu::state, _LPA_Epu::tlm_fpm, and _LPA_Epu::trd.
static unsigned int LPA_epu_proc | ( | void * | prm, | |
const struct _ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) | [static] |
Process raw task messages.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::last_db, LPA_associate(), LPA_fork_msg(), LPA_send_epu_tlm(), LPA_send_response(), LPA_set_compress(), LPA_set_config(), LPA_set_grb(), LPA_set_output(), _LPA_Epu::node_id, and _LPA_Epu::tx_id.
Referenced by LPA_epu_init().
unsigned int LPA_epu_start | ( | void | ) |
Start the LPA system.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::itc_task, and _LPA_Epu::state.
static FORK_cb_status LPA_fork_cb | ( | FORK_cb_prm * | prm, | |
FORK_msg_hdr * | hdr | |||
) | [static] |
Process forked task messages.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::fpa, LPA_abort(), LPA_select_mode(), LPA_send_response(), LPA_start(), and LPA_stop().
Referenced by LPA_fork_msg().
static unsigned int LPA_fork_msg | ( | unsigned int | opcode, | |
void * | pay, | |||
unsigned int | prm | |||
) | [static] |
Fork a message to the event task.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::evt_que, _LPA_Epu::fpa, and LPA_fork_cb().
Referenced by LPA_epu_proc().
void LPA_get_epu_tlm | ( | LPA_EPU0CFG_Tlm * | pkt | ) |
Get current telemetry packet data.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_mode, _LPA_Cfg::assoc, _LPA_EPU0CFG_Tlm::clevel, _LPA_Cfg::comp_level, _LPA_EPU0CFG_Tlm::dgm_cnt, _LPA_EPU0CFG_Tlm::evh_enab, _LPA_Cfg::evh_post, _LPA_EPU0CFG_Tlm::grb_cnt, _LPA_Epu::grb_id, _LPA_EPU0CFG_Tlm::grb_id, _LPA_Cfg::handlers, _LPA_EPU0CFG_Tlm::handlers, _LPA_EPU0CFG_Tlm::last_assoc, _LPA_Cfg::last_cfgid, _LPA_EPU0CFG_Tlm::last_cfgid, _LPA_Epu::last_db, _LPA_EPU0CFG_Tlm::last_dbid, _LPA_EPU0CFG_Tlm::last_dbkey, _LPA_EPU0CFG_Tlm::last_mode, _LPA_EPU0CFG_Tlm::last_run, _LPA_EPU0CFG_Tlm::last_start, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_get_post_count(), _LPA_Cfg::lpa_key, _LPA_Cfg::lpa_post, _LPA_EPU0CFG_Tlm::lpa_post, LPA_swap(), _LPA_Epu::run_id, and _LPA_Epu::start_time.
unsigned int LPA_getRunState | ( | void | ) |
Returns the LPA run state.
0 | No LPA run in progress | |
1 | LPA run in progress |
References _LPA_Epu::run_state.
Referenced by LPA_grbWutFork().
static unsigned int LPA_scan_db | ( | CDM_Database * | cdb, | |
void * | prm | |||
) | [static] |
Scan for LPA_DB files.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Cfg::comp_level, _LPA_Epu::db_count, _LPA_Cfg::evh_post, _LPA_Cfg::handlers, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_configure(), LPA_construct(), LPA_destruct(), _LPA_Cfg::lpa_key, _LPA_Cfg::lpa_post, LPA_send_response(), LPA_swap(), _LPA_Cfg::origin, and _LPA_Epu::sbc_key.
Referenced by LPA_epu_init().
static unsigned int LPA_select_mode | ( | unsigned int | mode | ) | [static] |
Select the active handler mode.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Cfg::handlers, _LPA_Cfg::lpa, LPA_change_handlers(), and LPA_select().
Referenced by LPA_fork_cb().
static unsigned int LPA_send_epu_tlm | ( | void | ) | [static] |
Send diagnostic telemetry packet.
LPA_ERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_mode, _LPA_Cfg::assoc, _LPA_EPU0CFG_Tlm::clevel, _LPA_Cfg::comp_level, _LPA_EPU0CFG_Tlm::dgm_cnt, _LPA_EPU0CFG_Tlm::evh_enab, _LPA_Cfg::evh_post, _LPA_EPU0CFG_Tlm::grb_cnt, _LPA_Epu::grb_id, _LPA_EPU0CFG_Tlm::grb_id, _LPA_Cfg::handlers, _LPA_EPU0CFG_Tlm::handlers, _LPA_EPU0CFG_Tlm::last_assoc, _LPA_Cfg::last_cfgid, _LPA_EPU0CFG_Tlm::last_cfgid, _LPA_Epu::last_db, _LPA_EPU0CFG_Tlm::last_dbid, _LPA_EPU0CFG_Tlm::last_dbkey, _LPA_EPU0CFG_Tlm::last_mode, _LPA_EPU0CFG_Tlm::last_run, _LPA_EPU0CFG_Tlm::last_start, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_EPU0CFG_TLM_APID, LPA_EPU1CFG_TLM_APID, LPA_EPU2CFG_TLM_APID, LPA_free_fpm(), LPA_get_post_count(), _LPA_Cfg::lpa_key, _LPA_Cfg::lpa_post, _LPA_EPU0CFG_Tlm::lpa_post, LPA_swap(), _LPA_Epu::node_id, _LPA_Epu::run_id, _LPA_Epu::start_time, and _LPA_Epu::tlm_fpm.
Referenced by LPA_epu_proc().
static unsigned int LPA_send_response | ( | unsigned int | opcode, | |
unsigned int | siu_stat | |||
) | [static] |
Send response status message to SIU.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Epu::epu_fpm, _LPA_Cfg::handlers, _LPA_Cfg::lpa, LPA_flush(), LPA_free_fpm(), and _LPA_Epu::tx_id.
Referenced by LPA_epu_proc(), LPA_fork_cb(), and LPA_scan_db().
static unsigned int LPA_set_compress | ( | void * | pay | ) | [static] |
Change the data compression level.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Cfg::comp_level, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, and LPA_change_compress().
Referenced by LPA_epu_proc().
static unsigned int LPA_set_config | ( | void * | pay | ) | [static] |
Change the mode handler association.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Cfg::handlers, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, and LPA_swap().
Referenced by LPA_epu_proc().
static unsigned int LPA_set_grb | ( | void * | pay | ) | [static] |
Change the active GRB processor.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::epu_reset, _LPA_Epu::grb_id, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_change_grb(), LPA_K_EPU_RESET_FORMAT_0, _LPA_Epu_Reset::setgrb, and _LPA_Epu::trd.
Referenced by LPA_epu_proc().
static unsigned int LPA_set_output | ( | void * | pay | ) | [static] |
Change the output stream state.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::epu_reset, _LPA_Cfg::evh_post, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_change_eds_out(), LPA_change_post_out(), LPA_K_EPU_RESET_FORMAT_0, _LPA_Cfg::lpa_post, LPA_swap(), _LPA_Epu_Reset::setout, and _LPA_Epu::trd.
Referenced by LPA_epu_proc().
static unsigned int LPA_start | ( | void * | pay, | |
unsigned int | time | |||
) | [static] |
Process start config command.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Cfg::handlers, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_change_handlers(), _LPA_Cfg::lpa_key, LPA_select(), LPA_startRun(), _LPA_Epu::run_id, _LPA_Epu::run_state, and _LPA_Epu::start_time.
Referenced by LPA_fork_cb().
static unsigned int LPA_stop | ( | void | ) | [static] |
Process stop config command.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
References _LPA_Epu::active_cfg, _LPA_Cfg::lpa, LPA_connect_stop_marker(), and _LPA_Epu::run_state.
Referenced by LPA_fork_cb().
static unsigned int LPA_swap | ( | unsigned int | list | ) | [static] |
Reverse handler list bit order to LSB == bit 0.
LPA_GENERROR | Failure | |
LPA_SUCCESS | Success |
Referenced by LPA_associate(), LPA_get_epu_tlm(), LPA_scan_db(), LPA_send_epu_tlm(), LPA_set_config(), and LPA_set_output().