]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Add VHT_CHANWIDTH_USE_HT to max_oper_chwidth
authorPeter Oh <peter.oh@bowerswilkins.com>
Wed, 18 Apr 2018 21:14:18 +0000 (14:14 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 6 Jan 2019 21:43:40 +0000 (23:43 +0200)
Channel width in VHT mode refers HT capability when the width goes down
to below 80 MHz, hence add checking HT channel width to its max
operation channel width. So that mesh has capability to select bandwidth
below 80 MHz.

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/mesh.c
wpa_supplicant/wpa_supplicant.c

index 7a95ea49e7e08446d6ed369affb0c5dd9742047d..bfca69ff7e482a50b93239a661ad69f872064bba 100644 (file)
@@ -2903,6 +2903,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid)
        ssid->mka_priority = DEFAULT_PRIO_NOT_KEY_SERVER;
 #endif /* CONFIG_MACSEC */
        ssid->mac_addr = -1;
+       ssid->max_oper_chwidth = DEFAULT_MAX_OPER_CHWIDTH;
 }
 
 
index 98aae87406577ae06aa9fd92ea28f3b12d38daf0..73fcf2c5acdcad4d57ebb2d48a19f46277073190 100644 (file)
@@ -838,7 +838,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
        INT(vht);
        INT_DEF(ht, 1);
        INT(ht40);
-       INT(max_oper_chwidth);
+       INT_DEF(max_oper_chwidth, DEFAULT_MAX_OPER_CHWIDTH);
        INT(vht_center_freq1);
        INT(vht_center_freq2);
        INT(pbss);
index 6cf655785625a2257d31efbe692a5bd7fbf05658..9abecc0ad0b154a9b95b34622f07a9fc546725d4 100644 (file)
@@ -39,6 +39,7 @@
 #define DEFAULT_AMPDU_FACTOR -1 /* no change */
 #define DEFAULT_AMPDU_DENSITY -1 /* no change */
 #define DEFAULT_USER_SELECTED_SIM 1
+#define DEFAULT_MAX_OPER_CHWIDTH -1
 
 struct psk_list_entry {
        struct dl_list list;
index f2f09614d88fe915b5f44df76f9b023e22d51774..dd6aad6f0c1789f883419c7b5096221ec1c02e0a 100644 (file)
@@ -332,7 +332,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
        if (ssid->ht40)
                conf->secondary_channel = ssid->ht40;
        if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) {
-               conf->vht_oper_chwidth = ssid->max_oper_chwidth;
+               if (ssid->max_oper_chwidth != DEFAULT_MAX_OPER_CHWIDTH)
+                       conf->vht_oper_chwidth = ssid->max_oper_chwidth;
                switch (conf->vht_oper_chwidth) {
                case VHT_CHANWIDTH_80MHZ:
                case VHT_CHANWIDTH_80P80MHZ:
index 9ca2c6b7b89983173b854c717a924e3e94cdfe94..feeafc62073addeb8c047e6d9c32332ec05efecb 100644 (file)
@@ -2352,6 +2352,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
                        vht_caps |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
                        seg0 = 114;
                }
+       } else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) {
+               chwidth = VHT_CHANWIDTH_USE_HT;
+               seg0 = vht80[j] + 2;
        }
 
        if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq,