]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Implement HE membership selector check
authorJohannes Berg <johannes.berg@intel.com>
Sun, 4 Dec 2022 09:49:34 +0000 (11:49 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 16 Dec 2022 18:31:14 +0000 (20:31 +0200)
Check the HE membership selector and don't use the BSS
if required but not supported by HW.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/drivers/driver.h
src/drivers/driver_common.c
src/drivers/driver_nl80211_capa.c
wpa_supplicant/events.c

index 15d539af29c8800a7645dde479f376421bf9e388..71e6e658ac4e16d125fcf78bdb86399bcde227c2 100644 (file)
@@ -212,6 +212,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)
 
 
 enum ieee80211_op_mode {
@@ -6562,6 +6563,8 @@ int channel_width_to_int(enum chan_width width);
 
 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);
 
 struct wowlan_triggers *
 wpa_get_wowlan_triggers(const char *wowlan_triggers,
index 0ac0aa6de6f764707a16a2c04b012b12aff28036..bbd1a7cef517a0eec3bad613d24ed97ad80e3b23 100644 (file)
@@ -185,6 +185,21 @@ 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)
+{
+       if (!(hw_mode->flags & HOSTAPD_MODE_FLAG_HE_INFO_KNOWN)) {
+               /*
+                * The driver did not indicate whether it supports HE. Assume
+                * it does to avoid connection issues.
+                */
+               return true;
+       }
+
+       return hw_mode->he_capab[op_mode].he_supported;
+}
+
+
 static int wpa_check_wowlan_trigger(const char *start, const char *trigger,
                                    int capa_trigger, u8 *param_trigger)
 {
index e0c3e416a758ffcec070f0f718e26540381e76aa..959f7f37de780c34f6e1045c1f99f2caaaf88d82 100644 (file)
@@ -2024,7 +2024,8 @@ static int phy_info_band(struct phy_info_arg *phy_info, struct nlattr *nl_band)
                os_memset(mode, 0, sizeof(*mode));
                mode->mode = NUM_HOSTAPD_MODES;
                mode->flags = HOSTAPD_MODE_FLAG_HT_INFO_KNOWN |
-                       HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN;
+                       HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN |
+                       HOSTAPD_MODE_FLAG_HE_INFO_KNOWN;
 
                /*
                 * Unsupported VHT MCS stream is defined as value 3, so the VHT
index e55dbce5a32d4e7f390e1467862ec5a55892a5f4..77f0b661a785c5d603ace93978541548b985ce3c 100644 (file)
@@ -964,6 +964,17 @@ static int rate_match(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
                                continue;
                        }
 
+                       if (flagged && ((rate_ie[j] & 0x7f) ==
+                                       BSS_MEMBERSHIP_SELECTOR_HE_PHY)) {
+                               if (!he_supported(mode, IEEE80211_MODE_INFRA)) {
+                                       if (debug_print)
+                                               wpa_dbg(wpa_s, MSG_DEBUG,
+                                                       "   hardware does not support HE PHY");
+                                       return 0;
+                               }
+                               continue;
+                       }
+
 #ifdef CONFIG_SAE
                        if (flagged && ((rate_ie[j] & 0x7f) ==
                                        BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY)) {