aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreeramya Soratkal <ssramya@codeaurora.org>2020-11-18 10:51:29 (GMT)
committerJouni Malinen <j@w1.fi>2020-11-23 18:45:31 (GMT)
commited24bad1d98d50f94e024f71093cdbd76cc0d872 (patch)
tree1e00f581e54b25658315ff7d667bf1e81f025f06
parent5b782ff620002c21f193034ab911e6524b31785a (diff)
downloadhostap-ed24bad1d98d50f94e024f71093cdbd76cc0d872.zip
hostap-ed24bad1d98d50f94e024f71093cdbd76cc0d872.tar.gz
hostap-ed24bad1d98d50f94e024f71093cdbd76cc0d872.tar.bz2
AP: Check driver support while auto-selecting bandwidth for AP/P2P GO
If the maximum operating channel width for AP/P2P GO is not specified, it is auto-selected during configuration. While selecting the channel width, if VHT is supported and 160 MHz channels are available, 160 MHz channel width is preferred to 80 MHz. During the selection of the channel width, the corresponding driver capabilities were not checked. As a result, the AP/P2P GO configuration was set to use the available 160 MHz channels even if the driver did not have capability to support the 160 MHz channel width causing failure to start the AP/P2P GO. Fix this by checking the driver support for the 160 MHz channel width while selecting the channel width for AP/P2P GO. Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
-rw-r--r--wpa_supplicant/ap.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index a4892e7..ac88a7d 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -44,6 +44,27 @@ static void wpas_wps_ap_pin_timeout(void *eloop_data, void *user_ctx);
#endif /* CONFIG_WPS */
+static bool is_chanwidth160_supported(struct hostapd_hw_modes *mode,
+ struct hostapd_config *conf)
+{
+#ifdef CONFIG_IEEE80211AX
+ if (conf->ieee80211ax) {
+ struct he_capabilities *he_cap;
+
+ he_cap = &mode->he_capab[IEEE80211_MODE_AP];
+ if (he_cap->phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] &
+ (HE_PHYCAP_CHANNEL_WIDTH_SET_80PLUS80MHZ_IN_5G |
+ HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G))
+ return true;
+ }
+#endif /* CONFIG_IEEE80211AX */
+ if (mode->vht_capab & (VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |
+ VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ))
+ return true;
+ return false;
+}
+
+
static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid,
struct hostapd_config *conf,
@@ -105,7 +126,7 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,
*/
hostapd_set_oper_chwidth(conf, CHANWIDTH_160MHZ);
center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel);
- if (center_chan) {
+ if (center_chan && is_chanwidth160_supported(mode, conf)) {
wpa_printf(MSG_DEBUG,
"VHT center channel %u for auto-selected 160 MHz bandwidth",
center_chan);