[PATCH 2/2] wpa_supplicant: add CONFIG_EHT_OVERRIDES
Nicolas Escande
nico.escande at gmail.com
Wed Mar 4 06:39:50 PST 2026
The disable_eht code was the only one of the disable_xxx that was not added
behind a compile time option. This makes disable_eht follow the same
principles as the other modes (ht/vht/he) overrides.
Signed-off-by: Nicolas Escande <nico.escande at gmail.com>
---
src/drivers/driver.h | 2 ++
src/drivers/driver_nl80211.c | 2 ++
tests/hwsim/example-wpa_supplicant.config | 1 +
wpa_supplicant/Android.mk | 4 ++++
wpa_supplicant/Makefile | 4 ++++
wpa_supplicant/ap.c | 2 ++
wpa_supplicant/config.c | 2 ++
wpa_supplicant/config_file.c | 2 ++
wpa_supplicant/config_ssid.h | 2 ++
wpa_supplicant/defconfig | 3 +++
wpa_supplicant/sme.c | 2 ++
wpa_supplicant/wpa_cli.c | 2 ++
wpa_supplicant/wpa_supplicant.c | 6 ++++++
13 files changed, 34 insertions(+)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 38c4d3da3a26..4d0b7f8ef650 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1397,10 +1397,12 @@ struct wpa_driver_associate_params {
*/
enum sae_pwe sae_pwe;
+#ifdef CONFIG_EHT_OVERRIDES
/**
* disable_eht - Disable EHT for this connection
*/
int disable_eht;
+#endif /* CONFIG_EHT_OVERRIDES */
/*
* mld_params - MLD association parameters
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 031e68704dc8..db6ab26bf867 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7021,11 +7021,13 @@ static int nl80211_ht_vht_overrides(struct nl_msg *msg,
}
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
if (params->disable_eht) {
wpa_printf(MSG_DEBUG, " * EHT disabled");
if (nla_put_flag(msg, NL80211_ATTR_DISABLE_EHT))
return -1;
}
+#endif /* CONFIG_EHT_OVERRIDES */
return 0;
}
diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config
index 50035434bd25..eed23a96c262 100644
--- a/tests/hwsim/example-wpa_supplicant.config
+++ b/tests/hwsim/example-wpa_supplicant.config
@@ -106,6 +106,7 @@ CONFIG_TLSV12=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_HE_OVERRIDES=y
+CONFIG_EHT_OVERRIDES=y
CONFIG_DEBUG_LINUX_TRACING=y
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index 13113c3e0abf..1b6a50c9ea89 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -175,6 +175,10 @@ ifdef CONFIG_HE_OVERRIDES
L_CFLAGS += -DCONFIG_HE_OVERRIDES
endif
+ifdef CONFIG_EHT_OVERRIDES
+L_CFLAGS += -DCONFIG_EHT_OVERRIDES
+endif
+
ifndef CONFIG_BACKEND
CONFIG_BACKEND=file
endif
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index ab9ba9364f48..82a680eb5af5 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -209,6 +209,10 @@ ifdef CONFIG_HE_OVERRIDES
CFLAGS += -DCONFIG_HE_OVERRIDES
endif
+ifdef CONFIG_EHT_OVERRIDES
+CFLAGS += -DCONFIG_EHT_OVERRIDES
+endif
+
ifndef CONFIG_BACKEND
CONFIG_BACKEND=file
endif
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 009a8d4318fa..a77c4db7ac60 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -328,8 +328,10 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
ssid->he = 0;
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
if (ssid->disable_eht)
ssid->eht = 0;
+#endif /* CONFIG_EHT_OVERRIDES */
if (!ssid->ht) {
wpa_printf(MSG_DEBUG,
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 623ab720bf52..78098d990e81 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2834,7 +2834,9 @@ 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) },
+#ifdef CONFIG_EHT_OVERRIDES
{ INT_RANGE(disable_eht, 0, 1)},
+#endif /* CONFIG_EHT_OVERRIDES */
{ INT_RANGE(enable_4addr_mode, 0, 1)},
{ INT_RANGE(max_idle, 0, 65535)},
{ INT_RANGE(ssid_protection, 0, 1)},
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index f9d18137f964..1babd26cbfd0 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1018,7 +1018,9 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid,
#ifdef CONFIG_HE_OVERRIDES
INT(disable_he);
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
INT(disable_eht);
+#endif /* CONFIG_EHT_OVERRIDES */
INT(enable_4addr_mode);
INT(max_idle);
INT(ssid_protection);
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index 3f22c44d70f8..5595de0a0be5 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -1292,6 +1292,7 @@ struct wpa_ssid {
*/
enum sae_pwe sae_pwe;
+#ifdef CONFIG_EHT_OVERRIDES
/**
* disable_eht - Disable EHT (IEEE 802.11be) for this network
*
@@ -1299,6 +1300,7 @@ struct wpa_ssid {
* to 1 to have it disabled.
*/
int disable_eht;
+#endif /* CONFIG_EHT_OVERRIDES */
/**
* enable_4addr_mode - Set 4addr mode after association
diff --git a/wpa_supplicant/defconfig b/wpa_supplicant/defconfig
index 3060d8d7f3de..2d4445b13094 100644
--- a/wpa_supplicant/defconfig
+++ b/wpa_supplicant/defconfig
@@ -209,6 +209,9 @@ CONFIG_SMARTCARD=y
# Support HE overrides
#CONFIG_HE_OVERRIDES=y
+# Support EHT overrides
+#CONFIG_EHT_OVERRIDES=y
+
# Development testing
#CONFIG_EAPOL_TEST=y
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index a14ff784c6f0..5c9067961384 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -2926,7 +2926,9 @@ mscs_fail:
#ifdef CONFIG_HE_OVERRIDES
wpa_supplicant_apply_he_overrides(wpa_s, ssid, ¶ms);
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
wpa_supplicant_apply_eht_overrides(wpa_s, ssid, ¶ms);
+#endif /* CONFIG_EHT_OVERRIDES */
#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,
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 098ada6ceb6f..b14d4f91d07c 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1496,7 +1496,9 @@ static const char *network_fields[] = {
#ifdef CONFIG_HE_OVERRIDES
"disable_he",
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
"disable_eht",
+#endif /* CONFIG_EHT_OVERRIDES */
"ap_max_inactivity", "dtim_period", "beacon_int",
#ifdef CONFIG_MACSEC
"macsec_policy",
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 29b2815a8185..a457aec10267 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3163,8 +3163,10 @@ static bool ibss_mesh_can_use_eht(struct wpa_supplicant *wpa_s,
const struct hostapd_hw_modes *mode,
int ieee80211_mode)
{
+#ifdef CONFIG_EHT_OVERRIDES
if (ssid->disable_eht)
return false;
+#endif /* CONFIG_EHT_OVERRIDES */
switch(mode->mode) {
case HOSTAPD_MODE_IEEE80211G:
@@ -4925,7 +4927,9 @@ 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, ¶ms);
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
wpa_supplicant_apply_eht_overrides(wpa_s, ssid, ¶ms);
+#endif /* CONFIG_EHT_OVERRIDES */
#ifdef CONFIG_P2P
/*
@@ -6870,6 +6874,7 @@ void wpa_supplicant_apply_he_overrides(
#endif /* CONFIG_HE_OVERRIDES */
+#ifdef CONFIG_EHT_OVERRIDES
void wpa_supplicant_apply_eht_overrides(
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
struct wpa_driver_associate_params *params)
@@ -6879,6 +6884,7 @@ void wpa_supplicant_apply_eht_overrides(
params->disable_eht = ssid->disable_eht;
}
+#endif /* CONFIG_EHT_OVERRIDES */
static int pcsc_reader_init(struct wpa_supplicant *wpa_s)
--
2.53.0
More information about the Hostap
mailing list