]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7925: pass mlink to sta_amsdu_tlv()
authorSean Wang <sean.wang@mediatek.com>
Fri, 6 Mar 2026 23:22:20 +0000 (17:22 -0600)
committerFelix Fietkau <nbd@nbd.name>
Tue, 24 Mar 2026 15:49:31 +0000 (15:49 +0000)
Drop the mt792x_sta_to_link() lookup in mt7925_mcu_sta_amsdu_tlv() and
pass mlink from the caller instead. The link context is already known
so the lookup is redundant.

This makes link ownership explicit and keeps the helper lookup-free.

No functional change intended.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260306232238.2039675-2-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index abcdd0e0b3b5aec2cbb8e47be237914986d6b690..fa5f79004a6e2dd7ffadcb1074c83cd66614e2cf 100644 (file)
@@ -1726,10 +1726,9 @@ mt7925_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta)
 static void
 mt7925_mcu_sta_amsdu_tlv(struct sk_buff *skb,
                         struct ieee80211_vif *vif,
-                        struct ieee80211_link_sta *link_sta)
+                        struct ieee80211_link_sta *link_sta,
+                        struct mt792x_link_sta *mlink)
 {
-       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;
 
@@ -1745,7 +1744,6 @@ mt7925_mcu_sta_amsdu_tlv(struct sk_buff *skb,
        amsdu->max_amsdu_num = 8;
        amsdu->amsdu_en = true;
 
-       mlink = mt792x_sta_to_link(msta, link_sta->link_id);
        mlink->wcid.amsdu = true;
 
        switch (link_sta->agg.max_amsdu_len) {
@@ -1966,6 +1964,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
        struct mt792x_vif *mvif = (struct mt792x_vif *)info->vif->drv_priv;
        struct mt76_dev *dev = phy->dev;
        struct mt792x_bss_conf *mconf;
+       struct mt792x_link_sta *mlink;
        struct sk_buff *skb;
        int conn_state;
 
@@ -1980,6 +1979,8 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
                                    CONN_STATE_DISCONNECT;
 
        if (info->enable && info->link_sta) {
+               mlink = container_of(info->wcid, struct mt792x_link_sta, wcid);
+
                mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
                                              info->link_sta,
                                              conn_state, info->newly);
@@ -1987,7 +1988,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
                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);
+               mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta, mlink);
                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);