wifi: mt76: mt7925: extend mt7925_mcu_sta_ht_tlv for per-link STA
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:26 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:56 +0000 (23:01 +0200)
Extend mt7925_mcu_sta_ht_tlv with the per-link STA configuration.

The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.

Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20240613030241.5771-33-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index 1b66dd26bd1e6a17691aee6306e567f7ba03fe8b..66d45d676739f080773c7ff65b34da29242a8d84 100644 (file)
@@ -1433,18 +1433,18 @@ mt7925_mcu_sta_eht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta)
 }
 
 static void
-mt7925_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
+mt7925_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta)
 {
        struct sta_rec_ht *ht;
        struct tlv *tlv;
 
-       if (!sta->deflink.ht_cap.ht_supported)
+       if (!link_sta->ht_cap.ht_supported)
                return;
 
        tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
 
        ht = (struct sta_rec_ht *)tlv;
-       ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
+       ht->ht_cap = cpu_to_le16(link_sta->ht_cap.cap);
 }
 
 static void
@@ -1640,7 +1640,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
                                              info->enable, info->newly);
        if (info->link_sta && info->enable) {
                mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta->sta);
-               mt7925_mcu_sta_ht_tlv(skb, info->link_sta->sta);
+               mt7925_mcu_sta_ht_tlv(skb, info->link_sta);
                mt7925_mcu_sta_vht_tlv(skb, info->link_sta);
                mt76_connac_mcu_sta_uapsd(skb, info->vif, info->link_sta->sta);
                mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta);