GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FILE / V3-11-1 > file_lcp / rhel5-64
#include <PBI/PTR.h>
#include <PBS/RW.h>
#include <PBS/MBA.h>
#include <PBS/WUT.h>
#include <PBS/SEM.h>
#include <MSG/MSG_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <ITC/ITC_dump.h>
#include <IMM/RBM_pubdefs.h>
#include <IMM/FPM_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <FBS/FBS_pubrtos.h>
#include <CDM/CDM_pubdefs.h>
#include <CPU_DB/CPU_DB_pubdefs.h>
#include <FILE_DB/FILE_DB_schema.h>
#include <FILE/FILE_upl.h>
#include <FILE/FILE_cmddefs.h>
#include <FILE/FILE_cmdxtrn.h>
#include <FILE/FILE_lcp_msg.h>
#include <FILE/FILE_lcp.h>
#include <FILE_lcp_private.h>
Functions | |
static unsigned int | lockState (FILE_Control *ctl, RW_key *key, FILE_ControlState old, FILE_ControlState new, const char *fnc) |
static void * | cmdQueueAlloc (FILE_Control *ctl, unsigned int size, ITC_cb_Completion **rtn, void **cb0, void **cb1, void **cb2) |
static void * | cmdConfirmAlloc (FILE_Control *ctl, unsigned int size, ITC_cb_Completion **rtn, void **cb0, void **cb1, void **cb2) |
static void | cmdQueueFree (ITC_QueueItem *qitem, unsigned int status, FILE_Control *ctl, void *prm1, void *prm2) |
static void | cmdConfirmFree (ITC_QueueItem *qitem, unsigned int status, FILE_Control *ctl, unsigned int size, void *prm2) |
unsigned int | FILE_initialize (void) |
Initialize the FILE LCP side system. | |
unsigned int | FILE_shutdown (void) |
Shut down the FILE LCP system. | |
unsigned int | FILE_start (void) |
Create and start the FILE/LFS file management task. | |
unsigned int | FILE_stop (void) |
Stop and shut down FILE/LFS file management task. | |
unsigned int | FILE_startTask (TASK_attr *attr) |
Create and start the FILE/LFS file management task (obsolete). | |
unsigned int | FILE_stopTask (void) |
Stop and shut down FILE/LFS file management task (obsolete). | |
unsigned int | FILE_getTask (ITC_Task **task) |
Return the handle of the ITC "FILE task". | |
Variables | |
static FILE_Control | FILE_ctl |
static const FILE_DB_Schema | configData |
static void * cmdConfirmAlloc | ( | FILE_Control * | ctl, | |
unsigned int | size, | |||
ITC_cb_Completion ** | rtn, | |||
void ** | cb0, | |||
void ** | cb1, | |||
void ** | cb2 | |||
) | [static] |
Allocate memory for the ITC command confirmation process.
ctl | FILE control block | |
size | The size of memory to allocate in bytes. | |
rtn | Holds pointer to completion callback function. | |
cb0 | Completion callback paramter 0. | |
cb1 | Completion callback paramter 1. | |
cb2 | Completion callback paramter 2. |
References _FILE_Control::cmd_confirm_rbm, and cmdConfirmFree().
Referenced by FILE_initialize().
static void cmdConfirmFree | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
FILE_Control * | ctl, | |||
unsigned int | size, | |||
void * | prm2 | |||
) | [static] |
Free memory for the ITC command confirmation process.
qitem | The memory buffer. | |
status | Status of command. | |
ctl | FILE control block | |
size | The size in bytes of the memory buffer. | |
prm2 | Completion callback paramter 2. |
References _FILE_Control::cmd_confirm_rbm.
Referenced by cmdConfirmAlloc().
static void * cmdQueueAlloc | ( | FILE_Control * | ctl, | |
unsigned int | size, | |||
ITC_cb_Completion ** | rtn, | |||
void ** | cb0, | |||
void ** | cb1, | |||
void ** | cb2 | |||
) | [static] |
Allocate memory for the ITC command queue.
ctl | FILE control block | |
size | The size of memory to allocate in bytes. | |
rtn | Holds pointer to completion callback function. | |
cb0 | Completion callback paramter 0. | |
cb1 | Completion callback paramter 1. | |
cb2 | Completion callback paramter 2. |
References _FILE_Control::cmd_queue_fpm, and cmdQueueFree().
Referenced by FILE_initialize().
static void cmdQueueFree | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
FILE_Control * | ctl, | |||
void * | prm1, | |||
void * | prm2 | |||
) | [static] |
Free memory for the ITC command queue.
qitem | The memory buffer. | |
status | Status of command. | |
ctl | FILE control block | |
prm1 | Completion callback paramter 1. | |
prm2 | Completion callback paramter 2. |
References _FILE_Control::cmd_queue_fpm.
Referenced by cmdQueueAlloc().
unsigned int FILE_getTask | ( | ITC_Task ** | task | ) |
Return the handle of the ITC "FILE task".
Returns the handle of the file management LCP task (ITC_TID_LFS_M) which was created in FILE_initialize(). Other file management command handlers should attach to the ITC file management task before FILE_startTask() is called. This call is only valid when the FILE LCP control state is FILE_CTL_INITIALIZED.
task | Holds ITC task handle on return. |
References FILE_CTL_INITIALIZED, _FILE_Control::state, and _FILE_Control::task.
unsigned int FILE_initialize | ( | void | ) |
Initialize the FILE LCP side system.
Creates and initializes all of the resources needed by the FILE LCP software. The following actions are taken:
References _FILE_Control::buf, _FILE_Control::cmd_chksum_size, _FILE_Control::cmd_confirm_rbm, _FILE_Control::cmd_hdr_size, _FILE_Control::cmd_queue_fpm, cmdConfirmAlloc(), cmdQueueAlloc(), _FILE_Control::config, configData, _FILE_Control::epu_upl_buf, _FILE_Control::epu_upl_sem, _FILE_Control::epu_upl_timer, FILE_Apid641, FILE_CTL_BROKEN, FILE_CTL_INITIALIZED, FILE_CTL_INITIALIZING, FILE_CTL_UNINITIALIZED, FILE_uplGet(), FILE_uplInit(), _FILE_Control::node_id, _FILE_Control::path_str, _FILE_Control::rwi, _FILE_Control::state, _FILE_Control::task, and _FILE_Control::upl.
unsigned int FILE_shutdown | ( | void | ) |
Shut down the FILE LCP system.
The FILE control state should be FILE_CTL_INITIALIZED before calling this function. First the FILE control state is set to FILE_CTL_DEINITIALIZING. Then, any resources allocated by the FILE system are released. When complete, the FILE control state is set to FILE_CTL_UNINITIALIZED.
References _FILE_Control::buf, _FILE_Control::cmd_confirm_rbm, _FILE_Control::cmd_queue_fpm, _FILE_Control::epu_upl_buf, _FILE_Control::epu_upl_sem, _FILE_Control::epu_upl_timer, FILE_CTL_DEINITIALIZING, FILE_CTL_INITIALIZED, FILE_CTL_UNINITIALIZED, FILE_uplExit(), lockState(), _FILE_Control::node_id, _FILE_Control::path_str, _FILE_Control::rwi, _FILE_Control::state, _FILE_Control::task, and _FILE_Control::upl.
unsigned int FILE_start | ( | void | ) |
Create and start the FILE/LFS file management task.
The FILE control state should be FILE_CTL_INITIALIZED before calling this function (after calling FILE_initialize()). The FILE control state is first set to FILE_CTL_STARTING. Then the file management task is started by calling ITC_startTask(). Once complete, the FILE control state is set to FILE_CTL_RUNNING.
This function is a replacement for FILE_startTask(). FILE_start() gathers the FILE ITC task configuration parameters from the CPU_DB database instead of requiring users to provide them externally.
References FILE_startTask().
unsigned int FILE_startTask | ( | TASK_attr * | attr | ) |
Create and start the FILE/LFS file management task (obsolete).
The FILE control state should be FILE_CTL_INITIALIZED before calling this function (after calling FILE_initialize()). The FILE control state is first set to FILE_CTL_STARTING. Then the file management task is started by calling ITC_startTask(). Once complete, the FILE control state is set to FILE_CTL_RUNNING.
The function FILE_start() should be used instead of this function.
attr | Task attributes (can be NULL). |
References FILE_CTL_INITIALIZED, FILE_CTL_RUNNING, FILE_CTL_STARTING, lockState(), and _FILE_Control::task.
Referenced by FILE_start().
unsigned int FILE_stop | ( | void | ) |
Stop and shut down FILE/LFS file management task.
The FILE control state should be FILE_CTL_RUNNING before calling this function (after calling FILE_start()). Sets FILE control state to FILE_CTL_INITIALIZED.
This function is a replacement for FILE_stopTask().
References FILE_stopTask().
unsigned int FILE_stopTask | ( | void | ) |
Stop and shut down FILE/LFS file management task (obsolete).
The FILE control state should be FILE_CTL_RUNNING before calling this function (after calling FILE_startTask()). Sets FILE control state to FILE_CTL_INITIALIZED.
The function FILE_stop() should be used instead of this function.
References FILE_CTL_INITIALIZED, FILE_CTL_RUNNING, and lockState().
Referenced by FILE_stop().
static unsigned int lockState | ( | FILE_Control * | ctl, | |
RW_key * | key, | |||
FILE_ControlState | old, | |||
FILE_ControlState | new, | |||
const char * | fnc | |||
) | [static] |
Walk around the FILE LCP control state diagram.
ctl | FILE control block | |
key | An RW key | |
old | State the control block must be in to transition | |
new | State to which the control block wishes to transition | |
fnc | Function name calling this inline |
References _FILE_Control::rwi, and _FILE_Control::state.
Referenced by FILE_shutdown(), FILE_startTask(), and FILE_stopTask().
configData [static] |
Initial value:
{ { 0, 0, 0, 0, 0, 0, 1, }, NULL, NULL, 0x100000, 0x1000, 0x100000, 2032, 2, 16, 16, 390, 125, 2032, }
Referenced by FILE_initialize().
FILE_ctl [static] |
The global instance of the FILE LCP control block.