blob: f02a3ebc4a7f007b4096d6ea1159c8c72caa81fa [file] [log] [blame]
developer9237f442024-06-14 17:13:04 +08001From 4974096ee9b3e3a6083da610ce13dde3b82608c9 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: "Allen.Ye" <allen.ye@mediatek.com>
3Date: Thu, 8 Jun 2023 17:32:33 +0800
developer9237f442024-06-14 17:13:04 +08004Subject: [PATCH 020/116] mtk: wifi: mt76: mt7996: add check for hostapd config
developer66e89bc2024-04-23 14:50:01 +08005 he_ldpc
6
7Add check for hostapd config he_ldpc.
8This capabilities is checked in mcu_beacon_check_caps in 7915.
9
10Add check for STA LDPC cap, if STA only have BCC we should not overwrite the phy_cap with config he_ldpc.
11
developer66e89bc2024-04-23 14:50:01 +080012Signed-off-by: Allen.Ye <allen.ye@mediatek.com>
13---
14 mt7996/mcu.c | 12 +++++++++---
15 1 file changed, 9 insertions(+), 3 deletions(-)
16
17diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developer9237f442024-06-14 17:13:04 +080018index 90332fe..6c565c9 100644
developer66e89bc2024-04-23 14:50:01 +080019--- a/mt7996/mcu.c
20+++ b/mt7996/mcu.c
21@@ -1188,7 +1188,8 @@ int mt7996_mcu_add_rx_ba(struct mt7996_dev *dev,
22 }
23
24 static void
25-mt7996_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
26+mt7996_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
27+ struct ieee80211_sta *sta)
28 {
29 struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
30 struct ieee80211_he_mcs_nss_supp mcs_map;
31@@ -1208,6 +1209,11 @@ mt7996_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
32 he->he_phy_cap[i] = elem->phy_cap_info[i];
33 }
34
35+ if (vif->type == NL80211_IFTYPE_AP &&
36+ (elem->phy_cap_info[1] & IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD))
37+ u8p_replace_bits(&he->he_phy_cap[1], vif->bss_conf.he_ldpc,
38+ IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD);
39+
40 mcs_map = sta->deflink.he_cap.he_mcs_nss_supp;
41 switch (sta->deflink.bandwidth) {
42 case IEEE80211_STA_RX_BW_160:
43@@ -2113,7 +2119,7 @@ int mt7996_mcu_add_rate_ctrl(struct mt7996_dev *dev, struct ieee80211_vif *vif,
44 * update sta_rec_he here.
45 */
46 if (changed)
47- mt7996_mcu_sta_he_tlv(skb, sta);
48+ mt7996_mcu_sta_he_tlv(skb, vif, sta);
49
50 /* sta_rec_ra accommodates BW, NSS and only MCS range format
51 * i.e 0-{7,8,9} for VHT.
52@@ -2201,7 +2207,7 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif,
53 /* starec amsdu */
54 mt7996_mcu_sta_amsdu_tlv(dev, skb, vif, sta);
55 /* starec he */
56- mt7996_mcu_sta_he_tlv(skb, sta);
57+ mt7996_mcu_sta_he_tlv(skb, vif, sta);
58 /* starec he 6g*/
59 mt7996_mcu_sta_he_6g_tlv(skb, sta);
60 /* starec eht */
61--
developer9237f442024-06-14 17:13:04 +0800622.18.0
developer66e89bc2024-04-23 14:50:01 +080063