예제 #1
0
/*                      TnetwDrv_Destroy()
 ****************************************************************************
 * DESCRIPTION: Clear The module
 *
 * INPUTS:  Handle to the module
 *
 * OUTPUT:  
 *
 * RETURNS: 
 ****************************************************************************/
void TnetwDrv_Destroy (TI_HANDLE hTnetwDrv)
{

    TnetwDrv_t *pTnetwDrv = (TnetwDrv_t *)hTnetwDrv;
    
    WLAN_INIT_REPORT(("TnetwDrv_Destroy !!!\n"));
    if (pTnetwDrv == NULL) 
    {
        return;
    }

    /* free the hal ctrl */
    if (pTnetwDrv->hHalCtrl != NULL)
    {
        whalCtrl_Destroy(pTnetwDrv->hHalCtrl);
        pTnetwDrv->hHalCtrl = NULL;
    }
    WLAN_INIT_REPORT(("TNETW_Driver_Destroy hHalCtrl released!!!\n"));
    
    /* free the MAC Services */
    if (pTnetwDrv->hMacServices != NULL)
    {
        MacServices_destroy(pTnetwDrv->hMacServices);
        pTnetwDrv->hMacServices = NULL;
    }
    WLAN_INIT_REPORT(("TNETW_Driver_Destroy hMacServices released!!!\n"));
    
    /*
     * Free the Ctrl modules
     */
    if (pTnetwDrv->hCmdQueue != NULL)
    {
        CmdQueue_Destroy(pTnetwDrv->hCmdQueue);
        pTnetwDrv->hCmdQueue = NULL;
    }

    /* 
     * Free the FW-Transfer modules:
     */

    if (pTnetwDrv->hTxXfer != NULL)
    {
        txXfer_Destroy(pTnetwDrv->hTxXfer);
        pTnetwDrv->hTxXfer = NULL;
    }

    if (pTnetwDrv->hTxResult != NULL)
    {
        txResult_Destroy(pTnetwDrv->hTxResult);
        pTnetwDrv->hTxResult = NULL;
    }

    if (pTnetwDrv->hRxXfer != NULL)
    {
        rxXfer_Destroy(pTnetwDrv->hRxXfer);
        pTnetwDrv->hRxXfer = NULL;
    }

    if (pTnetwDrv->hEventMbox != NULL) 
    {
        eventMbox_Destroy(pTnetwDrv->hEventMbox);
        pTnetwDrv->hEventMbox = NULL;
    }

#ifdef TI_DBG
    if (pTnetwDrv->hDebugTrace != NULL) 
    {
        debugTrace_Destroy(pTnetwDrv->hDebugTrace);
        pTnetwDrv->hDebugTrace = NULL;
    }
#endif /* TI_DBG */

    if (pTnetwDrv->hFwEvent != NULL)
    {
        FwEvent_Destroy(pTnetwDrv->hFwEvent);
        pTnetwDrv->hFwEvent = NULL;
    }

    if (pTnetwDrv->hCmdMBox != NULL)
    {
        CmdMBox_Destroy(pTnetwDrv->hCmdMBox);
        pTnetwDrv->hCmdMBox = NULL;
    }

    /* 
     * Free the Data-Services modules:
     */

    if (pTnetwDrv->hTxCtrlBlk != NULL)
    {
        txCtrlBlk_Destroy(pTnetwDrv->hTxCtrlBlk);
        pTnetwDrv->hTxCtrlBlk = NULL;
    }

    if (pTnetwDrv->hTxHwQueue != NULL)
    {
        txHwQueue_Destroy(pTnetwDrv->hTxHwQueue);
        pTnetwDrv->hTxHwQueue = NULL;
    }
    
#if !defined(GWSI_DRIVER) && !defined(GWSI_LIB)
    if (pTnetwDrv->hRecoveryCtrl != NULL)
    {
        recoveryCtrl_destroy(pTnetwDrv->hRecoveryCtrl);
        pTnetwDrv->hRecoveryCtrl = NULL;
    }

    if (pTnetwDrv->hHwInit != NULL)
    {
        hwInit_destroy(pTnetwDrv->hHwInit);
        pTnetwDrv->hHwInit = NULL;
    }
#endif
    
    /* free the TNETW driver */
    if ( NULL != pTnetwDrv->pInitTableCopy )
    {
        os_memoryFree( pTnetwDrv->hOs, pTnetwDrv->pInitTableCopy, sizeof(TnetwDrv_InitParams_t) );
        pTnetwDrv->pInitTableCopy = NULL;
    }

    os_memoryFree(pTnetwDrv->hOs, (TI_HANDLE)pTnetwDrv, sizeof(TnetwDrv_t));
    pTnetwDrv = NULL;
    
    WLAN_INIT_REPORT(("TNETW_Driver_Destroy pTNETW_Driver released!!!\n"));
    
    return;
}
예제 #2
0
TI_STATUS TWD_Destroy (TI_HANDLE hTWD)
{
    TTwd *pTWD = (TTwd *)hTWD;

    if (pTWD == NULL)
    {
        return TI_NOK;
    }

    if (pTWD->hTwIf != NULL)
    {
        twIf_Destroy (pTWD->hTwIf);
        pTWD->hTwIf = NULL;
    }

    /* Free the Command Builder */
    if (pTWD->hCmdBld != NULL)
    {
        cmdBld_Destroy (pTWD->hCmdBld);
        pTWD->hCmdBld = NULL;
    }

    /* Free the MAC Services */
    if (pTWD->hMacServices != NULL)
    {
        MacServices_destroy(pTWD->hMacServices);
        pTWD->hMacServices = NULL;
    }

    /*
     * Free the Ctrl modules
     */
    if (pTWD->hCmdQueue != NULL)
    {
        cmdQueue_Destroy(pTWD->hCmdQueue);
        pTWD->hCmdQueue = NULL;
    }

    /*
     * Free the FW-Transfer modules:
     */
    if (pTWD->hTxXfer != NULL)
    {
        txXfer_Destroy (pTWD->hTxXfer);
        pTWD->hTxXfer = NULL;
    }

    if (pTWD->hTxResult != NULL)
    {
        txResult_Destroy (pTWD->hTxResult);
        pTWD->hTxResult = NULL;
    }

    if (pTWD->hRxXfer != NULL)
    {
        rxXfer_Destroy (pTWD->hRxXfer);
        pTWD->hRxXfer = NULL;
    }

    if (pTWD->hEventMbox != NULL)
    {
        eventMbox_Destroy (pTWD->hEventMbox);
        pTWD->hEventMbox = NULL;
    }

#ifdef TI_DBG
    if (pTWD->hFwDbg != NULL)
    {
        fwDbg_Destroy (pTWD->hFwDbg);
        pTWD->hFwDbg = NULL;
    }
#endif /* TI_DBG */

    if (pTWD->hFwEvent != NULL)
    {
        fwEvent_Destroy (pTWD->hFwEvent);
        pTWD->hFwEvent = NULL;
    }

    if (pTWD->hCmdMbox != NULL)
    {
        cmdMbox_Destroy (pTWD->hCmdMbox);
        pTWD->hCmdMbox = NULL;
    }

    if (pTWD->hRxQueue != NULL)
    {
        RxQueue_Destroy (pTWD->hRxQueue);
        pTWD->hRxQueue = NULL;
    }

    /*
     * Free the Data-Services modules:
     */

    if (pTWD->hTxCtrlBlk != NULL)
    {
        txCtrlBlk_Destroy (pTWD->hTxCtrlBlk);
        pTWD->hTxCtrlBlk = NULL;
    }

    if (pTWD->hTxHwQueue != NULL)
    {
        txHwQueue_Destroy (pTWD->hTxHwQueue);
        pTWD->hTxHwQueue = NULL;
    }

    if (pTWD->hHwInit != NULL)
    {
        hwInit_Destroy (pTWD->hHwInit);
        pTWD->hHwInit = NULL;
    }

    os_memoryFree (pTWD->hOs, (TI_HANDLE)pTWD, sizeof(TTwd));

    return TI_OK;
}