]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Add user configuration for TWT responder role
authorMohammad Asaad Akram <asadkrm@codeaurora.org>
Fri, 28 May 2021 04:17:38 +0000 (09:47 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 31 May 2021 21:17:03 +0000 (00:17 +0300)
Add user configuration he_twt_responder for enabling/disabling TWT
responder role, in addition to checking the driver's capability. The
default configuration is to enable TWT responder role when the driver
supports this.

Signed-off-by: Mohammad Asaad Akram <asadkrm@codeaurora.org>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.c
src/ap/ap_config.h
src/ap/ieee802_11_he.c

index e05c81366d9b1a03fd8913c39abcbb455bc99822..9bc1dc7756e9d8e36d87278deac02d84a9897dc8 100644 (file)
@@ -3511,6 +3511,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                conf->he_op.he_default_pe_duration = atoi(pos);
        } else if (os_strcmp(buf, "he_twt_required") == 0) {
                conf->he_op.he_twt_required = atoi(pos);
+       } else if (os_strcmp(buf, "he_twt_responder") == 0) {
+               conf->he_op.he_twt_responder = atoi(pos);
        } else if (os_strcmp(buf, "he_rts_threshold") == 0) {
                conf->he_op.he_rts_threshold = atoi(pos);
        } else if (os_strcmp(buf, "he_basic_mcs_nss_set") == 0) {
index a89ce9b36643eb3ebc8fbb85fcef2b45827f041c..b5d15061f85083f2b1ee8f57b47e75d6f5145752 100644 (file)
@@ -831,6 +831,11 @@ wmm_ac_vo_acm=0
 # 1 = required
 #he_twt_required=0
 
+#he_twt_responder: Whether TWT (HE) responder is enabled
+# 0 = disabled
+# 1 = enabled if supported by the driver (default)
+#he_twt_responder=1
+
 #he_rts_threshold: Duration of STA transmission
 # 0 = not set (default)
 # unsigned integer = duration in units of 16 us
index 7b6249bbe5cff9d59d2425f6dcd6e3af603f6b7a..7b6d54c35fc23378d7e0e0fbbb175f36181e3a3e 100644 (file)
@@ -274,6 +274,7 @@ struct hostapd_config * hostapd_config_defaults(void)
        conf->he_op.he_bss_color_disabled = 1;
        conf->he_op.he_bss_color_partial = 0;
        conf->he_op.he_bss_color = 1;
+       conf->he_op.he_twt_responder = 1;
        conf->he_6ghz_max_mpdu = 2;
        conf->he_6ghz_max_ampdu_len_exp = 7;
        conf->he_6ghz_rx_ant_pat = 1;
index 95bd79873a59bb9ad2cce0ab7cd0cc99cdecc0c8..ced36f9cc828083452ca4318ab920fe924a1eb7f 100644 (file)
@@ -914,6 +914,7 @@ struct he_operation {
        u8 he_bss_color_partial;
        u8 he_default_pe_duration;
        u8 he_twt_required;
+       u8 he_twt_responder;
        u16 he_rts_threshold;
        u16 he_basic_mcs_nss_set;
 };
index 8ff38359498eb9bd72c738834ac4b73aad0bc319..cbe5e639588f8391dbb4d8c9e1c1d6a98bd8f196 100644 (file)
@@ -514,5 +514,6 @@ int hostapd_get_he_twt_responder(struct hostapd_data *hapd,
 
        mac_cap = hapd->iface->current_mode->he_capab[mode].mac_cap;
 
-       return !!(mac_cap[HE_MAC_CAPAB_0] & HE_MACCAP_TWT_RESPONDER);
+       return !!(mac_cap[HE_MAC_CAPAB_0] & HE_MACCAP_TWT_RESPONDER) &&
+               hapd->iface->conf->he_op.he_twt_responder;
 }