wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/q02-016-eht-additions-in-FILS-discovery-frames.patch
John Crispin 008ca9618d
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
ipq95xx: import ath12.4-cs kernel and drivers
Signed-off-by: John Crispin <john@phrozen.org>
2024-10-20 09:25:13 +02:00

176 lines
5.1 KiB
Diff

From 1405e5078b42f9af4e7caed2803a7ffeecc81f29 Mon Sep 17 00:00:00 2001
From: Aloka Dixit <quic_alokad@quicinc.com>
Date: Mon, 19 Jul 2021 11:21:46 -0700
Subject: [PATCH 16/23] eht: additions in FILS discovery frames
Add support for following as per IEEE P802.11be/D1.4, January 2022,
section 9.6.7.36,
- new EHT phy index
- EHT MCS rates
- support for 320 MHZ
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
src/ap/beacon.c | 85 ++++++++++++++++++++++++------------
src/common/ieee802_11_defs.h | 2 +
2 files changed, 60 insertions(+), 27 deletions(-)
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 17c06b4..e973472 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -1400,6 +1400,44 @@ void sta_track_del(struct hostapd_sta_info *info)
#ifdef CONFIG_FILS
+static u16 hostapd_fils_discovery_cap_nss(struct hostapd_hw_modes *mode,
+ u16 phy_index, u8 len)
+{
+ u16 nss = 0;
+
+ if (phy_index == FD_CAP_PHY_INDEX_EHT) {
+ u8 rx_nss = 0, tx_nss = 0;
+ u8 *mcs = mode->eht_capab[IEEE80211_MODE_AP].mcs;
+
+ rx_nss = mcs[0] & 0x0F;
+ tx_nss = (mcs[0] & 0xF0) >> 4;
+ nss = (tx_nss < rx_nss ? tx_nss : rx_nss);
+ } else if (phy_index == FD_CAP_PHY_INDEX_HE) {
+ u8 i;
+ u16 *mcs = (u16 *) mode->he_capab[IEEE80211_MODE_AP].mcs;
+
+ for (i = 0; i < HE_NSS_MAX_STREAMS; i++) {
+ u16 mask = 0x3 << (i * 2);
+
+ if (len == 4 && (((mcs[0] & mask) == mask) ||
+ ((mcs[1] & mask) == mask)))
+ continue;
+
+ if (len == 8 && (((mcs[2] & mask) == mask) ||
+ ((mcs[3] & mask) == mask)))
+ continue;
+
+ if (len == 12 && (((mcs[4] & mask) == mask) ||
+ ((mcs[5] & mask) == mask)))
+ continue;
+
+ nss++;
+ }
+ }
+
+ return nss;
+}
+
static u16 hostapd_fils_discovery_cap(struct hostapd_data *hapd)
{
u16 cap_info, phy_index = 0;
@@ -1411,7 +1449,15 @@ static u16 hostapd_fils_discovery_cap(struct hostapd_data *hapd)
cap_info |= FD_CAP_PRIVACY;
if (is_6ghz_op_class(hapd->iconf->op_class)) {
- phy_index = FD_CAP_PHY_INDEX_HE;
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be)
+ phy_index = FD_CAP_PHY_INDEX_EHT;
+#endif /* CONFIG_IEEE80211BE */
+#ifdef CONFIG_IEEE80211AX
+ if (!phy_index &&
+ hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax)
+ phy_index = FD_CAP_PHY_INDEX_HE;
+#endif /* CONFIG_IEEE80211AX */
switch (hapd->iconf->op_class) {
case 137:
@@ -1453,8 +1499,13 @@ static u16 hostapd_fils_discovery_cap(struct hostapd_data *hapd)
break;
}
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be)
+ phy_index = FD_CAP_PHY_INDEX_EHT;
+#endif /* CONFIG_IEEE80211BE */
#ifdef CONFIG_IEEE80211AX
- if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax)
+ if (!phy_index &&
+ hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax)
phy_index = FD_CAP_PHY_INDEX_HE;
#endif /* CONFIG_IEEE80211AX */
#ifdef CONFIG_IEEE80211AC
@@ -1471,54 +1522,9 @@ static u16 hostapd_fils_discovery_cap(struct hostapd_data *hapd)
cap_info |= chwidth << FD_CAP_BSS_CHWIDTH_SHIFT;
if (mode && phy_index == FD_CAP_PHY_INDEX_HE) {
- const u8 *he_mcs = mode->he_capab[IEEE80211_MODE_AP].mcs;
- int i;
- u16 nss = 0, mcs[6];
-
- os_memset(mcs, 0xffff, 6 * sizeof(u16));
-
- if (mcs_nss_size == 4) {
- mcs[0] = WPA_GET_LE16(&he_mcs[0]);
- mcs[1] = WPA_GET_LE16(&he_mcs[2]);
- }
-
- if (mcs_nss_size == 8) {
- mcs[2] = WPA_GET_LE16(&he_mcs[4]);
- mcs[3] = WPA_GET_LE16(&he_mcs[6]);
- }
-
- if (mcs_nss_size == 12) {
- mcs[4] = WPA_GET_LE16(&he_mcs[8]);
- mcs[5] = WPA_GET_LE16(&he_mcs[10]);
- }
-
- for (i = 0; i < HE_NSS_MAX_STREAMS; i++) {
- u16 nss_mask = 0x3 << (i * 2);
-
- /*
- * If NSS values supported by RX and TX are different
- * then choose the smaller of the two as the maximum
- * supported NSS as that is the value supported by
- * both RX and TX.
- */
- if (mcs_nss_size == 4 &&
- (((mcs[0] & nss_mask) == nss_mask) ||
- ((mcs[1] & nss_mask) == nss_mask)))
- continue;
-
- if (mcs_nss_size == 8 &&
- (((mcs[2] & nss_mask) == nss_mask) ||
- ((mcs[3] & nss_mask) == nss_mask)))
- continue;
-
- if (mcs_nss_size == 12 &&
- (((mcs[4] & nss_mask) == nss_mask) ||
- ((mcs[5] & nss_mask) == nss_mask)))
- continue;
-
- nss++;
- }
+ u16 nss = hostapd_fils_discovery_cap_nss(mode, phy_index,
+ mcs_nss_size);
if (nss > 4)
cap_info |= FD_CAP_NSS_5_8 << FD_CAP_NSS_SHIFT;
else if (nss)
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 19819d7..c47c0a0 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -2815,6 +2815,7 @@ enum mscs_description_subelem {
#define FD_CAP_BSS_CHWIDTH_80 2
#define FD_CAP_BSS_CHWIDTH_160_80_80 3
#define FD_CAP_BSS_CHWIDTH_320 4
+#define FD_CAP_BSS_CHWIDTH_320 4
#define FD_CAP_BSS_CHWIDTH_SHIFT 2
#define FD_CAP_NSS_1 0
@@ -2829,6 +2830,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
/*