wifi: mt76: mt7925: extend mt7925_mcu_sta_amsdu_tlv for per-link STA
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:24 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:55 +0000 (23:01 +0200)
Extend mt7925_mcu_sta_amsdu_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-31-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index a57620aed63bec748b397e55a7b75a0260b7a93d..57b89eca4e21ade948b28af6388eb6579967744d 100644 (file)
@@ -1467,9 +1467,11 @@ mt7925_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
 
 static void
 mt7925_mcu_sta_amsdu_tlv(struct sk_buff *skb,
-                        struct ieee80211_vif *vif, struct ieee80211_sta *sta)
+                        struct ieee80211_vif *vif,
+                        struct ieee80211_link_sta *link_sta)
 {
-       struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
+       struct mt792x_sta *msta = (struct mt792x_sta *)link_sta->sta->drv_priv;
+       struct mt792x_link_sta *mlink;
        struct sta_rec_amsdu *amsdu;
        struct tlv *tlv;
 
@@ -1477,16 +1479,18 @@ mt7925_mcu_sta_amsdu_tlv(struct sk_buff *skb,
            vif->type != NL80211_IFTYPE_AP)
                return;
 
-       if (!sta->deflink.agg.max_amsdu_len)
+       if (!link_sta->agg.max_amsdu_len)
                return;
 
        tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
        amsdu = (struct sta_rec_amsdu *)tlv;
        amsdu->max_amsdu_num = 8;
        amsdu->amsdu_en = true;
-       msta->deflink.wcid.amsdu = true;
 
-       switch (sta->deflink.agg.max_amsdu_len) {
+       mlink = mt792x_sta_to_link(msta, link_sta->link_id);
+       mlink->wcid.amsdu = true;
+
+       switch (link_sta->agg.max_amsdu_len) {
        case IEEE80211_MAX_MPDU_LEN_VHT_11454:
                amsdu->max_mpdu_size =
                        IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454;
@@ -1639,7 +1643,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
                mt7925_mcu_sta_ht_tlv(skb, info->link_sta->sta);
                mt7925_mcu_sta_vht_tlv(skb, info->link_sta->sta);
                mt76_connac_mcu_sta_uapsd(skb, info->vif, info->link_sta->sta);
-               mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta->sta);
+               mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta);
                mt7925_mcu_sta_he_tlv(skb, info->link_sta);
                mt7925_mcu_sta_he_6g_tlv(skb, info->link_sta);
                mt7925_mcu_sta_eht_tlv(skb, info->link_sta);