| From 8acf6c19fc99fc2183e62fd04b1c7b7c6ae82d3a 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 021/116] 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. |
| |
| CR-Id: WCNCR00259302 |
| Change-Id: I6d6f59df8897e3c00f2e0a1e3c6e5701e31c5e4b |
| Change-Id: Ibe7e40ec1dbb40bd3f3d96741e9933ec00b50df0 |
| 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 57cfa1494..bad370839 100644 |
| --- a/mt7996/mcu.c |
| +++ b/mt7996/mcu.c |
| @@ -1188,7 +1188,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; |
| @@ -1208,6 +1209,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: |
| @@ -2113,7 +2119,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. |
| @@ -2201,7 +2207,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.39.2 |
| |