]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Enable TWT responder AP role only if IEEE 802.11ax/HE is enabled
authorManaswini Paluri <quic_mpaluri@quicinc.com>
Wed, 6 Jul 2022 13:57:59 +0000 (19:27 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 13 Sep 2022 01:24:03 +0000 (04:24 +0300)
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 <quic_jouni@quicinc.com>
src/ap/ieee802_11_he.c
src/ap/ieee802_11_shared.c

index b5b7e5d462a0b0bf6ce5dd8886514dc1a11acb3c..12273c34c04fc3294218ddf515e1c27e3ac2ad2f 100644 (file)
@@ -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;
index d962cc0d5faa1fe1405bcb41953a0aaed873aa26..eaeaec5d73dc13c58696845b67d288505434b912 100644 (file)
@@ -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;