/** * Releases the module's allocated objects according to the given init vector. * * @param pMeasurementMgr A handle to the Measurement Manager module. * @param initVec The init vector with a bit set for each allocated object. * * @date 01-Jan-2006 */ static void measurementMgr_releaseModule (measurementMgr_t * pMeasurementMgr) { #ifdef XCC_MODULE_INCLUDED TI_UINT32 currAC; #endif if (pMeasurementMgr->hActivationDelayTimer) { tmr_DestroyTimer (pMeasurementMgr->hActivationDelayTimer); } #ifdef XCC_MODULE_INCLUDED for (currAC = 0; currAC < MAX_NUM_OF_AC; currAC++) { if (pMeasurementMgr->hTsMetricsReportTimer[currAC]) { tmr_DestroyTimer (pMeasurementMgr->hTsMetricsReportTimer[currAC]); } } #endif if (pMeasurementMgr->pMeasurementMgrSm) { fsm_Unload(pMeasurementMgr->hOs, pMeasurementMgr->pMeasurementMgrSm); } if (pMeasurementMgr->hRequestH) { requestHandler_destroy(pMeasurementMgr->hRequestH); } os_memoryFree(pMeasurementMgr->hOs, pMeasurementMgr, sizeof(measurementMgr_t)); }
TI_STATUS TrafficMonitor_Destroy(TI_HANDLE hTrafficMonitor) { TrafficMonitor_t *TrafficMonitor = (TrafficMonitor_t*)hTrafficMonitor; if (TrafficMonitor) { /*Unregister from the RX/TX module for the required notification*/ txCtrlParams_UnRegNotif(TrafficMonitor->hTxCtrl,TrafficMonitor->TxRegReqHandle); rxData_UnRegNotif(TrafficMonitor->hRxData,TrafficMonitor->RxRegReqHandle); if (TrafficMonitor->NotificationRegList) { List_Destroy(TrafficMonitor->NotificationRegList); } if (TrafficMonitor->hTrafficMonTimer) { tmr_DestroyTimer (TrafficMonitor->hTrafficMonTimer); } #ifdef TRAFF_TEST if (TestEventTimer) { tmr_DestroyTimer (TestEventTimer); } #endif os_memoryFree(TrafficMonitor->hOs, TrafficMonitor, sizeof(TrafficMonitor_t)); return TI_OK; } return TI_NOK; }
/** * \\n * \date 08-November-2005\n * \brief Destroys the measurement SRV object * * Function Scope \e Public.\n * \param hMeasurementSRV - handle to the measurement SRV object.\n */ void MacServices_measurementSRV_destroy( TI_HANDLE hMeasurementSRV ) { measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV; TI_INT32 i; /* sanity cehcking */ if ( NULL == hMeasurementSRV ) { return; } /* release state machine */ if ( NULL != pMeasurementSRV->SM ) { fsm_Unload( pMeasurementSRV->hOS, pMeasurementSRV->SM ); } /* release timers */ for ( i = 0; i < MAX_NUM_OF_MSR_TYPES_IN_PARALLEL; i++ ) { if (pMeasurementSRV->hRequestTimer[i]) { tmr_DestroyTimer (pMeasurementSRV->hRequestTimer[i]); } } if (pMeasurementSRV->hStartStopTimer) { tmr_DestroyTimer (pMeasurementSRV->hStartStopTimer); } /* release object space */ os_memoryFree( pMeasurementSRV->hOS, (TI_HANDLE)pMeasurementSRV, sizeof(measurementSRV_t)); }
/** * \fn txDataQ_Destroy * \brief Destroy the module and its queues * * Clear and destroy the queues and then destroy the module object. * * \note * \param hTxDataQ - The object * \return TI_OK - Unload succesfull, TI_NOK - Unload unsuccesfull * \sa */ TI_STATUS txDataQ_Destroy (TI_HANDLE hTxDataQ) { TTxDataQ *pTxDataQ = (TTxDataQ *)hTxDataQ; TI_STATUS status = TI_OK; TI_UINT32 uQueId; /* Free Data queues */ for (uQueId = 0 ; uQueId < pTxDataQ->uNumQueues ; uQueId++) { if (que_Destroy(pTxDataQ->aQueues[uQueId]) != TI_OK) { TRACE1(pTxDataQ->hReport, REPORT_SEVERITY_ERROR, "txDataQueue_unLoad: fail to free Data Queue number: %d\n",uQueId); status = TI_NOK; } } /* free timer */ if (pTxDataQ->hTxSendPaceTimer) { tmr_DestroyTimer (pTxDataQ->hTxSendPaceTimer); } /* Free Tx Data Queue Module */ os_memoryFree (pTxDataQ->hOs, pTxDataQ, sizeof(TTxDataQ)); return status; }
/** * * mainKeys_config * * \b Description: * * Init main security state machine state machine * * \b ARGS: * * none * * \b RETURNS: * * TI_OK on success, TI_NOK otherwise. * * \sa */ TI_STATUS mainKeys_unload(mainKeys_t *pMainKeys) { TI_STATUS status; if (pMainKeys == NULL) { return TI_NOK; } status = fsm_Unload(pMainKeys->hOs, pMainKeys->pMainKeysSm); if (pMainKeys->hSessionTimer) { tmr_DestroyTimer (pMainKeys->hSessionTimer); } pMainKeys->hSessionTimer = NULL; status = keyParser_unload(pMainKeys->pKeyParser); status = broadcastKey_unload(pMainKeys->pBcastSm); status = unicastKey_unload(pMainKeys->pUcastSm); os_memoryFree(pMainKeys->hOs, pMainKeys, sizeof(mainKeys_t)); return TI_OK; }
/** * \fn txDataQ_Destroy * \brief Destroy the module and its queues * * Clear and destroy the queues and then destroy the module object. * * \note * \param hTxDataQ - The object * \return TI_OK - Unload succesfull, TI_NOK - Unload unsuccesfull * \sa */ TI_STATUS txDataQ_Destroy (TI_HANDLE hTxDataQ) { TTxDataQ *pTxDataQ = (TTxDataQ *)hTxDataQ; TI_STATUS status = TI_OK; TI_UINT32 uQueId; TDataLinkQ *pLinkQ; TI_UINT32 uHlid; /* Dequeue and free all queued packets */ txDataQ_ClearQueues (hTxDataQ); /* * init all queues in all links */ for (uHlid = 0; uHlid < WLANLINKS_MAX_LINKS; uHlid++) { pLinkQ = &pTxDataQ->aDataLinkQ[uHlid]; /* Link queues */ /* Free Data queues */ for (uQueId = 0 ; uQueId < pTxDataQ->uNumQueues ; uQueId++) { if (que_Destroy(pLinkQ->aQueues[uQueId]) != TI_OK) { status = TI_NOK; } } } /* free timer */ if (pTxDataQ->hTxSendPaceTimer) { tmr_DestroyTimer (pTxDataQ->hTxSendPaceTimer); } /* Free Tx Data Queue Module */ os_memoryFree (pTxDataQ->hOs, pTxDataQ, sizeof(TTxDataQ)); return status; }
TI_STATUS pwrState_Destroy (TI_HANDLE hPwrState) { TPwrState *pPwrState = (TPwrState*) hPwrState; if (pPwrState->tCurrentTransition.hCompleteTimer) { tmr_DestroyTimer(pPwrState->tCurrentTransition.hCompleteTimer); } if (pPwrState->hDozeTimer) { tmr_DestroyTimer(pPwrState->hDozeTimer); } os_memoryFree(pPwrState->hOs, pPwrState, sizeof(TPwrState)); return TI_OK; }
static TI_HANDLE TrafficMonitor_ExitFunc(TrafficMonitor_t *TrafficMonitor,TI_HANDLE hOs) { if (TrafficMonitor) { if (TrafficMonitor->hTrafficMonTimer) { tmr_DestroyTimer (TrafficMonitor->hTrafficMonTimer); } os_memoryFree(hOs, TrafficMonitor, sizeof(TrafficMonitor_t)); } return NULL; }
/* * \brief Destroys the mailbox object * * \param hCmdMbox - The object to free * \return TI_OK * * \par Description * Calling this function destroys a CmdMbox object * * \sa cmdMbox_Create */ TI_STATUS cmdMbox_Destroy (TI_HANDLE hCmdMbox) { TCmdMbox *pCmdMbox = (TCmdMbox *)hCmdMbox; /* free timer */ if (pCmdMbox->hCmdMboxTimer) { tmr_DestroyTimer (pCmdMbox->hCmdMboxTimer); } /* free context */ os_memoryFree (pCmdMbox->hOs, pCmdMbox, sizeof (TCmdMbox)); return TI_OK; }
/** * * admCtrl_unload * * \b Description: * * Unload admission control module from memory * * \b ARGS: * * I - hAdmCtrl - Admossion control context \n * * \b RETURNS: * * TI_OK if successful, TI_NOK otherwise. * * \sa admCtrl_create */ TI_STATUS admCtrl_unload(admCtrl_t * pAdmCtrl) { if (pAdmCtrl == NULL) { return TI_NOK; } /* Destroy the wpa2 pre-authentication timer and free the module's memory */ if (pAdmCtrl->hPreAuthTimerWpa2) { tmr_DestroyTimer(pAdmCtrl->hPreAuthTimerWpa2); } os_memoryFree(pAdmCtrl->hOs, pAdmCtrl, sizeof(admCtrl_t)); return TI_OK; }
/** * * mainKeys_config * * \b Description: * * Init main security state machine state machine * * \b ARGS: * * none * * \b RETURNS: * * TI_OK on success, TI_NOK otherwise. * * \sa */ TI_STATUS mainKeys_unload(mainKeys_t *pMainKeys) { TI_STATUS status; if (pMainKeys == NULL) { return TI_NOK; } status = fsm_Unload(pMainKeys->hOs, pMainKeys->pMainKeysSm); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error releasing FSM memory \n"); } if (pMainKeys->hSessionTimer) { tmr_DestroyTimer (pMainKeys->hSessionTimer); } pMainKeys->hSessionTimer = NULL; status = keyParser_unload(pMainKeys->pKeyParser); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error unloading key parser\n"); } status = broadcastKey_unload(pMainKeys->pBcastSm); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error unloading broadcast key SM\n"); } status = unicastKey_unload(pMainKeys->pUcastSm); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pMainKeys->hReport, REPORT_SEVERITY_ERROR, "MAIN_KEYS_SM: Error unloading unicast key SM\n"); } os_memoryFree(pMainKeys->hOs, pMainKeys, sizeof(mainKeys_t)); return TI_OK; }
/** * * auth_unload - unload authentication SM from memory * * \b Description: * * Unload authentication SM from memory * * \b ARGS: * * I - hAuth - Authentication SM context \n * * \b RETURNS: * * TI_OK if successful, TI_NOK otherwise. * * \sa rsn_mainSecSmKeysOnlyStop() */ TI_STATUS auth_unload(TI_HANDLE hAuth) { TI_STATUS status; auth_t *pHandle; pHandle = (auth_t*)hAuth; status = fsm_Unload(pHandle->hOs, pHandle->pAuthSm); if (pHandle->hAuthSmTimer) { tmr_DestroyTimer (pHandle->hAuthSmTimer); } os_memoryFree(pHandle->hOs, pHandle, sizeof(auth_t)); return TI_OK; }
/** * \fn twIf_Destroy * \brief Destroy the module. * * Unregister from TxnQ and free the TxnDone-queue and the module's object. * * \note * \param The module's object * \return TI_OK on success or TI_NOK on failure * \sa twIf_Create */ TI_STATUS twIf_Destroy(TI_HANDLE hTwIf) { TTwIfObj *pTwIf = (TTwIfObj *) hTwIf; if (pTwIf) { txnQ_Close(pTwIf->hTxnQ, TXN_FUNC_ID_WLAN); if (pTwIf->hTxnDoneQueue) { que_Destroy(pTwIf->hTxnDoneQueue); } if (pTwIf->hPendRestartTimer) { tmr_DestroyTimer(pTwIf->hPendRestartTimer); } os_memoryFree(pTwIf->hOs, pTwIf, sizeof(TTwIfObj)); } return TI_OK; }
/** * * mlme_destroy - destrit MLME * * \b Description: * Unload MLME SM from memory * * \b ARGS: * I - hMlme - MLME SM context \n * * \b RETURNS: * TI_OK if successful, TI_NOK otherwise. * * \sa rsn_mainSecSmKeysOnlyStop() */ TI_STATUS mlme_destroy(TI_HANDLE hMlme) { mlme_t *pMlme; pMlme = (mlme_t*)hMlme; if (NULL != pMlme->hMlmeTimer) { tmr_DestroyTimer (pMlme->hMlmeTimer); } if (NULL != pMlme->hMlmeSm) { genSM_Unload (pMlme->hMlmeSm); } os_memoryFree(pMlme->hOs, hMlme, sizeof(mlme_t)); return TI_OK; }
/*********************************************************************** * healthMonitor_unload *********************************************************************** DESCRIPTION: INPUT: OUTPUT: RETURN: ************************************************************************/ TI_STATUS healthMonitor_unload (TI_HANDLE hHealthMonitor) { THealthMonitor *pHealthMonitor; pHealthMonitor = (THealthMonitor*)hHealthMonitor; if (pHealthMonitor != NULL) { if (NULL != pHealthMonitor->hFailTimer) { /* Release the timer */ tmr_DestroyTimer (pHealthMonitor->hFailTimer); } /* Freeing the object should be called last !!!!!!!!!!!! */ os_memoryFree (pHealthMonitor->hOs, pHealthMonitor, sizeof(THealthMonitor)); } return TI_OK; }
/*********************************************************************** * release_module *********************************************************************** DESCRIPTION: Release all module resources - FSMs, timer and object. INPUT: hConn - Connection handle. OUTPUT: RETURN: void ************************************************************************/ static void release_module(conn_t *pConn) { if (pConn->ibss_pFsm) { fsm_Unload (pConn->hOs, pConn->ibss_pFsm); } if (pConn->infra_pFsm) { fsm_Unload (pConn->hOs, pConn->infra_pFsm); } if (pConn->hConnTimer) { tmr_DestroyTimer (pConn->hConnTimer); } os_memoryFree(pConn->hOs, pConn, sizeof(conn_t)); }
/** * \fn RxQueue_Destroy() * \brief Destroy the module. * * Free the module's queues and object. * * \param hRxQueue - The module object * \return TI_OK on success or TI_NOK on failure * \sa RxQueue_Create */ TI_STATUS RxQueue_Destroy (TI_HANDLE hRxQueue) { TRxQueue *pRxQueue; if (hRxQueue) { pRxQueue = (TRxQueue *)hRxQueue; if (pRxQueue->hMissingPktTimer) { tmr_DestroyTimer (pRxQueue->hMissingPktTimer); pRxQueue->hMissingPktTimer = NULL; } /* free module object */ os_memoryFree (pRxQueue->hOs, pRxQueue, sizeof(TRxQueue)); return TI_OK; } return TI_NOK; }
/** * Releases the module's allocated objects according to the given init vector. * * @param pMeasurementMgr A handle to the Measurement Manager module. * @param initVec The init vector with a bit set for each allocated object. * * @date 01-Jan-2006 */ static void measurementMgr_releaseModule (measurementMgr_t * pMeasurementMgr) { if (pMeasurementMgr->hActivationDelayTimer) { tmr_DestroyTimer (pMeasurementMgr->hActivationDelayTimer); } if (pMeasurementMgr->pMeasurementMgrSm) { fsm_Unload(pMeasurementMgr->hOs, pMeasurementMgr->pMeasurementMgrSm); } if (pMeasurementMgr->hRequestH) { requestHandler_destroy(pMeasurementMgr->hRequestH); } os_memoryFree(pMeasurementMgr->hOs, pMeasurementMgr, sizeof(measurementMgr_t)); }
/** * * assocunload - unload association SM from memory * * \b Description: * * Unload association SM from memory * * \b ARGS: * * I - hAssoc - association SM context \n * * \b RETURNS: * * TI_OK if successful, TI_NOK otherwise. * * \sa rsn_mainSecSmKeysOnlyStop() */ TI_STATUS assoc_unload(TI_HANDLE hAssoc) { TI_STATUS status; assoc_t *pHandle; pHandle = (assoc_t*)hAssoc; status = fsm_Unload(pHandle->hOs, pHandle->pAssocSm); if (status != TI_OK) { /* report failure but don't stop... */ TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: Error releasing FSM memory \n"); } if (pHandle->hAssocSmTimer) { tmr_DestroyTimer (pHandle->hAssocSmTimer); } os_memoryFree(pHandle->hOs, hAssoc, sizeof(assoc_t)); return TI_OK; }