VOID RTMPFreeAdapter( IN VOID *pAdSrc) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; POS_COOKIE os_cookie; int index; os_cookie=(POS_COOKIE)pAd->OS_Cookie; if (pAd->BeaconBuf) os_free_mem(NULL, pAd->BeaconBuf); NdisFreeSpinLock(&pAd->MgmtRingLock); #ifdef RTMP_MAC_PCI NdisFreeSpinLock(&pAd->RxRingLock); #if defined(RT3090) || defined(RT3592) || defined(RT3390) || defined(RT3593) NdisFreeSpinLock(&pAd->McuCmdLock); #endif /* defined(RT3090) || defined(RT3592) || defined(RT3390) || defined(RT3593) */ #endif /* RTMP_MAC_PCI */ #ifdef RT3290 NdisFreeSpinLock(&pAd->WlanEnLock); #endif /* RT3290 */ for (index =0 ; index < NUM_OF_TX_RING; index++) { NdisFreeSpinLock(&pAd->TxSwQueueLock[index]); NdisFreeSpinLock(&pAd->DeQueueLock[index]); pAd->DeQueueRunning[index] = FALSE; } NdisFreeSpinLock(&pAd->irq_lock); #ifdef RTMP_MAC_PCI NdisFreeSpinLock(&pAd->LockInterrupt); #endif /* RTMP_MAC_PCI */ #ifdef SPECIFIC_BCN_BUF_SUPPORT NdisFreeSpinLock(&pAd->ShrMemLock); #endif /* SPECIFIC_BCN_BUF_SUPPORT */ #ifdef DOT11_N_SUPPORT NdisFreeSpinLock(&pAd->mpdu_blk_pool.lock); #endif /* DOT11_N_SUPPORT */ if (pAd->iw_stats) { os_free_mem(NULL, pAd->iw_stats); pAd->iw_stats = NULL; } if (pAd->stats) { os_free_mem(NULL, pAd->stats); pAd->stats = NULL; } NdisFreeSpinLock(&TimerSemLock); RTMP_OS_FREE_TIMER(pAd); RTMP_OS_FREE_LOCK(pAd); RTMP_OS_FREE_TASKLET(pAd); RTMP_OS_FREE_TASK(pAd); RTMP_OS_FREE_SEM(pAd); RTMP_OS_FREE_ATOMIC(pAd); RtmpOsVfree(pAd); /* pci_free_consistent(os_cookie->pci_dev,sizeof(RTMP_ADAPTER),pAd,os_cookie->pAd_pa); */ if (os_cookie) os_free_mem(NULL, os_cookie); }
VOID RTMPFreeAdapter( IN VOID *pAdSrc) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; POS_COOKIE os_cookie; int index; os_cookie=(POS_COOKIE)pAd->OS_Cookie; if (pAd->BeaconBuf) os_free_mem(NULL, pAd->BeaconBuf); #ifdef RTMP_FLASH_SUPPORT if (pAd->eebuf && (pAd->eebuf != pAd->chipCap.eebuf)) { os_free_mem(NULL, pAd->eebuf); pAd->eebuf = NULL; } #endif /* RTMP_FLASH_SUPPORT */ NdisFreeSpinLock(&pAd->MgmtRingLock); #ifdef RT3290 NdisFreeSpinLock(&pAd->WlanEnLock); #endif /* RT3290 */ for (index =0 ; index < NUM_OF_TX_RING; index++) { NdisFreeSpinLock(&pAd->TxSwQueueLock[index]); NdisFreeSpinLock(&pAd->DeQueueLock[index]); pAd->DeQueueRunning[index] = FALSE; } NdisFreeSpinLock(&pAd->irq_lock); #ifdef UAPSD_SUPPORT NdisFreeSpinLock(&pAd->UAPSDEOSPLock); /* OS_ABL_SUPPORT */ #endif /* UAPSD_SUPPORT */ #ifdef DOT11_N_SUPPORT NdisFreeSpinLock(&pAd->mpdu_blk_pool.lock); #endif /* DOT11_N_SUPPORT */ if (pAd->iw_stats) { os_free_mem(NULL, pAd->iw_stats); pAd->iw_stats = NULL; } if (pAd->stats) { os_free_mem(NULL, pAd->stats); pAd->stats = NULL; } NdisFreeSpinLock(&TimerSemLock); RTMP_OS_FREE_TIMER(pAd); RTMP_OS_FREE_LOCK(pAd); RTMP_OS_FREE_TASKLET(pAd); RTMP_OS_FREE_TASK(pAd); RTMP_OS_FREE_SEM(pAd); RTMP_OS_FREE_ATOMIC(pAd); RtmpOsVfree(pAd); /* pci_free_consistent(os_cookie->pci_dev,sizeof(RTMP_ADAPTER),pAd,os_cookie->pAd_pa); */ if (os_cookie) os_free_mem(NULL, os_cookie); }
VOID RTMPFreeAdapter( IN VOID *pAdSrc) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; POS_COOKIE os_cookie; int index; os_cookie=(POS_COOKIE)pAd->OS_Cookie; if (pAd->BeaconBuf) os_free_mem(NULL, pAd->BeaconBuf); NdisFreeSpinLock(&pAd->MgmtRingLock); #ifdef RTMP_MAC_PCI NdisFreeSpinLock(&pAd->RxRingLock); #if defined(RT3090) || defined(RT3592) || defined(RT3390) || defined(RT3593) NdisFreeSpinLock(&pAd->McuCmdLock); #endif /* defined(RT3090) || defined(RT3592) || defined(RT3390) || defined(RT3593) */ #endif /* RTMP_MAC_PCI */ for (index =0 ; index < NUM_OF_TX_RING; index++) { NdisFreeSpinLock(&pAd->TxSwQueueLock[index]); NdisFreeSpinLock(&pAd->DeQueueLock[index]); pAd->DeQueueRunning[index] = FALSE; } NdisFreeSpinLock(&pAd->irq_lock); #ifdef DOT11_N_SUPPORT NdisFreeSpinLock(&pAd->mpdu_blk_pool.lock); #endif /* DOT11_N_SUPPORT */ if (pAd->iw_stats) { os_free_mem(NULL, pAd->iw_stats); pAd->iw_stats = NULL; } if (pAd->stats) { os_free_mem(NULL, pAd->stats); pAd->stats = NULL; } NdisFreeSpinLock(&TimerSemLock); RTMP_OS_FREE_TIMER(pAd); RTMP_OS_FREE_LOCK(pAd); RTMP_OS_FREE_TASKLET(pAd); RTMP_OS_FREE_TASK(pAd); RTMP_OS_FREE_SEM(pAd); RTMP_OS_FREE_ATOMIC(pAd); RtmpOsVfree(pAd); /* pci_free_consistent(os_cookie->pci_dev,sizeof(RTMP_ADAPTER),pAd,os_cookie->pAd_pa); */ if (os_cookie) os_free_mem(NULL, os_cookie); #ifdef VENDOR_FEATURE4_SUPPORT { extern ULONG OS_NumOfMemAlloc, OS_NumOfMemFree; printk("OS_NumOfMemAlloc = %ld, OS_NumOfMemFree = %ld\n", OS_NumOfMemAlloc, OS_NumOfMemFree); } #endif /* VENDOR_FEATURE4_SUPPORT */ }
void RTMPFreeAdapter( void *pAdSrc) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; POS_COOKIE os_cookie; int index; os_cookie=(POS_COOKIE)pAd->OS_Cookie; if (pAd->BeaconBuf) os_free_mem(NULL, pAd->BeaconBuf); NdisFreeSpinLock(&pAd->MgmtRingLock); #if defined(RT3290) || defined(RT65xx) #endif /* defined(RT3290) || defined(RT65xx) */ for (index =0 ; index < NUM_OF_TX_RING; index++) { NdisFreeSpinLock(&pAd->TxSwQueueLock[index]); NdisFreeSpinLock(&pAd->DeQueueLock[index]); pAd->DeQueueRunning[index] = FALSE; } NdisFreeSpinLock(&pAd->irq_lock); #ifdef UAPSD_SUPPORT NdisFreeSpinLock(&pAd->UAPSDEOSPLock); /* OS_ABL_SUPPORT */ #endif /* UAPSD_SUPPORT */ #ifdef DOT11_N_SUPPORT NdisFreeSpinLock(&pAd->mpdu_blk_pool.lock); #endif /* DOT11_N_SUPPORT */ if (pAd->iw_stats) { os_free_mem(NULL, pAd->iw_stats); pAd->iw_stats = NULL; } if (pAd->stats) { os_free_mem(NULL, pAd->stats); pAd->stats = NULL; } NdisFreeSpinLock(&TimerSemLock); #ifdef RALINK_ATE #ifdef RTMP_MAC_USB RTMP_OS_ATMOIC_DESTROY(&pAd->BulkOutRemained); RTMP_OS_ATMOIC_DESTROY(&pAd->BulkInRemained); #endif /* RTMP_MAC_USB */ #endif /* RALINK_ATE */ RTMP_OS_FREE_TIMER(pAd); RTMP_OS_FREE_LOCK(pAd); RTMP_OS_FREE_TASKLET(pAd); RTMP_OS_FREE_TASK(pAd); RTMP_OS_FREE_SEM(pAd); RTMP_OS_FREE_ATOMIC(pAd); RtmpOsVfree(pAd); /* pci_free_consistent(os_cookie->pci_dev,sizeof(RTMP_ADAPTER),pAd,os_cookie->pAd_pa); */ if (os_cookie) os_free_mem(NULL, os_cookie); }