From 72a09d43fe70f75171ef67c976ad77ae010a56f4 Mon Sep 17 00:00:00 2001 From: Sathishkumar Muruganandam Date: Mon, 15 Oct 2018 20:37:49 +0530 Subject: [PATCH] Fix 5 GHz to 2.4 GHz channel switch with hostapd through DISABLE/ENABLE When moving a 5 GHz VHT AP to 2.4 GHz band with VHT disabled through the hostapd control interface DISABLE/reconfig/ENABLE commands, enabling of the AP on 2.4 GHz failed due to the previously configured VHT capability being compared with hardware VHT capability on 2.4 GHz band: hw vht capab: 0x0, conf vht capab: 0x33800132 Configured VHT capability [VHT_CAP_MAX_MPDU_LENGTH_MASK] exceeds max value supported by the driver (2 > 0) ap: interface state DISABLED->DISABLED Since VHT (ieee80211ac) config is already disabled for the 2.4 GHz band, add fix this by validating vht_capab only when VHT is enabled. Fixes: c781eb842852 ("hostapd: Verify VHT capabilities are supported by driver") Signed-off-by: Sathishkumar Muruganandam --- src/ap/hw_features.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 84e74eef0..5279abca1 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -679,7 +679,8 @@ int hostapd_check_ht_capab(struct hostapd_iface *iface) if (!ieee80211n_supported_ht_capab(iface)) return -1; #ifdef CONFIG_IEEE80211AC - if (!ieee80211ac_supported_vht_capab(iface)) + if (iface->conf->ieee80211ac && + !ieee80211ac_supported_vht_capab(iface)) return -1; #endif /* CONFIG_IEEE80211AC */ ret = ieee80211n_check_40mhz(iface);