[PATCH v2 3/7] wpa_s: implement EHT membership selector check

Johannes Berg johannes at sipsolutions.net
Tue Mar 17 09:35:51 PDT 2026


From: Johannes Berg <johannes.berg at intel.com>

Check the EHT membership selector and don't use the BSS
if required but not supported by HW.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 src/drivers/driver.h              |  3 +++
 src/drivers/driver_common.c       | 15 +++++++++++++++
 src/drivers/driver_nl80211_capa.c |  3 ++-
 wpa_supplicant/events.c           | 11 +++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 38c4d3da3a26..cefc73942ea6 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -219,6 +219,7 @@ struct eht_capabilities {
 #define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
 #define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
 #define HOSTAPD_MODE_FLAG_HE_INFO_KNOWN BIT(2)
+#define HOSTAPD_MODE_FLAG_EHT_INFO_KNOWN BIT(3)
 
 
 enum ieee80211_op_mode {
@@ -7377,6 +7378,8 @@ int ht_supported(const struct hostapd_hw_modes *mode);
 int vht_supported(const struct hostapd_hw_modes *mode);
 bool he_supported(const struct hostapd_hw_modes *hw_mode,
 		  enum ieee80211_op_mode op_mode);
+bool eht_supported(const struct hostapd_hw_modes *hw_mode,
+		   enum ieee80211_op_mode op_mode);
 
 struct wowlan_triggers *
 wpa_get_wowlan_triggers(const char *wowlan_triggers,
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
index cff25b446a90..3653c639e843 100644
--- a/src/drivers/driver_common.c
+++ b/src/drivers/driver_common.c
@@ -206,6 +206,21 @@ bool he_supported(const struct hostapd_hw_modes *hw_mode,
 }
 
 
+bool eht_supported(const struct hostapd_hw_modes *hw_mode,
+		   enum ieee80211_op_mode op_mode)
+{
+	if (!(hw_mode->flags & HOSTAPD_MODE_FLAG_EHT_INFO_KNOWN)) {
+		/*
+		 * The driver did not indicate whether it supports EHT. Assume
+		 * it does to avoid connection issues.
+		 */
+		return true;
+	}
+
+	return hw_mode->eht_capab[op_mode].eht_supported;
+}
+
+
 static int wpa_check_wowlan_trigger(const char *start, const char *trigger,
 				    int capa_trigger, u8 *param_trigger)
 {
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 930751e0e91e..18154e2445a4 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -2167,7 +2167,8 @@ static int phy_info_band(struct phy_info_arg *phy_info, struct nlattr *nl_band)
 		mode->mode = NUM_HOSTAPD_MODES;
 		mode->flags = HOSTAPD_MODE_FLAG_HT_INFO_KNOWN |
 			HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN |
-			HOSTAPD_MODE_FLAG_HE_INFO_KNOWN;
+			HOSTAPD_MODE_FLAG_HE_INFO_KNOWN |
+			HOSTAPD_MODE_FLAG_EHT_INFO_KNOWN;
 
 		/*
 		 * Unsupported VHT MCS stream is defined as value 3, so the VHT
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index f56928bc4ea4..c241ea2cf827 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1052,6 +1052,17 @@ static int rate_match(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
 				continue;
 			}
 
+			if (flagged && ((rate_ie[j] & 0x7f) ==
+					BSS_MEMBERSHIP_SELECTOR_EHT_PHY)) {
+				if (!eht_supported(mode, IEEE80211_MODE_INFRA)) {
+					if (debug_print)
+						wpa_dbg(wpa_s, MSG_DEBUG,
+							"   hardware does not support EHT PHY");
+					return 0;
+				}
+				continue;
+			}
+
 #ifdef CONFIG_SAE
 			if (flagged && ((rate_ie[j] & 0x7f) ==
 					BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY)) {
-- 
2.53.0




More information about the Hostap mailing list