]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: EHT additions
authorAloka Dixit <quic_alokad@quicinc.com>
Mon, 24 Jul 2023 23:16:26 +0000 (16:16 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 29 Sep 2023 15:33:24 +0000 (18:33 +0300)
Add support for EHT phy index and maximum NSS as per IEEE P802.11be/D4.0,
9.6.7.36 and 9.4.2.313.4.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
src/ap/beacon.c
src/common/ieee802_11_defs.h

index 8bda7c323bcefde518bb0f1e545c321261fdef82..1d3b96ac79a50943d3f07c7ba14be830578de45c 100644 (file)
@@ -1377,6 +1377,11 @@ void sta_track_del(struct hostapd_sta_info *info)
 
 static u16 hostapd_gen_fils_discovery_phy_index(struct hostapd_data *hapd)
 {
+#ifdef CONFIG_IEEE80211BE
+       if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be)
+               return FD_CAP_PHY_INDEX_EHT;
+#endif /* CONFIG_IEEE80211BE */
+
 #ifdef CONFIG_IEEE80211AX
        if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax)
                return FD_CAP_PHY_INDEX_HE;
@@ -1399,7 +1404,10 @@ static u16 hostapd_gen_fils_discovery_nss(struct hostapd_hw_modes *mode,
 {
        u16 nss = 0;
 
-       if (mode && phy_index == FD_CAP_PHY_INDEX_HE) {
+       if (!mode)
+               return 0;
+
+       if (phy_index == FD_CAP_PHY_INDEX_HE) {
                const u8 *he_mcs = mode->he_capab[IEEE80211_MODE_AP].mcs;
                int i;
                u16 mcs[6];
@@ -1449,6 +1457,31 @@ static u16 hostapd_gen_fils_discovery_nss(struct hostapd_hw_modes *mode,
                                continue;
                        }
                }
+       } else if (phy_index == FD_CAP_PHY_INDEX_EHT) {
+               u8 rx_nss, tx_nss, max_nss = 0, i;
+               u8 *mcs = mode->eht_capab[IEEE80211_MODE_AP].mcs;
+
+               /*
+                * The Supported EHT-MCS And NSS Set field for the AP contains
+                * one to three EHT-MCS Map fields based on the supported
+                * bandwidth. Check the first byte (max NSS for Rx/Tx that
+                * supports EHT-MCS 0-9) for each bandwidth (<= 80,
+                * 160, 320) to find the maximum NSS. This assumes that
+                * the lowest MCS rates support the largest number of spatial
+                * streams. If values are different between Tx, Rx or the
+                * bandwidths, choose the highest value.
+                */
+               for (i = 0; i < 3; i++) {
+                       rx_nss = mcs[3 * i] & 0x0F;
+                       if (rx_nss > max_nss)
+                               max_nss = rx_nss;
+
+                       tx_nss = (mcs[3 * i] & 0xF0) >> 4;
+                       if (tx_nss > max_nss)
+                               max_nss = tx_nss;
+               }
+
+               nss = max_nss;
        }
 
        if (nss > 4)
index f7123acc10f746aab4cc1ac886b765eb28233c06..1dafba93a24fa7bcedc06cd362d6e554b48c86ae 100644 (file)
@@ -2848,6 +2848,7 @@ enum mscs_description_subelem {
 #define FD_CAP_PHY_INDEX_HT                            2
 #define FD_CAP_PHY_INDEX_VHT                           3
 #define FD_CAP_PHY_INDEX_HE                            4 /* P802.11ax */
+#define FD_CAP_PHY_INDEX_EHT                           5 /* P802.11be */
 #define FD_CAP_PHY_INDEX_SHIFT                         10
 
 /*