src/occ_405/wof/wof.c
/**
 * enable_wof
 *
 * Description: Sends IPC command to PGPE to turn WOF on
 *
 * Return: True if we were able to successfully schedule the IPC command
 *         False if the IPC request is still idle.
 */
enable_wof
Description: Sends IPC command to PGPE to turn WOF on

True if we were able to successfully schedule the IPC command
False if the IPC request is still idle.
enable_wof Description : Sends IPC command to PGPE to turn WOF on True if we were able to successfully schedule the IPC command False if the IPC request is still idle .
bool enable_wof( void )
{
    INTR_TRAC_IMP("WOF is being enabled...");
    uint32_t reasonCode = 0;
    bool     result     = true;
    uint32_t bit_to_set = 0;
    int      rc         = 0;
    uint16_t erc        = 0;
    if(!async_request_is_idle( &G_wof_control_req.request ) )
    {
        result = false;
    }
    else
    {
        if( g_wof->control_ipc_rc != 0 )
        {
            INTR_TRAC_ERR("Unknown error from wof control IPC message(enable)");
            INTR_TRAC_ERR("Return Code = 0x%X", g_wof->control_ipc_rc);
            rc = g_wof->control_ipc_rc;
            erc = ERC_WOF_CONTROL_REQ_FAILURE;
            bit_to_set = WOF_RC_CONTROL_REQ_FAILURE;
            g_wof->control_ipc_rc = 0;
            reasonCode = GPE_REQUEST_RC_FAILURE;
        }
        else
        {
            G_wof_control_parms.action = PGPE_ACTION_WOF_ON;
            rc = pgpe_request_schedule( &G_wof_control_req );
            if( rc != 0 )
            {
                INTR_TRAC_ERR("enable_wof() - Error when sending WOF Control"
                        " ON IPC command! RC = %x", rc);
                bit_to_set = WOF_RC_PGPE_WOF_DISABLED;
                erc = ERC_WOF_PGPE_WOF_DISABLED;
                reasonCode = GPE_REQUEST_SCHEDULE_FAILURE;
            }
            else
            {
                g_wof->wof_init_state = WOF_CONTROL_ON_SENT_WAITING;
                result = true;
            }
        }
        if( rc != 0 )
        {
            errlHndl_t l_errl = createErrl(
                    ENABLE_WOF,
                    reasonCode,
                    erc,
                    ERRL_SEV_PREDICTIVE,
                    NULL,
                    DEFAULT_TRACE_SIZE,
                    rc,
                    0);
            result = false;
            set_clear_wof_disabled( SET, bit_to_set, erc );
            commitErrl( &l_errl );
        }
    }
    return result;
}
bool enable_wof ( void ) { INTR_TRAC_IMP ( " " ) ; uint32_t reasonCode = 0 ; bool result = true ; uint32_t bit_to_set = 0 ; int rc = 0 ; uint16_t erc = 0 ; if ( ! async_request_is_idle ( & G_wof_control_req . request ) ) { result = false ; } else { if ( g_wof -> control_ipc_rc != 0 ) { INTR_TRAC_ERR ( " " ) ; INTR_TRAC_ERR ( " " , g_wof -> control_ipc_rc ) ; rc = g_wof -> control_ipc_rc ; erc = ERC_WOF_CONTROL_REQ_FAILURE ; bit_to_set = WOF_RC_CONTROL_REQ_FAILURE ; g_wof -> control_ipc_rc = 0 ; reasonCode = GPE_REQUEST_RC_FAILURE ; } else { G_wof_control_parms . action = PGPE_ACTION_WOF_ON ; rc = pgpe_request_schedule ( & G_wof_control_req ) ; if ( rc != 0 ) { INTR_TRAC_ERR ( " " " " , rc ) ; bit_to_set = WOF_RC_PGPE_WOF_DISABLED ; erc = ERC_WOF_PGPE_WOF_DISABLED ; reasonCode = GPE_REQUEST_SCHEDULE_FAILURE ; } else { g_wof -> wof_init_state = WOF_CONTROL_ON_SENT_WAITING ; result = true ; } } if ( rc != 0 ) { errlHndl_t l_errl = createErrl ( ENABLE_WOF , reasonCode , erc , ERRL_SEV_PREDICTIVE , NULL , DEFAULT_TRACE_SIZE , rc , 0 ) ; result = false ; set_clear_wof_disabled ( SET , bit_to_set , erc ) ; commitErrl ( & l_errl ) ; } } return result ; }
enable_wof
 Description: Sends IPC command to PGPE to turn WOF on
enable_wof Description : Sends IPC command to PGPE to turn WOF on
// Make sure IPC command is idle. // Check to see if a previous wof control IPC message observed an error /** @
             *  @errortype
             *  @moduleid   ENABLE_WOF
             *  @reasoncode GPE_REQUEST_RC_FAILURE
             *  @userdata1  rc - wof_control RC
             *  @userdata2  0
             *  @userdata4  OCC_NO_EXTENDED_RC
             *  @devdesc    OCC Failure from sending wof command
             */ // Set parameters for the GpeRequest /** @
                 *  @errortype
                 *  @moduleid   ENABLE_WOF
                 *  @reasoncode GPE_REQUEST_SCHEDULE_FAILURE
                 *  @userdata1  rc - gpe_request_schedule return code
                 *  @userdata2  0
                 *  @userdata4  OCC_NO_EXTENDED_RC
                 *  @devdesc    OCC Failed to schedule a GPE job for enabling wof
                 */ // Set Init state // Commit the error