]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Allow EHT to be disabled using disable_eht=1 in wpa_supplicant
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 17 Oct 2022 08:12:17 +0000 (11:12 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 17 Oct 2022 08:13:09 +0000 (11:13 +0300)
This is similar to the previously added disable_ht/vht/he parameters.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/sme.c
wpa_supplicant/wpa_cli.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant.conf
wpa_supplicant/wpa_supplicant_i.h

index 36ecf72f68c37040edb711527c93d26b9dd67c10..4d9a7e3c08e4e57dccc734eb2e8241b7e0e3821d 100644 (file)
@@ -1251,6 +1251,11 @@ struct wpa_driver_associate_params {
         * 2 = both hunting-and-pecking loop and hash-to-element enabled
         */
        int sae_pwe;
+
+       /**
+        * disable_eht - Disable EHT for this connection
+        */
+       int disable_eht;
 };
 
 enum hide_ssid {
index ed9bf4841e021a3e6c518057aa926842c6e3a19d..fdc773a5833fb06d9cd849188d887e437b388bd1 100644 (file)
@@ -6059,6 +6059,12 @@ static int nl80211_ht_vht_overrides(struct nl_msg *msg,
        }
 #endif /* CONFIG_HE_OVERRIDES */
 
+       if (params->disable_eht) {
+               wpa_printf(MSG_DEBUG, "  * EHT disabled");
+               if (nla_put_flag(msg, NL80211_ATTR_DISABLE_EHT))
+                       return -1;
+       }
+
        return 0;
 }
 
index a91c689d08e0219a020299fe10decd712b057526..7bad144da56c489d7c0503ed8e8a6158578de9fd 100644 (file)
@@ -2664,6 +2664,7 @@ static const struct parse_data ssid_fields[] = {
        { INT_RANGE(beacon_prot, 0, 1) },
        { INT_RANGE(transition_disable, 0, 255) },
        { INT_RANGE(sae_pk, 0, 2) },
+       { INT_RANGE(disable_eht, 0, 1)},
 };
 
 #undef OFFSET
index b637dbfbcd86d5edaee4844e91ea63092d5300f5..c9936d18b4fcfe5f81d6f579828f724dbb919239 100644 (file)
@@ -880,6 +880,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
 #ifdef CONFIG_HE_OVERRIDES
        INT(disable_he);
 #endif /* CONFIG_HE_OVERRIDES */
+       INT(disable_eht);
 
 #undef STR
 #undef INT
index f625a0cc32420d2a8e6289a8d2b0af7ed7c20696..a8a81d79b3eeaeaa90065cdee479438f18c0b02d 100644 (file)
@@ -1192,6 +1192,14 @@ struct wpa_ssid {
         * 2 = both hunting-and-pecking loop and hash-to-element enabled
         */
        int sae_pwe;
+
+       /**
+        * disable_eht - Disable EHT (IEEE 802.11be) for this network
+        *
+        * By default, use it if it is available, but this can be configured
+        * to 1 to have it disabled.
+        */
+       int disable_eht;
 };
 
 #endif /* CONFIG_SSID_H */
index c9473947ad33432e447278371e9cd2284b160a8e..896fa9df48f26c87a9fac5a01cd8ce28220d1b34 100644 (file)
@@ -2027,6 +2027,7 @@ mscs_fail:
 #ifdef CONFIG_HE_OVERRIDES
        wpa_supplicant_apply_he_overrides(wpa_s, ssid, &params);
 #endif /* CONFIG_HE_OVERRIDES */
+       wpa_supplicant_apply_eht_overrides(wpa_s, ssid, &params);
 #ifdef CONFIG_IEEE80211R
        if (auth_type == WLAN_AUTH_FT && wpa_s->sme.ft_ies &&
            get_ie(wpa_s->sme.ft_ies, wpa_s->sme.ft_ies_len,
index 197efe0b739b9a20ab1e88e86266933e17ae54ba..4cc0857c61e792bb47bddd43f28102296ad97dab 100644 (file)
@@ -1479,6 +1479,7 @@ static const char *network_fields[] = {
 #ifdef CONFIG_HE_OVERRIDES
        "disable_he",
 #endif /* CONFIG_HE_OVERRIDES */
+       "disable_eht",
        "ap_max_inactivity", "dtim_period", "beacon_int",
 #ifdef CONFIG_MACSEC
        "macsec_policy",
index 761017248d3710228a48f0b589722cefd3ed6760..3d7626aebbcefb09d5dd65e01fb09046df627c39 100644 (file)
@@ -4119,6 +4119,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
 #ifdef CONFIG_HE_OVERRIDES
        wpa_supplicant_apply_he_overrides(wpa_s, ssid, &params);
 #endif /* CONFIG_HE_OVERRIDES */
+       wpa_supplicant_apply_eht_overrides(wpa_s, ssid, &params);
 
 #ifdef CONFIG_P2P
        /*
@@ -5915,6 +5916,17 @@ void wpa_supplicant_apply_he_overrides(
 #endif /* CONFIG_HE_OVERRIDES */
 
 
+void wpa_supplicant_apply_eht_overrides(
+       struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
+       struct wpa_driver_associate_params *params)
+{
+       if (!ssid)
+               return;
+
+       params->disable_eht = ssid->disable_eht;
+}
+
+
 static int pcsc_reader_init(struct wpa_supplicant *wpa_s)
 {
 #ifdef PCSC_FUNCS
index 90061ba67252a2de37dd34c464bd40004657efcc..cd3e16df92768d7778f2eded94b0c58d4df70d15 100644 (file)
@@ -1627,6 +1627,10 @@ fast_reauth=1
 #  2: MCS 0-9
 #  3: not supported
 
+# disable_eht: Whether EHT should be disabled.
+# 0 = EHT enabled (if supported) (default)
+# 1 = EHT disabled
+
 # multi_ap_backhaul_sta: Multi-AP backhaul STA functionality
 # 0 = normal STA (default)
 # 1 = backhaul STA
index 813e5ac1b80cd9912f0fc044eee0394c594be3e6..4081592bdd3f1e284cb48c41b983b586eb581bf4 100644 (file)
@@ -1584,6 +1584,9 @@ void wpa_supplicant_apply_vht_overrides(
 void wpa_supplicant_apply_he_overrides(
        struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
        struct wpa_driver_associate_params *params);
+void wpa_supplicant_apply_eht_overrides(
+       struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
+       struct wpa_driver_associate_params *params);
 
 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
 int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,