Ejemplo n.º 1
0
/*****************************************************************************
 * FUNCTION
 *  nvram_suspend_handler
 * DESCRIPTION
 *  This is the handler to handle MSG_ID_NVRAM_SUSPEND_REQ
 *  After nvram receive this request, it will be suspend forever now.
 * PARAMETERS
 *  ilm_ptr     [IN]        the message content
 * RETURNS
 *  void
 *****************************************************************************/
void nvram_suspend_handler(ilm_struct *ilm_ptr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    nvram_suspend_req_struct *nvram_suspend_req = (nvram_suspend_req_struct*) ilm_ptr->local_para_ptr;
    nvram_suspend_cnf_struct *nvram_suspend_cnf;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    nvram_suspend_cnf = (nvram_suspend_cnf_struct*) construct_local_para(sizeof(nvram_suspend_cnf_struct), TD_CTRL);

    nvram_suspend_cnf->result = NVRAM_ERRNO_SUCCESS;

    nvram_send_ilm(ilm_ptr->src_mod_id, MSG_ID_NVRAM_SUSPEND_CNF, nvram_suspend_cnf, NULL);

    if (nvram_suspend_req == NULL || nvram_suspend_req->suspend_time == 0)
    {
        while(1)
        {
            kal_sleep_task(100);
        }
    }
    else
    {
        kal_sleep_task(nvram_suspend_req->suspend_time);
    }

    return;
}
/*****************************************************************************
 * FUNCTION
 *  nvram_startup_confirm
 * DESCRIPTION
 *  This is nvram_startup_confirm() function of NVRAM module.
 * PARAMETERS
 *  dest_id                 [IN]        
 *  result                  [IN]        
 *  nvram_startup_req       [?]         
 *  ilm_ptr(?)              [IN]        The primitives
 * RETURNS
 *  void
 *****************************************************************************/
static void nvram_startup_confirm(
                module_type dest_id,
                nvram_errno_enum result,
                nvram_startup_req_struct *nvram_startup_req)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    nvram_startup_cnf_struct *nvram_startup_cnf;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    nvram_trace(TRACE_FUNC, FUNC_NVRAM_STARTUP_CNF, result);
    nvram_startup_cnf = (nvram_startup_cnf_struct*) construct_local_para(sizeof(nvram_startup_cnf_struct), TD_CTRL);

    /* Cylen, __FLIGHT_MODE_SUPPORT__ */
    if (result == NVRAM_ERRNO_SUCCESS)
    {
        /* read flight mode status */
        nvram_ltable_entry_struct *ldi;

        nvram_util_get_data_item(&ldi, NVRAM_EF_SYS_CACHE_OCTET_LID);
        result = nvram_read_data_item(ldi, NVRAM_SYS_FLIGHTMODE_STATE, 1, nvram_startup_cnf->data, NVRAM_EF_SYS_CACHE_OCTET_SIZE);
    }

    nvram_startup_cnf->result = result;
    nvram_startup_cnf->access_id = nvram_startup_req->access_id;

    nvram_send_ilm(dest_id, MSG_ID_NVRAM_STARTUP_CNF, nvram_startup_cnf, NULL);

    return;
} 
Ejemplo n.º 3
0
/*****************************************************************************
 * FUNCTION
 *  nvram_set_lock_confirm
 * DESCRIPTION
 *  This is nvram_set_lock_confirm() function of NVRAM module.
 * PARAMETERS
 *  dest_id                 [IN]        
 *  result                  [IN]        
 *  nvram_set_lock_req      [?]         
 *  ilm_ptr(?)              [IN]        The primitives
 * RETURNS
 *  void
 *****************************************************************************/
static void nvram_set_lock_confirm(module_type dest_id,
                                   nvram_errno_enum result,
                                   nvram_set_lock_req_struct *nvram_set_lock_req)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    nvram_set_lock_cnf_struct *nvram_set_lock_cnf;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    nvram_set_lock_cnf = (nvram_set_lock_cnf_struct*) construct_local_para(sizeof(nvram_set_lock_cnf_struct), TD_CTRL);

    nvram_set_lock_cnf->result = result;

    nvram_send_ilm(dest_id, MSG_ID_NVRAM_SET_LOCK_CNF, nvram_set_lock_cnf, NULL);

    return;

}
Ejemplo n.º 4
0
/*****************************************************************************
 * FUNCTION
 *  nvram_reset_confirm
 * DESCRIPTION
 *  This is nvram_reset_confirm() function of NVRAM module.
 * PARAMETERS
 *  dest_id             [IN]        
 *  result              [IN]        
 *  nvram_reset_req     [?]         
 *  ilm_ptr(?)          [IN]        The primitives
 * RETURNS
 *  void
 *****************************************************************************/
static void nvram_reset_confirm(module_type dest_id, nvram_errno_enum result, nvram_reset_req_struct *nvram_reset_req)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    nvram_reset_cnf_struct *nvram_reset_cnf;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    nvram_trace(TRACE_FUNC, FUNC_NVRAM_RESET_CNF, result);
    nvram_reset_cnf = (nvram_reset_cnf_struct*) construct_local_para(sizeof(nvram_reset_cnf_struct), TD_CTRL);


    nvram_reset_cnf->result = result;
    nvram_reset_cnf->access_id = nvram_reset_req->access_id;

    nvram_send_ilm(dest_id, MSG_ID_NVRAM_RESET_CNF, nvram_reset_cnf, NULL);

    return;
}   /* end of nvram_reset_confirm */