/* * This function unregisters the device and performs all the necessary * cleanups. * * The following cleanup operations are performed - * - Free the timers * - Free beacon buffers * - Free private structures * - Free adapter structure */ static int mwifiex_unregister(struct mwifiex_adapter *adapter) { s32 i; if (adapter->if_ops.cleanup_if) adapter->if_ops.cleanup_if(adapter); del_timer_sync(&adapter->cmd_timer); /* Free private structures */ for (i = 0; i < adapter->priv_num; i++) { if (adapter->priv[i]) { mwifiex_free_curr_bcn(adapter->priv[i]); kfree(adapter->priv[i]); } } if (adapter->nd_info) { for (i = 0 ; i < adapter->nd_info->n_matches ; i++) kfree(adapter->nd_info->matches[i]); kfree(adapter->nd_info); adapter->nd_info = NULL; } vfree(adapter->chan_stats); kfree(adapter); return 0; }
/* * This function unregisters the device and performs all the necessary * cleanups. * * The following cleanup operations are performed - * - Free the timers * - Free beacon buffers * - Free private structures * - Free adapter structure */ static int mwifiex_unregister(struct mwifiex_adapter *adapter) { s32 i; del_timer(&adapter->cmd_timer); /* Free private structures */ for (i = 0; i < adapter->priv_num; i++) { if (adapter->priv[i]) { mwifiex_free_curr_bcn(adapter->priv[i]); kfree(adapter->priv[i]); } } kfree(adapter); return 0; }
/* * This function frees the private structure, including cleans * up the TX and RX queues and frees the BSS priority tables. */ void mwifiex_free_priv(struct mwifiex_private *priv) { mwifiex_clean_txrx(priv); mwifiex_delete_bss_prio_tbl(priv); mwifiex_free_curr_bcn(priv); }