developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 1 | From 4974096ee9b3e3a6083da610ce13dde3b82608c9 Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: "Allen.Ye" <allen.ye@mediatek.com> |
| 3 | Date: Thu, 8 Jun 2023 17:32:33 +0800 |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 4 | Subject: [PATCH 020/116] mtk: wifi: mt76: mt7996: add check for hostapd config |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | he_ldpc |
| 6 | |
| 7 | Add check for hostapd config he_ldpc. |
| 8 | This capabilities is checked in mcu_beacon_check_caps in 7915. |
| 9 | |
| 10 | Add check for STA LDPC cap, if STA only have BCC we should not overwrite the phy_cap with config he_ldpc. |
| 11 | |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 12 | Signed-off-by: Allen.Ye <allen.ye@mediatek.com> |
| 13 | --- |
| 14 | mt7996/mcu.c | 12 +++++++++--- |
| 15 | 1 file changed, 9 insertions(+), 3 deletions(-) |
| 16 | |
| 17 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 18 | index 90332fe..6c565c9 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 19 | --- 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 | -- |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 62 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 63 | |