示例#1
0
void ieee80211_prdperfstats_detach(struct ieee80211com *ic)
{
    /* Shut down all measurements, timers, etc */

    IEEE80211_PRDPERFSTATS_THRPUT_LOCK(ic);
    if (ic->ic_thrput.is_enab) {
        ieee80211_prdperfstat_thrput_disable(ic);
    }
    IEEE80211_PRDPERFSTATS_THRPUT_UNLOCK(ic);

    IEEE80211_PRDPERFSTATS_PER_LOCK(ic);
    if (ic->ic_per.is_enab) {
        ieee80211_prdperfstat_per_disable(ic);
    }
    IEEE80211_PRDPERFSTATS_PER_UNLOCK(ic);

    IEEE80211_PRDPERFSTATS_LOCK(ic);
    ieee80211_prdperfstats_signal(ic);
    IEEE80211_PRDPERFSTATS_UNLOCK(ic);

    ieee80211_prdperfstat_thrput_detach(ic);
    ieee80211_prdperfstat_per_detach(ic);
    
    OS_FREE_TIMER(&ic->ic_prdperfstats_timer);

    IEEE80211_PRDPERFSTATS_LOCK_DESTROY(ic);
}
示例#2
0
/*
 * Delete Resource manager.
 */
void ieee80211_resmgr_delete(ieee80211_resmgr_t resmgr)
{
    struct ieee80211com    *ic;
    
    if (!resmgr)
        return ;

    ic = resmgr->ic;

    /* No vaps should exist at this time */
    ASSERT(TAILQ_FIRST(&ic->ic_vaps) == NULL);

    OS_CANCEL_TIMER(&(resmgr->scandata.canpause_timer));
    OS_FREE_TIMER(&(resmgr->scandata.canpause_timer));
    IEEE80211_RESMGR_LOCK_DESTROY(resmgr);

    /* Stop and delete the Off-Channel Scheduler */
    if (ic->ic_caps_ext & IEEE80211_CEXT_MULTICHAN) {
        ieee80211_resmgr_oc_scheduler_delete(resmgr);
    }
    
    /* Stop and delete state machine */
    ieee80211_resmgr_sm_delete(resmgr);

    /* Free ResMgr data structures */
    OS_FREE(resmgr);
    ic->ic_resmgr = NULL;
}
示例#3
0
void ieee80211_pwrsave_smps_detach(ieee80211_pwrsave_smps_t smps)
{
    ieee80211_vap_txrx_unregister_event_handler(smps->ips_vap,ieee80211_pwrsave_smps_txrx_event_handler,smps);
    ieee80211_vap_unregister_event_handler(smps->ips_vap,ieee80211_pwrsave_smps_vap_event_handler,(void *)smps );
    OS_FREE_TIMER(&smps->ips_timer);
    OS_FREE(smps);
}
示例#4
0
void wlan_btamp_conn_sm_delete(wlan_btamp_conn_sm_t handle)
{
    wlan_btamp_conn_sm_t     smhandle = (wlan_btamp_conn_sm_t)handle;
    struct ieee80211vap      *vap = NULL;
    struct ieee80211_node    *ni = NULL;

    if (!smhandle)
        return;

    vap = smhandle->vap_handle;

    if (smhandle->is_running) {
        IEEE80211_DPRINTF(smhandle->vap_handle, IEEE80211_MSG_STATE,
                          "%s: Deleting state machine while it is still runing \n", __func__); 
    }
    ASSERT(! smhandle->is_running);
    
    OS_CANCEL_TIMER(&(smhandle->sm_timer));
    OS_FREE_TIMER(&(smhandle->sm_timer));

    ieee80211_sm_delete(smhandle->hsm_handle);

    /* Delete node for the peer mac address */
    ni = ieee80211_vap_find_node(vap, smhandle->peer);
    if (ni) {
        IEEE80211_NODE_LEAVE(ni);
        ieee80211_free_node(ni); /* Decrement the extra ref count from find */
    }

    OS_FREE(smhandle);
}
示例#5
0
int ieee80211_mlme_vdetach(struct ieee80211vap *vap)
{
    ieee80211_mlme_priv_t    mlme_priv = vap->iv_mlme_priv;
    int                      ftype;

    if (mlme_priv == NULL) {
        ASSERT(mlme_priv);
        return -1; /* already detached ? */
    }

    OS_CANCEL_TIMER(&mlme_priv->im_timeout_timer);
    OS_FREE_TIMER(&mlme_priv->im_timeout_timer);
	
    switch(vap->iv_opmode) {
    case IEEE80211_M_IBSS:
        mlme_adhoc_vdetach(vap);
        break;
    case IEEE80211_M_STA:
        mlme_sta_vdetach(vap);
        break;
    default:
        break;
    } 
    OS_FREE(mlme_priv);
    vap->iv_mlme_priv = NULL;

    /* Free app ie buffers */
    for (ftype = 0; ftype < IEEE80211_FRAME_TYPE_MAX; ftype++) {
        if (vap->iv_app_ie[ftype].ie) {
            OS_FREE(vap->iv_app_ie[ftype].ie);
            vap->iv_app_ie[ftype].ie = NULL;
            vap->iv_app_ie[ftype].length = 0;
        }
    }
    /* Make sure we have release all the App IE */
    for (ftype = 0; ftype < IEEE80211_FRAME_TYPE_MAX; ftype++) {
        ASSERT(LIST_EMPTY(&vap->iv_app_ie_list[ftype]));
    }

    /* Free opt ie buffer */
    if (vap->iv_opt_ie.ie) {
        OS_FREE(vap->iv_opt_ie.ie);
        vap->iv_opt_ie.ie = NULL;
        vap->iv_opt_ie.length = 0;
    }

    if (vap->iv_beacon_copy_buf) {
        void *pTmp = vap->iv_beacon_copy_buf;
        vap->iv_beacon_copy_buf = NULL;
        vap->iv_beacon_copy_len = 0;
        OS_FREE(pTmp);
    }

    return 0;
}
示例#6
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;
}
示例#7
0
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);
}