Changeset 41019


Ignore:
Timestamp:
2014-06-05T16:55:10+02:00 (4 years ago)
Author:
nbd
Message:

wpa_supplicant: fix locking hostapd to 20MHz (#12720)

Fixed wpa_supplicant when the radio is in 40MHz mode so that it no
longer restarts hostapd with the second channel disabled.

Signed-off-by: Lance Chaney <furryfur1@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/services/hostapd/patches/370-ap_sta_support.patch

    r40571 r41019  
    4646--- a/wpa_supplicant/wpa_supplicant.c 
    4747+++ b/wpa_supplicant/wpa_supplicant.c 
    48 @@ -104,6 +104,46 @@ const char *wpa_supplicant_full_license5 
     48@@ -104,6 +104,55 @@ const char *wpa_supplicant_full_license5 
    4949 "\n"; 
    5050 #endif /* CONFIG_NO_STDOUT_DEBUG */ 
     
    7070+       enum hostapd_hw_mode hw_mode; 
    7171+       u8 channel; 
     72+       int sec_chan = 0; 
    7273+       int ret; 
    7374+ 
     
    7576+               return; 
    7677+ 
     78+       if (bss->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) { 
     79+               int sec = bss->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK; 
     80+               if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE) 
     81+                       sec_chan = 1; 
     82+               else if (sec ==  HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW) 
     83+                       sec_chan = -1; 
     84+       } 
     85+ 
    7786+       hw_mode = ieee80211_freq_to_chan(bss->freq, &channel); 
    78 +       if (asprintf(&cmd, "UPDATE channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d", 
    79 +                    channel, hw_mode, !!bss->ht_capab) < 0) 
     87+       if (asprintf(&cmd, "UPDATE channel=%d sec_chan=%d hw_mode=%d ieee80211n=%d", 
     88+                    channel, sec_chan, hw_mode, !!bss->ht_capab) < 0) 
    8089+               return -1; 
    8190+ 
     
    93102 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) 
    94103 { 
    95 @@ -705,8 +745,12 @@ void wpa_supplicant_set_state(struct wpa 
     104@@ -705,8 +754,12 @@ void wpa_supplicant_set_state(struct wpa 
    96105 #endif /* CONFIG_P2P */ 
    97106  
     
    106115                wpa_drv_set_operstate(wpa_s, 0); 
    107116 #ifndef IEEE8021X_EAPOL 
    108 @@ -3516,6 +3560,20 @@ static int wpa_supplicant_init_iface(str 
     117@@ -3516,6 +3569,20 @@ static int wpa_supplicant_init_iface(str 
    109118                           sizeof(wpa_s->bridge_ifname)); 
    110119        } 
     
    127136        eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); 
    128137        eapol_sm_notify_portValid(wpa_s->eapol, FALSE); 
    129 @@ -3711,6 +3769,11 @@ static void wpa_supplicant_deinit_iface( 
     138@@ -3711,6 +3778,11 @@ static void wpa_supplicant_deinit_iface( 
    130139        if (terminate) 
    131140                wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); 
     
    149158 #include "wpa_supplicant_i.h" 
    150159 #include "config.h" 
    151 @@ -247,6 +248,9 @@ static void calculate_update_time(const  
     160@@ -247,6 +248,10 @@ static void calculate_update_time(const 
    152161 static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, 
    153162                             struct os_reltime *fetch_time) 
    154163 { 
    155164+       struct ieee80211_ht_capabilities *capab; 
     165+       struct ieee80211_ht_operation *oper; 
    156166+       struct ieee802_11_elems elems; 
    157167+ 
     
    159169        os_memcpy(dst->bssid, src->bssid, ETH_ALEN); 
    160170        dst->freq = src->freq; 
    161 @@ -257,6 +261,12 @@ static void wpa_bss_copy_res(struct wpa_ 
     171@@ -257,6 +262,15 @@ static void wpa_bss_copy_res(struct wpa_ 
    162172        dst->level = src->level; 
    163173        dst->tsf = src->tsf; 
     
    166176+       ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0); 
    167177+       capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities; 
     178+       oper = (struct ieee80211_ht_operation *) elems.ht_operation; 
    168179+       if (capab) 
    169180+               dst->ht_capab = le_to_host16(capab->ht_capabilities_info); 
     181+       if (oper) 
     182+               dst->ht_param = oper->ht_param; 
    170183+ 
    171184        calculate_update_time(fetch_time, src->age, &dst->last_update); 
     
    212225--- a/wpa_supplicant/bss.h 
    213226+++ b/wpa_supplicant/bss.h 
    214 @@ -70,6 +70,8 @@ struct wpa_bss { 
     227@@ -70,6 +70,10 @@ struct wpa_bss { 
    215228        u8 ssid[32]; 
    216229        /** Length of SSID */ 
     
    218231+       /** HT caapbilities */ 
    219232+       u16 ht_capab; 
     233+       /* Five octets of HT Operation Information */ 
     234+       u8 ht_param; 
    220235        /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */ 
    221236        int freq; 
Note: See TracChangeset for help on using the changeset viewer.