blob: a93ae6914ca40d9a57c4de033f2bcbe49ec0b577 [file] [log] [blame]
developerdfb50982023-09-11 13:34:36 +08001From 963b6800d4416d5a88053097128a33d8bdc8f56b Mon Sep 17 00:00:00 2001
developer281084d2023-06-19 12:03:50 +08002From: MeiChia Chiu <meichia.chiu@mediatek.com>
developer8bff6472023-07-17 11:11:44 +08003Date: Fri, 9 Jun 2023 09:03:05 +0800
developerdfb50982023-09-11 13:34:36 +08004Subject: [PATCH 26/40] hostapd: mtk: Add HE capabilities check
developer281084d2023-06-19 12:03:50 +08005
6Add HE capabilities check.
7Since "HE capabilities" check has been removed by driver,
8add the support for "HE capabilities" check in hostapd.
developer281084d2023-06-19 12:03:50 +08009---
developer8bff6472023-07-17 11:11:44 +080010 src/ap/hw_features.c | 26 ++++++++++++++++++++++++++
11 1 file changed, 26 insertions(+)
developer281084d2023-06-19 12:03:50 +080012
13diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
developerdfb50982023-09-11 13:34:36 +080014index 828b926..991af2c 100644
developer281084d2023-06-19 12:03:50 +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--
developerdfb50982023-09-11 13:34:36 +0800512.18.0
developer281084d2023-06-19 12:03:50 +080052