From 621745917f66932210e878dc674635800e47d680 Mon Sep 17 00:00:00 2001 From: Muna Sinada Date: Mon, 18 May 2020 06:57:16 -0700 Subject: [PATCH] Allow HE-without-VHT to add the Channel Switch Wrapper element Modify the check for VHT to include an option for HE in hostapd_eid_wb_chsw_wrapper() and its callers to allow the Channel Switch Wrapper element with the Wide Bandwidth Channel Switch subelement to be included in Beacon and Probe Response frames when AP is operating in HE mode without VHT. Signed-off-by: Muna Sinada --- src/ap/beacon.c | 10 ++++++++-- src/ap/ieee802_11.c | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 22e672c8d..b3b33b7fa 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -560,10 +560,13 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_vht_capabilities(hapd, pos, 0); pos = hostapd_eid_vht_operation(hapd, pos); pos = hostapd_eid_txpower_envelope(hapd, pos); - pos = hostapd_eid_wb_chsw_wrapper(hapd, pos); } #endif /* CONFIG_IEEE80211AC */ + if ((hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) || + hapd->iconf->ieee80211ax) + pos = hostapd_eid_wb_chsw_wrapper(hapd, pos); + pos = hostapd_eid_fils_indic(hapd, pos, 0); pos = hostapd_get_rsnxe(hapd, pos, epos - pos); @@ -1281,10 +1284,13 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, tailpos = hostapd_eid_vht_capabilities(hapd, tailpos, 0); tailpos = hostapd_eid_vht_operation(hapd, tailpos); tailpos = hostapd_eid_txpower_envelope(hapd, tailpos); - tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos); } #endif /* CONFIG_IEEE80211AC */ + if ((hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) || + hapd->iconf->ieee80211ax) + tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos); + tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0); tailpos = hostapd_get_rsnxe(hapd, tailpos, tailend - tailpos); diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 917670084..b91640070 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -5570,7 +5570,8 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid) int freq1; if (!hapd->cs_freq_params.channel || - !hapd->cs_freq_params.vht_enabled) + (!hapd->cs_freq_params.vht_enabled && + !hapd->cs_freq_params.he_enabled)) return eid; /* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */