]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Implement use of VHT20 config in mesh mode
authorPeter Oh <peter.oh@bowerswilkins.com>
Wed, 18 Apr 2018 21:14:19 +0000 (14:14 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 6 Jan 2019 21:49:40 +0000 (23:49 +0200)
Mesh in VHT mode is supposed to be able to use any bandwidth that VHT
supports, but there was no way to set VHT20 although there are
parameters that are supposed to be used. This commit along then previous
commit for VHT_CHANWIDTH_USE_HT makes mesh configuration available to
use any bandwidth with combinations of existing parameters like shown
below.

VHT80:
  default
  do not set any parameters
VHT40:
  max_oper_chwidth = 0
VHT20:
  max_oper_chwidth = 0
  disable_ht40 = 1
HT40:
  disable_vht = 1
HT20:
  disable_ht40 = 1
disable HT:
  disable_ht = 1

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
wpa_supplicant/wpa_supplicant.c

index feeafc62073addeb8c047e6d9c32332ec05efecb..1132df269b32d6f57fcf78214f2479fdf76bdc00 100644 (file)
@@ -2191,9 +2191,14 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
        if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
                return;
 
+       freq->channel = pri_chan->chan;
+
 #ifdef CONFIG_HT_OVERRIDES
-       if (ssid->disable_ht40)
-               return;
+       if (ssid->disable_ht40) {
+               if (ssid->disable_vht)
+                       return;
+               goto skip_ht40;
+       }
 #endif /* CONFIG_HT_OVERRIDES */
 
        /* Check/setup HT40+/HT40- */
@@ -2218,8 +2223,6 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
        if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
                return;
 
-       freq->channel = pri_chan->chan;
-
        if (ht40 == -1) {
                if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
                        return;
@@ -2263,6 +2266,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
                wpa_scan_results_free(scan_res);
        }
 
+#ifdef CONFIG_HT_OVERRIDES
+skip_ht40:
+#endif /* CONFIG_HT_OVERRIDES */
        wpa_printf(MSG_DEBUG,
                   "IBSS/mesh: setup freq channel %d, sec_channel_offset %d",
                   freq->channel, freq->sec_channel_offset);
@@ -2355,6 +2361,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
        } else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) {
                chwidth = VHT_CHANWIDTH_USE_HT;
                seg0 = vht80[j] + 2;
+#ifdef CONFIG_HT_OVERRIDES
+               if (ssid->disable_ht40)
+                       seg0 = 0;
+#endif /* CONFIG_HT_OVERRIDES */
        }
 
        if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq,