/** * \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; }
/** * \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; /* Dequeue and free all queued packets */ txDataQ_ClearQueues(hTxDataQ); /* 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; }