/* * Detach net80211 state on device detach. Tear down * all vap's and reclaim all common state prior to the * device state going away. Note we may call back into * driver; it must be prepared for this. */ void ieee80211_ifdetach(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; if_detach(ifp); while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) ieee80211_vap_destroy(vap); ieee80211_waitfor_parent(ic); ieee80211_sysctl_detach(ic); ieee80211_dfs_detach(ic); ieee80211_regdomain_detach(ic); ieee80211_scan_detach(ic); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_superg_detach(ic); #endif ieee80211_ht_detach(ic); /* NB: must be called before ieee80211_node_detach */ ieee80211_proto_detach(ic); ieee80211_crypto_detach(ic); ieee80211_power_detach(ic); ieee80211_node_detach(ic); ifmedia_removeall(&ic->ic_media); taskqueue_free(ic->ic_tq); }
void ieee80211_ifdetach(struct ifnet *ifp) { struct ieee80211com *ic = (void *)ifp; ieee80211_proto_detach(ifp); ieee80211_crypto_detach(ifp); ieee80211_node_detach(ifp); LIST_REMOVE(ic, ic_list); ifmedia_delete_instance(&ic->ic_media, IFM_INST_ANY); ether_ifdetach(ifp); }
void ieee80211_ifdetach(struct ifnet *ifp) { struct ieee80211com *ic = (void *)ifp; ieee80211_proto_detach(ifp); ieee80211_crypto_detach(ifp); ieee80211_node_detach(ifp); #ifdef __FreeBSD__ ifmedia_removeall(&ic->ic_media); #else ifmedia_delete_instance(&ic->ic_media, IFM_INST_ANY); #endif #if NBPFILTER > 0 bpfdetach(ifp); #endif ether_ifdetach(ifp); }
/* * Detach net80211 state on device detach. Tear down * all vap's and reclaim all common state prior to the * device state going away. Note we may call back into * driver; it must be prepared for this. */ void ieee80211_ifdetach(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; /* * This detaches the main interface, but not the vaps. * Each VAP may be in a separate VIMAGE. */ CURVNET_SET(ifp->if_vnet); if_detach(ifp); CURVNET_RESTORE(); /* * The VAP is responsible for setting and clearing * the VIMAGE context. */ while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) ieee80211_vap_destroy(vap); ieee80211_waitfor_parent(ic); ieee80211_sysctl_detach(ic); ieee80211_dfs_detach(ic); ieee80211_regdomain_detach(ic); ieee80211_scan_detach(ic); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_superg_detach(ic); #endif ieee80211_ht_detach(ic); /* NB: must be called before ieee80211_node_detach */ ieee80211_proto_detach(ic); ieee80211_crypto_detach(ic); ieee80211_power_detach(ic); ieee80211_node_detach(ic); /* XXX VNET needed? */ ifmedia_removeall(&ic->ic_media); taskqueue_free(ic->ic_tq); IEEE80211_TX_LOCK_DESTROY(ic); IEEE80211_LOCK_DESTROY(ic); }
void ieee80211_ifdetach(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; ieee80211_remove_vap(ic); ieee80211_sysctl_detach(ic); ieee80211_proto_detach(ic); ieee80211_crypto_detach(ic); ieee80211_node_detach(ic); LIST_REMOVE(ic, ic_list); ifmedia_delete_instance(&ic->ic_media, IFM_INST_ANY); IEEE80211_BEACON_LOCK_DESTROY(ic); bpf_detach(ifp); ether_ifdetach(ifp); }
void ieee80211_ifdetach(struct ieee80211com *ic) { if (!ic->ic_initialized) { return; } /* * Preparation for detaching objects. * For example, remove and cross references between objects such as those * between ResMgr and Scanner. */ ieee80211_scan_detach_prepare(ic->ic_scanner); ieee80211_resmgr_delete_prepare(ic->ic_resmgr); OS_FREE_TIMER(&ic->ic_inact_timer); #if UMAC_SUPPORT_WNM OS_FREE_TIMER(&ic->ic_bssload_timer); #endif /* all the vaps should have been deleted now */ ASSERT(TAILQ_FIRST(&ic->ic_vaps) == NULL); ieee80211_scan_table_detach(&(ic->ic_scan_table)); ieee80211_node_detach(ic); ieee80211_quiet_detach(ic); ieee80211_admctl_detach(ic); if (IEEE80211_ENAB_AOW(ic)) ieee80211_aow_detach(ic); #if ATH_SUPPORT_DFS ieee80211_dfs_detach(ic); #endif /* ATH_SUPPORT_DFS */ ieee80211_proto_detach(ic); ieee80211_crypto_detach(ic); ieee80211_power_detach(ic); ieee80211_mlme_detach(ic); ieee80211_notify_tx_bcn_detach(ic->ic_notify_tx_bcn_mgr); ieee80211_resmgr_delete(ic->ic_resmgr); ieee80211_scan_detach(&(ic->ic_scanner)); ieee80211_p2p_detach(ic); ieee80211_acs_detach(&(ic->ic_acs)); ieee80211_rptplacement_detach(ic); IEEE80211_TDLS_DETACH(ic); #if UMAC_SUPPORT_VI_DBG ieee80211_vi_dbg_detach(ic); #endif ieee80211_smartantenna_detach(ic); ieee80211_prdperfstats_detach(ic); spin_lock_destroy(&ic->ic_lock); /* Detach TSF timer at the end to avoid assertion */ if (ic->ic_tsf_timer) { ieee80211_tsf_timer_detach(ic->ic_tsf_timer); ic->ic_tsf_timer = NULL; } spin_lock_destroy(&ic->ic_lock); IEEE80211_STATE_LOCK_DESTROY(ic); }