blob: 3801eb3b377ef8b0f0ca8d02a7b381b974eb66c5 [file] [log] [blame]
From 1468c2bb212faf091cb4a0c0ba1394722eb2c94e Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Fri, 9 Jun 2023 09:03:05 +0800
Subject: [PATCH 26/54] mtk: hostapd: Add HE capabilities check
Add HE capabilities check.
Since "HE capabilities" check has been removed by driver,
add the support for "HE capabilities" check in hostapd.
---
src/ap/hw_features.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 9d2272522..9a36bcb10 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -709,6 +709,32 @@ static int ieee80211ac_supported_vht_capab(struct hostapd_iface *iface)
#ifdef CONFIG_IEEE80211AX
static int ieee80211ax_supported_he_capab(struct hostapd_iface *iface)
{
+ struct hostapd_hw_modes *mode = iface->current_mode;
+ struct he_capabilities *he_cap = &mode->he_capab[IEEE80211_MODE_AP];
+ struct hostapd_config *conf = iface->conf;
+
+#define HE_CAP_CHECK(hw_cap, field, phy_idx, cfg_cap) \
+ do { \
+ if (cfg_cap && !(hw_cap[phy_idx] & field)) { \
+ wpa_printf(MSG_ERROR, "Driver does not support configured" \
+ " HE capability [%s]", #field); \
+ return 0; \
+ } \
+ } while (0)
+
+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_LDPC_CODING_IN_PAYLOAD,
+ HE_PHYCAP_LDPC_CODING_IN_PAYLOAD_IDX,
+ conf->he_phy_capab.he_ldpc);
+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_SU_BEAMFORMER_CAPAB,
+ HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX,
+ conf->he_phy_capab.he_su_beamformer);
+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_SU_BEAMFORMEE_CAPAB,
+ HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX,
+ conf->he_phy_capab.he_su_beamformee);
+ HE_CAP_CHECK(he_cap->phy_cap, HE_PHYCAP_MU_BEAMFORMER_CAPAB,
+ HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX,
+ conf->he_phy_capab.he_mu_beamformer);
+
return 1;
}
#endif /* CONFIG_IEEE80211AX */
--
2.18.0