blob: 4b7c8b4ca371d1b2bfbf47f234b4aa1cfaf0bd11 [file] [log] [blame]
developer27057f82023-07-10 17:23:13 +08001From bb2459cc960ea017702c11e19cf3dbef4df599b8 Mon Sep 17 00:00:00 2001
developerec5af762023-06-13 11:04:21 +08002From: MeiChia Chiu <meichia.chiu@mediatek.com>
developer27057f82023-07-10 17:23:13 +08003Date: Fri, 9 Jun 2023 09:03:05 +0800
4Subject: [PATCH 32/32] hostapd: mtk: Add HE capabilities check
developerec5af762023-06-13 11:04:21 +08005
6Add HE capabilities check.
7Since "HE capabilities" check has been removed by driver,
8add the support for "HE capabilities" check in hostapd.
developerec5af762023-06-13 11:04:21 +08009---
developer27057f82023-07-10 17:23:13 +080010 src/ap/hw_features.c | 26 ++++++++++++++++++++++++++
11 1 file changed, 26 insertions(+)
developerec5af762023-06-13 11:04:21 +080012
13diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
developer27057f82023-07-10 17:23:13 +080014index 828b9261b..991af2c45 100644
developerec5af762023-06-13 11:04:21 +080015--- a/src/ap/hw_features.c
16+++ b/src/ap/hw_features.c
17@@ -680,6 +680,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--
developer27057f82023-07-10 17:23:13 +0800512.39.2
developerec5af762023-06-13 11:04:21 +080052