[1/2] mesh: add VHT_CHANWIDTH_USE_HT to max_oper_chwidth

Message ID 0f442bfcb594ff604820caa299ab7d10238bee95.1524081526.git.peter.oh@bowerswilkins.com
State New
Headers show
Series
  • mesh-add-supports-mesh-configurable-bandwidth
Related show

Commit Message

Peter Oh April 18, 2018, 9:14 p.m.
From: Peter Oh <peter.oh@bowerswilkins.com>

Channel width in VHT mode refers HT capability when
the width goes down to below 80MHz, hence add checking
HT channel width to its max operation channel width.
So that mesh has capable to select bandwidth below 80Mhz.

Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
---
 wpa_supplicant/config.c         | 1 +
 wpa_supplicant/config_ssid.h    | 1 +
 wpa_supplicant/wpa_supplicant.c | 3 +++
 3 files changed, 5 insertions(+)

Patch

diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index f65bbb02f..7e8f014cc 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2798,6 +2798,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 = (u8)DEFAULT_MAX_OPER_CHWIDTH;
 }
 
 
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index 9fd56c32f..2ddb777b2 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -37,6 +37,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;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 7e7e84afb..c2253a047 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2293,6 +2293,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,