[PATCH v2 2/7] hostapd: add require_eht configuration
Johannes Berg
johannes at sipsolutions.net
Tue Mar 17 09:35:50 PDT 2026
From: Johannes Berg <johannes.berg at intel.com>
Add the ability to require EHT, advertising that via the
BSS membership selector as well as rejecting association
without EHT.
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
v2: use correct CONFIG_IEEE80211BE ifdef
---
hostapd/config_file.c | 2 ++
hostapd/hostapd.conf | 3 +++
src/ap/ap_config.h | 1 +
src/ap/ieee802_11.c | 12 ++++++++++++
src/common/ieee802_11_defs.h | 1 +
5 files changed, 19 insertions(+)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 5e9ed06e8223..545683871a15 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -4928,6 +4928,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
#ifdef CONFIG_IEEE80211BE
} else if (os_strcmp(buf, "ieee80211be") == 0) {
conf->ieee80211be = atoi(pos);
+ } else if (os_strcmp(buf, "require_eht") == 0) {
+ conf->require_eht = atoi(pos);
} else if (os_strcmp(buf, "eht_oper_chwidth") == 0) {
conf->eht_oper_chwidth = atoi(pos);
} else if (os_strcmp(buf, "eht_oper_centr_freq_seg0_idx") == 0) {
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index b0cdfd90c2d5..9e3f9d4d524c 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -1057,6 +1057,9 @@ wmm_ac_vo_acm=0
# 1 = enabled
#ieee80211be=1
+# Require stations to support EHT PHY (reject association if they do not)
+#require_eht=1
+
#disable_11be: Boolean (0/1) to disable EHT for a specific BSS
#disable_11be=0
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 065f43f55433..15bee01b5ca2 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -1230,6 +1230,7 @@ struct hostapd_config {
u8 punct_acs_threshold;
u8 eht_default_pe_duration;
u8 eht_bw320_offset;
+ int require_eht;
#endif /* CONFIG_IEEE80211BE */
/* EHT enable/disable config from CHAN_SWITCH */
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 221e3c5c1a1f..bb8defeb6c7e 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -146,6 +146,11 @@ static size_t hostapd_supp_rates(struct hostapd_data *hapd, u8 *buf)
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HE_PHY;
#endif /* CONFIG_IEEE80211AX */
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->iconf->ieee80211be && hapd->iconf->require_eht)
+ *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_EHT_PHY;
+#endif /* CONFIG_IEEE80211BE */
+
#ifdef CONFIG_SAE
if ((hapd->conf->sae_pwe == SAE_PWE_HASH_TO_ELEMENT ||
hostapd_sae_pw_id_in_use(hapd->conf) == 2) &&
@@ -4648,6 +4653,13 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
if (resp != WLAN_STATUS_SUCCESS)
goto out;
+ if (hapd->iconf->require_eht && !(sta->flags & WLAN_STA_EHT)) {
+ hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_INFO, "Station does not support "
+ "mandatory EHT PHY - reject association");
+ return WLAN_STATUS_DENIED_EHT_NOT_SUPPORTED;
+ }
+
if (!assoc_wpa_sm) {
resp = hostapd_process_ml_assoc_req(hapd, elems, sta);
if (resp != WLAN_STATUS_SUCCESS)
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index d196cc926db8..55e74f93ac08 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -1412,6 +1412,7 @@ struct ieee80211_ampe_ie {
#define HT_OPER_PARAM_PCO_PHASE ((u16) BIT(11))
/* B36..B39 - Reserved */
+#define BSS_MEMBERSHIP_SELECTOR_EHT_PHY 121
#define BSS_MEMBERSHIP_SELECTOR_HE_PHY 122
#define BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY 123
#define BSS_MEMBERSHIP_SELECTOR_EPD 124
--
2.53.0
More information about the Hostap
mailing list