/** * \fn txMgmtQ_Destroy * \brief Destroy the module and its queues * * Clear and destroy the queues and then destroy the module object. * * \note * \param hTxMgmtQ - The module's object * \return TI_OK - Unload succesfull, TI_NOK - Unload unsuccesfull * \sa */ TI_STATUS txMgmtQ_Destroy (TI_HANDLE hTxMgmtQ) { TTxMgmtQ *pTxMgmtQ = (TTxMgmtQ *)hTxMgmtQ; TI_STATUS eStatus = TI_OK; int uQueId; TMgmtLinkQ *pLinkQ; TI_UINT32 uHlid; /* Dequeue and free all queued packets */ txMgmtQ_ClearQueues (hTxMgmtQ); /* * init all queues in all links */ for (uHlid = 0; uHlid < WLANLINKS_MAX_LINKS; uHlid++) { pLinkQ = &pTxMgmtQ->aMgmtLinkQ[uHlid]; /* Link queues */ for (uQueId = 0 ; uQueId < NUM_OF_MGMT_QUEUES ; uQueId++) { if (que_Destroy(pLinkQ->aQueues[uQueId]) != TI_OK) { TRACE2(pTxMgmtQ->hReport, REPORT_SEVERITY_ERROR, "txMgmtQueue_unLoad: fail to free Mgmt Queue number: %d in link %d\n",uQueId, uHlid); eStatus = TI_NOK; } } } /* free Tx Mgmt Queue Module */ os_memoryFree (pTxMgmtQ->hOs, pTxMgmtQ, sizeof(TTxMgmtQ)); return eStatus; }
/** * \fn txMgmtQ_Destroy * \brief Destroy the module and its queues * * Clear and destroy the queues and then destroy the module object. * * \note * \param hTxMgmtQ - The module's object * \return TI_OK - Unload succesfull, TI_NOK - Unload unsuccesfull * \sa */ TI_STATUS txMgmtQ_Destroy (TI_HANDLE hTxMgmtQ) { TTxMgmtQ *pTxMgmtQ = (TTxMgmtQ *)hTxMgmtQ; TI_STATUS eStatus = TI_OK; int uQueId; /* Dequeue and free all queued packets */ txMgmtQ_ClearQueues (hTxMgmtQ); /* free Mgmt queues */ for (uQueId = 0 ; uQueId < NUM_OF_MGMT_QUEUES ; uQueId++) { if (que_Destroy(pTxMgmtQ->aQueues[uQueId]) != TI_OK) { TRACE1(pTxMgmtQ->hReport, REPORT_SEVERITY_ERROR, "txMgmtQueue_unLoad: fail to free Mgmt Queue number: %d\n",uQueId); eStatus = TI_NOK; } } /* free Tx Mgmt Queue Module */ os_memoryFree (pTxMgmtQ->hOs, pTxMgmtQ, sizeof(TTxMgmtQ)); return eStatus; }