blob: c9fc8b7062029261c06af0c46f7925acf406c6c4 [file] [log] [blame]
developer66e89bc2024-04-23 14:50:01 +08001From 2dd00ec0a8231bd8c6893f9517875ad94022f9b2 Mon Sep 17 00:00:00 2001
2From: MeiChia Chiu <meichia.chiu@mediatek.com>
3Date: Fri, 9 Jun 2023 09:03:05 +0800
4Subject: [PATCH 053/104] mtk: hostapd: Add HE capabilities check
5
6Add HE capabilities check.
7Since "HE capabilities" check has been removed by driver,
8add the support for "HE capabilities" check in hostapd.
9---
10 src/ap/hw_features.c | 26 ++++++++++++++++++++++++++
11 1 file changed, 26 insertions(+)
12
13diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
14index 672e43a10..a35c5974a 100644
15--- a/src/ap/hw_features.c
16+++ b/src/ap/hw_features.c
17@@ -709,6 +709,32 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface)
18 #ifdef CONFIG_IEEE80211AX
19 static int ieee80211ax_supported_he_capab(struct hostapd_iface *iface)
20 {
21+ struct hostapd_hw_modes *mode = iface->current_mode;
22+ struct he_capabilities *he_cap = &mode->he_capab[IEEE80211_MODE_AP];
23+ struct hostapd_config *conf = iface->conf;
24+
25+#define HE_CAP_CHECK(hw_cap, field, phy_idx, cfg_cap) \
26+ do { \
27+ if (cfg_cap && !(hw_cap[phy_idx] & field)) { \
28+ wpa_printf(MSG_ERROR, "Driver does not support configured" \
29+ " HE capability [%s]", #field); \
30+ return 0; \
31+ } \
32+ } while (0)
33+
34+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_LDPC_CODING_IN_PAYLOAD,
35+ HE_PHYCAP_LDPC_CODING_IN_PAYLOAD_IDX,
36+ conf->he_phy_capab.he_ldpc);
37+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_SU_BEAMFORMER_CAPAB,
38+ HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX,
39+ conf->he_phy_capab.he_su_beamformer);
40+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_SU_BEAMFORMEE_CAPAB,
41+ HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX,
42+ conf->he_phy_capab.he_su_beamformee);
43+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_MU_BEAMFORMER_CAPAB,
44+ HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX,
45+ conf->he_phy_capab.he_mu_beamformer);
46+
47 return 1;
48 }
49 #endif /* CONFIG_IEEE80211AX */
50--
512.39.2
52