From 122cdd59258e208f334aa3ada20643cf78c0b057 Mon Sep 17 00:00:00 2001 From: Manaswini Paluri Date: Wed, 6 Jul 2022 19:27:59 +0530 Subject: [PATCH] Enable TWT responder AP role only if IEEE 802.11ax/HE is enabled Set TWT responder configurator in the driver parameters only when the AP is configured with HE enabled. This was already done for the extended capability bit generation in commit 8de0ff0fa1de ("HE: Add TWT responder extended capabilities field"), but this parameter for the driver command to start the AP in _ieee802_11_set_beacon() missed the condition. Move the ieee80211ax check into the common helper function to cover both cases. In addition, add a check for disable_11ax to cover the case where HE is disabled for a specific BSS. Fixes: ab8c55358e10 ("HE: Dynamically turn on TWT responder support") Signed-off-by: Jouni Malinen --- src/ap/ieee802_11_he.c | 3 ++- src/ap/ieee802_11_shared.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index b5b7e5d46..12273c34c 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -533,7 +533,8 @@ int hostapd_get_he_twt_responder(struct hostapd_data *hapd, u8 *mac_cap; if (!hapd->iface->current_mode || - !hapd->iface->current_mode->he_capab[mode].he_supported) + !hapd->iface->current_mode->he_capab[mode].he_supported || + !hapd->iconf->ieee80211ax || hapd->conf->disable_11ax) return 0; mac_cap = hapd->iface->current_mode->he_capab[mode].mac_cap; diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c index d962cc0d5..eaeaec5d7 100644 --- a/src/ap/ieee802_11_shared.c +++ b/src/ap/ieee802_11_shared.c @@ -413,8 +413,7 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx) *pos |= 0x01; #endif /* CONFIG_FILS */ #ifdef CONFIG_IEEE80211AX - if (hapd->iconf->ieee80211ax && - hostapd_get_he_twt_responder(hapd, IEEE80211_MODE_AP)) + if (hostapd_get_he_twt_responder(hapd, IEEE80211_MODE_AP)) *pos |= 0x40; /* Bit 78 - TWT responder */ #endif /* CONFIG_IEEE80211AX */ break;