wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/q02-037-ulmumimo-parameter-support.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

219 lines
8.0 KiB
Diff

From 8a87e30fd909c53dd6b936d6536042ad6369e53c Mon Sep 17 00:00:00 2001
From: Nagarajan Maran <quic_nmaran@quicinc.com>
Date: Thu, 21 Apr 2022 15:00:52 +0530
Subject: [PATCH] hostapd: UL-MUMIMO param support
Adding new params for he and eht to enable/disable ul mumimo.
Set 0 to disable or 1 to enable. If param isn't specified,
the driver/underlying hardware decides its default behaviour.
Following param fields are supported in hostapd conf file,
HE: "he_ul_mumimo"
EHT: "eht_ulmumimo_80mhz", "eht_ulmumimo_160mhz", "eht_ulmumimo_320mhz"
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com>
Signed-off-by: Sidhanta Sahu <quic_sidhanta@quicinc.com>
---
hostapd/config_file.c | 10 ++++++++++
hostapd/hostapd.conf | 5 +++++
src/ap/ap_config.c | 2 ++
src/ap/ap_config.h | 5 +++++
src/ap/hw_features.c | 28 ++++++++++++++++++++++++++++
src/ap/ieee802_11_eht.c | 14 +++++++++++++-
src/ap/ieee802_11_he.c | 7 +++++++
src/common/ieee802_11_defs.h | 8 +++++++-
8 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 0aa4e80..ce0f574 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3462,6 +3462,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf->he_phy_capab.he_su_beamformee = atoi(pos);
} else if (os_strcmp(buf, "he_mu_beamformer") == 0) {
conf->he_phy_capab.he_mu_beamformer = atoi(pos);
+ } else if (os_strcmp(buf, "he_ul_mumimo") == 0) {
+ conf->he_phy_capab.he_ul_mumimo = atoi(pos);
} else if (os_strcmp(buf, "he_bss_color") == 0) {
conf->he_op.he_bss_color = atoi(pos);
if (conf->he_op.he_bss_color > 63)
@@ -4762,6 +4764,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf->eht_phy_capab.su_beamformee = atoi(pos);
} else if (os_strcmp(buf, "eht_mu_beamformer") == 0) {
conf->eht_phy_capab.mu_beamformer = atoi(pos);
+ } else if (os_strcmp(buf, "eht_part_dl_mu_mimo") == 0) {
+ conf->eht_phy_capab.partial_bw_dl_mu_mimo = atoi(pos);
+ } else if (os_strcmp(buf, "eht_ulmumimo_80mhz") == 0) {
+ conf->eht_phy_capab.non_ofdma_ulmumimo_80mhz = atoi(pos);
+ } else if (os_strcmp(buf, "eht_ulmumimo_160mhz") == 0) {
+ conf->eht_phy_capab.non_ofdma_ulmumimo_160mhz = atoi(pos);
+ } else if (os_strcmp(buf, "eht_ulmumimo_320mhz") == 0) {
+ conf->eht_phy_capab.non_ofdma_ulmumimo_320mhz = atoi(pos);
} else if (os_strcmp(buf, "ru_punct_bitmap") == 0) {
conf->ru_punct_bitmap = atoi(pos);
} else if (os_strcmp(buf, "ru_punct_ofdma") == 0) {
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index cda9e35..595212d 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -838,6 +838,11 @@ wmm_ac_vo_acm=0
# 1 = supported
#he_mu_beamformer=1
+#he_ul_mumimo: HE Uplink multiple user MIMO support
+# -1 or unspecified = Decided by firmware or underlying hardware(Default)
+# 0 = not supported
+# 1 = supported
+
# he_bss_color:
# 0 = disable
# 1-63 = pre-defined color
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index afc1dd7..3edcddb 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -274,6 +274,8 @@ struct hostapd_config * hostapd_config_defaults(void)
HE_OPERATION_RTS_THRESHOLD_OFFSET;
/* Set default basic MCS/NSS set to single stream MCS 0-7 */
conf->he_op.he_basic_mcs_nss_set = 0xfffc;
+ /* Set default to be decided by Driver/underlying HW */
+ conf->he_phy_capab.he_ul_mumimo = -1;
conf->he_op.he_bss_color_disabled = 1;
conf->he_op.he_bss_color_partial = 0;
conf->he_op.he_bss_color = os_random() % 63 + 1;
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 40937c8..5ca4704 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -963,6 +963,7 @@ struct he_phy_capabilities_info {
bool he_su_beamformer;
bool he_su_beamformee;
bool he_mu_beamformer;
+ int he_ul_mumimo;
};
/**
@@ -999,6 +1000,10 @@ struct eht_phy_capabilities_info {
bool su_beamformer;
bool su_beamformee;
bool mu_beamformer;
+ bool partial_bw_dl_mu_mimo;
+ bool non_ofdma_ulmumimo_80mhz;
+ bool non_ofdma_ulmumimo_160mhz;
+ bool non_ofdma_ulmumimo_320mhz;
};
/**
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 4f78b50..90ae35f 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -678,8 +678,36 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface)
#ifdef CONFIG_IEEE80211AX
+
+static int _ieee80211he_cap_check(u8 *hw, u32 offset, u8 bits)
+{
+ if (bits & hw[offset])
+ return 1;
+
+ return 0;
+}
+
static int ieee80211ax_supported_he_capab(struct hostapd_iface *iface)
{
+
+ struct hostapd_hw_modes *mode = iface->current_mode;
+ struct he_capabilities *hw = &mode->he_capab[IEEE80211_MODE_AP];
+ struct hostapd_config *conf = iface->conf;
+
+#define HE_CAP_CHECK(hw_cap, cap, bytes, conf) \
+ do { \
+ if (conf && !_ieee80211he_cap_check(hw_cap, bytes, cap)) { \
+ wpa_printf(MSG_ERROR, "Driver does not support configured" \
+ " HE capability [%s]", #cap); \
+ return 0; \
+ } \
+ } while (0)
+
+ if (conf->he_phy_capab.he_ul_mumimo != -1)
+ HE_CAP_CHECK(hw->phy_cap, HE_PHYCAP_UL_MUMIMO_CAPB,
+ HE_PHYCAP_UL_MUMIMO_CAPB_IDX,
+ conf->he_phy_capab.he_ul_mumimo);
+
return 1;
}
#endif /* CONFIG_IEEE80211AX */
diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
index 06de837..83e96e8 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -164,9 +164,21 @@ u8 * hostapd_eid_eht_capab(struct hostapd_data *hapd, u8 *eid,
~EHT_PHYCAP_SU_BEAMFORMEE;
if (!hapd->iface->conf->eht_phy_capab.mu_beamformer)
- cap->phy_cap[EHT_PHYCAP_MU_BEAMFORMER_IDX] &=
+ cap->phy_cap[EHT_PHYCAP_MU_CAPABILITY_IDX] &=
~EHT_PHYCAP_MU_BEAMFORMER_MASK;
+ if (!hapd->iface->conf->eht_phy_capab.non_ofdma_ulmumimo_80mhz)
+ cap->phy_cap[EHT_PHYCAP_MU_CAPABILITY_IDX] &=
+ ~EHT_PHYCAP_NON_OFDMA_UL_MU_MIMO_80MHZ;
+
+ if (!hapd->iface->conf->eht_phy_capab.non_ofdma_ulmumimo_160mhz)
+ cap->phy_cap[EHT_PHYCAP_MU_CAPABILITY_IDX] &=
+ ~EHT_PHYCAP_NON_OFDMA_UL_MU_MIMO_160MHZ;
+
+ if (!hapd->iface->conf->eht_phy_capab.non_ofdma_ulmumimo_320mhz)
+ cap->phy_cap[EHT_PHYCAP_MU_CAPABILITY_IDX] &=
+ ~EHT_PHYCAP_NON_OFDMA_UL_MU_MIMO_320MHZ;
+
pos = cap->optional;
mcs_nss_len = ieee80211_eht_mcs_set_size(mode->mode,
diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
index 098711f..c3af932 100644
--- a/src/ap/ieee802_11_he.c
+++ b/src/ap/ieee802_11_he.c
@@ -160,6 +160,13 @@ u8 * hostapd_eid_he_capab(struct hostapd_data *hapd, u8 *eid,
cap->he_phy_capab_info[HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX] &=
~HE_PHYCAP_MU_BEAMFORMER_CAPAB;
+ if (hapd->iface->conf->he_phy_capab.he_ul_mumimo == 1)
+ cap->he_phy_capab_info[HE_PHYCAP_UL_MUMIMO_CAPB_IDX] |=
+ HE_PHYCAP_UL_MUMIMO_CAPB;
+ else if (hapd->iface->conf->he_phy_capab.he_ul_mumimo == 0)
+ cap->he_phy_capab_info[HE_PHYCAP_UL_MUMIMO_CAPB_IDX] &=
+ ~HE_PHYCAP_UL_MUMIMO_CAPB;
+
cap->he_phy_capab_info[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] &=
he_oper_chwidth;
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index c47c0a0..2b3705b 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -2374,6 +2374,9 @@ struct ieee80211_spatial_reuse {
#define HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX 4
#define HE_PHYCAP_MU_BEAMFORMER_CAPAB ((u8) BIT(1))
+#define HE_PHYCAP_UL_MUMIMO_CAPB_IDX 2
+#define HE_PHYCAP_UL_MUMIMO_CAPB ((u8) BIT(6))
+
#define HE_PHYCAP_PPE_THRESHOLD_PRESENT_IDX 6
#define HE_PHYCAP_PPE_THRESHOLD_PRESENT ((u8) BIT(7))
@@ -2544,7 +2547,10 @@ struct ieee80211_eht_operation {
#define EHT_PHYCAP_PPE_THRESHOLD_PRESENT_IDX 5
#define EHT_PHYCAP_PPE_THRESHOLD_PRESENT ((u8) BIT(3))
-#define EHT_PHYCAP_MU_BEAMFORMER_IDX 7
+#define EHT_PHYCAP_MU_CAPABILITY_IDX 7
+#define EHT_PHYCAP_NON_OFDMA_UL_MU_MIMO_80MHZ ((u8) BIT(1))
+#define EHT_PHYCAP_NON_OFDMA_UL_MU_MIMO_160MHZ ((u8) BIT(2))
+#define EHT_PHYCAP_NON_OFDMA_UL_MU_MIMO_320MHZ ((u8) BIT(3))
#define EHT_PHYCAP_MU_BEAMFORMER_80MHZ ((u8) BIT(4))
#define EHT_PHYCAP_MU_BEAMFORMER_160MHZ ((u8) BIT(5))
#define EHT_PHYCAP_MU_BEAMFORMER_320MHZ ((u8) BIT(6))