blob: 780cce4f1037341da894146d5fdd885cb62243e6 [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 4e8197027a7b86f6cf5f1d2d9095e30281693319 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: MeiChia Chiu <meichia.chiu@mediatek.com>
3Date: Fri, 9 Jun 2023 09:03:05 +0800
developer05f3b2b2024-08-19 19:17:34 +08004Subject: [PATCH 035/126] mtk: hostapd: Add HE capabilities check
developer66e89bc2024-04-23 14:50:01 +08005
developer66e89bc2024-04-23 14:50:01 +08006---
7 src/ap/hw_features.c | 26 ++++++++++++++++++++++++++
8 1 file changed, 26 insertions(+)
9
10diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
developer05f3b2b2024-08-19 19:17:34 +080011index 400c50988..2a2832cd4 100644
developer66e89bc2024-04-23 14:50:01 +080012--- a/src/ap/hw_features.c
13+++ b/src/ap/hw_features.c
developer05f3b2b2024-08-19 19:17:34 +080014@@ -722,6 +722,32 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface)
developer66e89bc2024-04-23 14:50:01 +080015 #ifdef CONFIG_IEEE80211AX
16 static int ieee80211ax_supported_he_capab(struct hostapd_iface *iface)
17 {
18+ struct hostapd_hw_modes *mode = iface->current_mode;
19+ struct he_capabilities *he_cap = &mode->he_capab[IEEE80211_MODE_AP];
20+ struct hostapd_config *conf = iface->conf;
21+
22+#define HE_CAP_CHECK(hw_cap, field, phy_idx, cfg_cap) \
23+ do { \
24+ if (cfg_cap && !(hw_cap[phy_idx] & field)) { \
25+ wpa_printf(MSG_ERROR, "Driver does not support configured" \
26+ " HE capability [%s]", #field); \
27+ return 0; \
28+ } \
29+ } while (0)
30+
31+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_LDPC_CODING_IN_PAYLOAD,
32+ HE_PHYCAP_LDPC_CODING_IN_PAYLOAD_IDX,
33+ conf->he_phy_capab.he_ldpc);
34+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_SU_BEAMFORMER_CAPAB,
35+ HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX,
36+ conf->he_phy_capab.he_su_beamformer);
37+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_SU_BEAMFORMEE_CAPAB,
38+ HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX,
39+ conf->he_phy_capab.he_su_beamformee);
40+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_MU_BEAMFORMER_CAPAB,
41+ HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX,
42+ conf->he_phy_capab.he_mu_beamformer);
43+
44 return 1;
45 }
46 #endif /* CONFIG_IEEE80211AX */
47--
developer05f3b2b2024-08-19 19:17:34 +0800482.18.0
developer66e89bc2024-04-23 14:50:01 +080049