]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Convert wpa_s->hw_capab into a bitmap and add HE and EHT
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 6 Nov 2024 17:41:44 +0000 (19:41 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 6 Nov 2024 17:47:21 +0000 (19:47 +0200)
This makes wpa_s->hw_capab more useful for determining local
capabilities, e.g., for reporting them using Wi-Fi Alliance generational
capabilities indication.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 7947b6f089d3c4c81ef8920d6597a61c9c56341b..a7c56f771dd9cb9294c52c7d31e10262039bd004 100644 (file)
@@ -3461,7 +3461,7 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_WNM */
                interworking_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
                                                data->assoc_info.resp_ies_len);
-               if (wpa_s->hw_capab == CAPAB_VHT &&
+               if ((wpa_s->hw_capab & BIT(CAPAB_VHT)) &&
                    get_ie(data->assoc_info.resp_ies,
                           data->assoc_info.resp_ies_len, WLAN_EID_VHT_CAP))
                        wpa_s->ieee80211ac = 1;
index c8ab4485e0f4ec4dc3337144f1645725b7b37b6f..deb07e2681f76b25b16ab18daaa1727381e53693 100644 (file)
@@ -7600,17 +7600,16 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
                u16 i;
 
                for (i = 0; i < wpa_s->hw.num_modes; i++) {
-                       if (wpa_s->hw.modes[i].vht_capab) {
-                               wpa_s->hw_capab = CAPAB_VHT;
-                               break;
-                       }
-
-                       if (wpa_s->hw.modes[i].ht_capab &
-                           HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)
-                               wpa_s->hw_capab = CAPAB_HT40;
-                       else if (wpa_s->hw.modes[i].ht_capab &&
-                                wpa_s->hw_capab == CAPAB_NO_HT_VHT)
-                               wpa_s->hw_capab = CAPAB_HT;
+                       if (wpa_s->hw.modes[i].eht_capab[IEEE80211_MODE_INFRA].
+                           eht_supported)
+                               wpa_s->hw_capab |= BIT(CAPAB_EHT);
+                       if (wpa_s->hw.modes[i].he_capab[IEEE80211_MODE_INFRA].
+                           he_supported)
+                               wpa_s->hw_capab |= BIT(CAPAB_HE);
+                       if (wpa_s->hw.modes[i].vht_capab)
+                               wpa_s->hw_capab |= BIT(CAPAB_VHT);
+                       if (wpa_s->hw.modes[i].ht_capab)
+                               wpa_s->hw_capab |= BIT(CAPAB_HT);
                }
                wpa_s->support_6ghz = wpas_is_6ghz_supported(wpa_s, false);
        }
index 2549c8b5cd22a02d4a0be3082dd233925ada3ac6..030ceec14cad10c6a338acfd902033a60145f166 100644 (file)
@@ -669,6 +669,13 @@ struct ml_sta_link_info {
 };
 
 
+enum local_hw_capab {
+       CAPAB_HT,
+       CAPAB_VHT,
+       CAPAB_HE,
+       CAPAB_EHT,
+};
+
 /**
  * struct wpa_supplicant - Internal data for wpa_supplicant interface
  *
@@ -1253,12 +1260,7 @@ struct wpa_supplicant {
                u16 num_modes;
                u16 flags;
        } hw;
-       enum local_hw_capab {
-               CAPAB_NO_HT_VHT,
-               CAPAB_HT,
-               CAPAB_HT40,
-               CAPAB_VHT,
-       } hw_capab;
+       unsigned int hw_capab; /* bitmap of enum local_hw_capab bits */
 #ifdef CONFIG_MACSEC
        struct ieee802_1x_kay *kay;
 #endif /* CONFIG_MACSEC */