From: Jouni Malinen Date: Mon, 15 Feb 2021 16:24:37 +0000 (+0200) Subject: HE: Fall back to 20 MHz on 2.4 GHz if 40 MHz is not supported X-Git-Tag: hostap_2_10~566 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1c23d3f25f113e97a2c6fcab8021d438826d819;p=thirdparty%2Fhostap.git HE: Fall back to 20 MHz on 2.4 GHz if 40 MHz is not supported At least the ACS case of an attempt to pick a 40 MHz channel on the 2.4 GHz band could fail if HE was enabled and the driver did not include support for 40 MHz channel bandwidth on the 2.4 GHz band in HE capabilities. This resulted in "40 MHz channel width is not supported in 2.4 GHz" message when trying to configure the channel and failure to start the AP. Avoid this by automatically falling back to using 20 MHz bandwidth as part of channel parameter determination at the end of the ACS procedure. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 93d19e0ba..7849be181 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -349,6 +349,22 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface) } } +#ifdef CONFIG_IEEE80211AX + if (iface->conf->secondary_channel && + iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G && + iface->conf->ieee80211ax) { + struct he_capabilities *he_cap; + + he_cap = &iface->current_mode->he_capab[IEEE80211_MODE_AP]; + if (!(he_cap->phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & + HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G)) { + wpa_printf(MSG_DEBUG, + "HE: 40 MHz channel width is not supported in 2.4 GHz; clear secondary channel configuration"); + iface->conf->secondary_channel = 0; + } + } +#endif /* CONFIG_IEEE80211AX */ + if (iface->conf->secondary_channel) res = ieee80211n_allowed_ht40_channel_pair(iface); if (!res) {