Пример #1
0
/*
 * External UMAC Interface
 */
wlan_if_t
wlan_vap_create(wlan_dev_t            devhandle,
                enum ieee80211_opmode opmode,
                int                   scan_priority_base,
                int                   flags,
                u_int8_t              *bssid,
                u_int8_t              *mataddr,
                int                     unit)
{
    struct ieee80211com *ic = devhandle;
    struct ieee80211vap *vap;

    IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD, IEEE80211_MSG_DEBUG,
                         "%s : enter. devhandle=0x%x, opmode=%s, flags=0x%x\n", 
             __func__, 
             devhandle,
             ieee80211_opmode2string(opmode),
             flags
             );

    vap = ic->ic_vap_create(ic, opmode, scan_priority_base, flags, bssid, mataddr,unit);
    if (vap == NULL) {
        printk("%s: failed to create a vap object\n", __func__);
        return NULL;
    }

    ieee80211_vap_pause_late_vattach(ic,vap); 
    ieee80211_resmgr_vattach(ic->ic_resmgr, vap);

    ieee80211_vap_deleted_clear(vap); /* clear the deleted */

    /* when all  done,  add vap to queue */
    IEEE80211_COMM_LOCK(ic);
    TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next);
    IEEE80211_COMM_UNLOCK(ic);

    IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD, IEEE80211_MSG_DEBUG,
             "%s : exit. devhandle=0x%x, opmode=%s, flags=0x%x.\n",
             __func__, 
             devhandle,
             ieee80211_opmode2string(opmode),
             flags
             );
#if ATH_SUPPORT_FLOWMAC_MODULE
    /* 
     * Due to platform dependency the flow control need to check the status
     * of the lmac layer before enabling the flow mac at vap layer.
     * 
     * Enabling of the flowmac happens after creating the wifi interface
     */
    vap->iv_flowmac = ic->ic_get_flowmac_enabled_State(ic);
#endif
    return vap;
}
Пример #2
0
/*
 * External UMAC Interface
 */
wlan_if_t
wlan_vap_create(wlan_dev_t            devhandle,
                enum ieee80211_opmode opmode,
                int                   scan_priority_base,
                int                   flags,
                u_int8_t              *bssid)
{
#if ATH_SUPPORT_FLOWMAC_MODULE
#define FLOWMAC_FLOWCONTROL_VAP 1
#define FLOWMAC_FLOWCONTROL_ETH 2
#endif
    struct ieee80211com *ic = devhandle;
    struct ieee80211vap *vap;

    IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD, IEEE80211_MSG_DEBUG,
                         "%s : enter. devhandle=0x%x, opmode=%s, flags=0x%x\n",
                         __func__,
                         devhandle,
                         ieee80211_opmode2string(opmode),
                         flags
                        );

    vap = ic->ic_vap_create(ic, opmode, scan_priority_base, flags, bssid);
    if (vap == NULL) {
        printk("%s: failed to create a vap object\n", __func__);
        return NULL;
    }

    ieee80211_vap_pause_late_vattach(ic,vap);
    ieee80211_resmgr_vattach(ic->ic_resmgr, vap);

    ieee80211_vap_deleted_clear(vap); /* clear the deleted */

    /* when all  done,  add vap to queue */
    IEEE80211_COMM_LOCK(ic);
    TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next);
    IEEE80211_COMM_UNLOCK(ic);

    IEEE80211_DPRINTF_IC(ic, IEEE80211_VERBOSE_LOUD, IEEE80211_MSG_DEBUG,
                         "%s : exit. devhandle=0x%x, opmode=%s, flags=0x%x.\n",
                         __func__,
                         devhandle,
                         ieee80211_opmode2string(opmode),
                         flags
                        );
    /* Begin: gengzj added for wifipos 2013-11-26 */
    /*AUTELAN-Added-begin:Added by pengdecai for wifi scan locate function*/
    vap->iv_locate = 0;
    vap->iv_sl_debug = 0;
    vap->iv_sl_asinfo = 0;
    vap->iv_sl_pckcnt = 0;
    /*AUTELAN-Added-end:Added by pengdecai for wifi scan locate function*/
    /* End: gengzj added end */
    /* TODO FIXME
    *  To check the ath layer flow control status in softc and the create
    *  enable or disable the flow control status in vap
    */
#if ATH_SUPPORT_FLOWMAC_MODULE
    vap->iv_flowmac = FLOWMAC_FLOWCONTROL_VAP | FLOWMAC_FLOWCONTROL_ETH;
#endif
    ieee80211_vap_cache_attach(vap); //added by duanmingzhe for 80211 cache

    /* Begin: Added by wangjia, for traffic limit. 2012-10-25. */
    ieee80211_tl_vap_init(vap);
    /* End: Added by wangjia, for traffic limit. 2012-10-25. */

    /*zhaoyang1 transplant from 717*/
    /*Begin:Added by duanmingzhe for user isolation*/
    vap->iv_switch = 0;
    /*End:Added by duanmingzhe for user isolation*/
    /*Begin:Add by duanmingzhe for develop the policy of mac binding*/
    vap->vap_dhcp_enable = 0;
    vap->vap_ip_auto_learning = 0;
    vap->vap_pppoe_enable = 0;
    /*End:Add by duanmingzhe for develop the policy of mac binding*/
    /*zhaoyang add for noisefloor switch when channel 0*/
    vap->noisefloor_enable = 1;
    /*zhaoyang add end*/
    /*zhaoyang modify for add rd_trap switch*/
#if ATH_SUPPORT_WAPI
    vap->rd_trap = 0;
#endif
    /*zhaoyang modify end*/
    /*suzhaoyu add for customer online-traffic limit*/
    vap->lowest_traffic_limit_switch = 0;
    vap->lowest_traffic_limit_threshold = 0;
    vap->lowest_traffic_limit_timelength =5;
    OS_INIT_TIMER(ic->ic_osdev, &(vap->online_traffic_timer), ieee80211_online_traffic_check, (void *) (vap));
    /*suzhaoyu addend*/
    /*zhaoyang1 transplant end*/
    /*<begin : transplant by caizhibang  from apv5*/
    /*yanggs add for thinap wds*/
    vap->vap_wds = 0;
    /*yanggs add end*/
    /*end : transplant by caizhibang from apv5 >*/
    /*zhaoyang modify for default disable UAPSD*/
    IEEE80211_VAP_UAPSD_DISABLE(vap);
    /*zhaoyang modify end*/
    return vap;
}