blob: 9a30233b365678233b2f398e928fea693a4b2cfc [file] [log] [blame]
From 5329ba85c01100c8baa328e237844d2ab1309e27 Mon Sep 17 00:00:00 2001
From: "Allen.Ye" <allen.ye@mediatek.com>
Date: Thu, 8 Jun 2023 17:32:33 +0800
Subject: [PATCH 1002/1044] mtk: wifi: mt76: mt7996: add check for hostapd
config he_ldpc
Add check for hostapd config he_ldpc.
This capabilities is checked in mcu_beacon_check_caps in 7915.
Add check for STA LDPC cap, if STA only have BCC we should not overwrite the phy_cap with config he_ldpc.
Signed-off-by: Allen.Ye <allen.ye@mediatek.com>
---
mt7996/mcu.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/mt7996/mcu.c b/mt7996/mcu.c
index 7a76d602..35233c71 100644
--- a/mt7996/mcu.c
+++ b/mt7996/mcu.c
@@ -1182,7 +1182,8 @@ int mt7996_mcu_add_rx_ba(struct mt7996_dev *dev,
}
static void
-mt7996_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
+mt7996_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
{
struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
struct ieee80211_he_mcs_nss_supp mcs_map;
@@ -1202,6 +1203,11 @@ mt7996_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
he->he_phy_cap[i] = elem->phy_cap_info[i];
}
+ if (vif->type == NL80211_IFTYPE_AP &&
+ (elem->phy_cap_info[1] & IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD))
+ u8p_replace_bits(&he->he_phy_cap[1], vif->bss_conf.he_ldpc,
+ IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD);
+
mcs_map = sta->deflink.he_cap.he_mcs_nss_supp;
switch (sta->deflink.bandwidth) {
case IEEE80211_STA_RX_BW_160:
@@ -2108,7 +2114,7 @@ int mt7996_mcu_add_rate_ctrl(struct mt7996_dev *dev, struct ieee80211_vif *vif,
* update sta_rec_he here.
*/
if (changed)
- mt7996_mcu_sta_he_tlv(skb, sta);
+ mt7996_mcu_sta_he_tlv(skb, vif, sta);
/* sta_rec_ra accommodates BW, NSS and only MCS range format
* i.e 0-{7,8,9} for VHT.
@@ -2196,7 +2202,7 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif,
/* starec amsdu */
mt7996_mcu_sta_amsdu_tlv(dev, skb, vif, sta);
/* starec he */
- mt7996_mcu_sta_he_tlv(skb, sta);
+ mt7996_mcu_sta_he_tlv(skb, vif, sta);
/* starec he 6g*/
mt7996_mcu_sta_he_6g_tlv(skb, sta);
/* starec eht */
--
2.18.0