int wlan_vap_delete(wlan_if_t vaphandle) { struct ieee80211vap *vap = vaphandle; struct ieee80211com *ic = vap->iv_ic; IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD,IEEE80211_MSG_DEBUG, "%s : enter. vaphandle=0x%x\n", __func__, vaphandle ); ieee80211_vap_pause_vdetach(ic,vap); IEEE80211_COMM_LOCK(ic); #ifdef MAGPIE_HIF_GMAC if (ic->ic_chanchange_cnt) ic->ic_chanchange_cnt -= ic->ic_chanchange_tbtt; #endif if (ieee80211_vap_deleted_is_clear(vap)) /* if not deleted then it is on the list */ { TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); if (TAILQ_EMPTY(&ic->ic_vaps)) /* reset to supported mode */ ic->ic_opmode = IEEE80211_M_STA; ieee80211_vap_deleted_set(vap); /* mark it as deleted */ IEEE80211_COMM_UNLOCK(ic); /* * In case iv_bss was not stopped or is in scanning. * TBD: BSS should have been stopped now. We can save the time for stop bss again. */ wlan_mlme_stop_bss(vap, WLAN_MLME_STOP_BSS_F_SEND_DEAUTH | WLAN_MLME_STOP_BSS_F_CLEAR_ASSOC_STATE | WLAN_MLME_STOP_BSS_F_WAIT_RX_DONE | WLAN_MLME_STOP_BSS_F_NO_RESET); ieee80211_sta_leave(vap->iv_bss); ieee80211_node_vdetach(vap); } else { IEEE80211_COMM_UNLOCK(ic); } IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD,IEEE80211_MSG_DEBUG, "%s : exit. vaphandle=0x%x\n", __func__, vaphandle ); return 0; }
/* End: gengzj added end */ int wlan_vap_delete(wlan_if_t vaphandle) { struct ieee80211vap *vap = vaphandle; struct ieee80211com *ic = vap->iv_ic; IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD,IEEE80211_MSG_DEBUG, "%s : enter. vaphandle=0x%x\n", __func__, vaphandle ); ieee80211_vap_pause_vdetach(ic,vap); IEEE80211_COMM_LOCK(ic); /* Begin: gengzj added for wifipos 2013-11-26 */ /*AUTELAN-Added-begin:Added by pengdecai for wifi scan locate function*/ #if 0 if((NULL != vap->iv_scan_locate) && \ (NULL != vap->iv_scan_locate->sl_sock)) { // printk("driver:fun %s vap->iv_scan_locate->sl_sock= %p\n",__func__, vap->iv_scan_locate->sl_sock); vap->iv_locate = 0; if(NULL != vap->iv_scan_locate->sl_sock) { OS_SOCKET_RELEASE(vap->iv_scan_locate->sl_sock); } //free scan locate struct OS_FREE(vap->iv_scan_locate); vap->iv_scan_locate = NULL; } #endif /*AUTELAN-Added-end:Added by pengdecai for wifi scan locate function*/ /* End: gengzj added end */ #ifdef MAGPIE_HIF_GMAC if (ic->ic_chanchange_cnt) ic->ic_chanchange_cnt -= ic->ic_chanchange_tbtt; #endif if (ieee80211_vap_deleted_is_clear(vap)) /* if not deleted then it is on the list */ { TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); if (TAILQ_EMPTY(&ic->ic_vaps)) /* reset to supported mode */ ic->ic_opmode = IEEE80211_M_STA; ieee80211_vap_deleted_set(vap); /* mark it as deleted */ IEEE80211_COMM_UNLOCK(ic); /* * In case iv_bss was not stopped or is in scanning. * TBD: BSS should have been stopped now. We can save the time for stop bss again. */ wlan_mlme_stop_bss(vap, WLAN_MLME_STOP_BSS_F_SEND_DEAUTH | WLAN_MLME_STOP_BSS_F_CLEAR_ASSOC_STATE | WLAN_MLME_STOP_BSS_F_WAIT_RX_DONE | WLAN_MLME_STOP_BSS_F_NO_RESET); /*zhaoyang1 transplant from 717*/ /*suzhaoyu add for customer online-traffic limit*/ OS_FREE_TIMER(&vap->online_traffic_timer); /*suzhaoyu addend*/ /*zhaoyang1 transplant end*/ ieee80211_sta_leave(vap->iv_bss); ieee80211_node_vdetach(vap); } else { IEEE80211_COMM_UNLOCK(ic); } IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD,IEEE80211_MSG_DEBUG, "%s : exit. vaphandle=0x%x\n", __func__, vaphandle ); return 0; }