Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #651: iwconfig_ap.patch

File iwconfig_ap.patch, 1.6 kB (added by eaton.lists@gmail.com, 13 years ago)

patch for handling of "iwconfig ath0 ap any" and "iwconfig ath0 ap off"

  • net80211/ieee80211_wireless.c

    old new  
    487487        struct sockaddr *ap_addr, char *extra) 
    488488{ 
    489489        static const u_int8_t zero_bssid[IEEE80211_ADDR_LEN]; 
     490        static const u_int8_t broadcast_bssid[IEEE80211_ADDR_LEN] =  
     491                "\xff\xff\xff\xff\xff\xff"; 
    490492        struct ieee80211vap *vap = dev->priv; 
    491493 
    492494        /* NB: should not be set when in AP mode */ 
    493495        if (vap->iv_opmode == IEEE80211_M_HOSTAP) 
    494496                return -EINVAL; 
    495         IEEE80211_ADDR_COPY(vap->iv_des_bssid, &ap_addr->sa_data); 
    496         /* looks like a zero address disables */ 
    497         if (IEEE80211_ADDR_EQ(vap->iv_des_bssid, zero_bssid)) 
     497 
     498        /*  
     499         * zero address corresponds to 'iwconfig ath0 ap off', which means  
     500         * enable automatic choice of AP without actually forcing a 
     501         * reassociation.   
     502         * 
     503         * broadcast address corresponds to 'iwconfig ath0 ap any', which 
     504         * means scan for the current best AP. 
     505         * 
     506         * anything else specifies a particular AP. 
     507         */ 
     508        if (IEEE80211_ADDR_EQ(vap->iv_des_bssid, zero_bssid))  
    498509                vap->iv_flags &= ~IEEE80211_F_DESBSSID; 
    499         else 
    500                 vap->iv_flags |= IEEE80211_F_DESBSSID; 
    501         if (IS_UP_AUTO(vap)) 
    502                 ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); 
     510        else { 
     511                IEEE80211_ADDR_COPY(vap->iv_des_bssid, &ap_addr->sa_data); 
     512                if (IEEE80211_ADDR_EQ(vap->iv_des_bssid, broadcast_bssid)) 
     513                        vap->iv_flags &= ~IEEE80211_F_DESBSSID; 
     514                else  
     515                        vap->iv_flags |= IEEE80211_F_DESBSSID; 
     516                if (IS_UP_AUTO(vap)) 
     517                        ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); 
     518        } 
    503519        return 0; 
    504520}