public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Wang <sean.wang@kernel.org>
To: nbd@nbd.name, lorenzo.bianconi@redhat.com
Cc: linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH 01/19] wifi: mt76: mt7925: pass mlink to sta_amsdu_tlv()
Date: Fri,  6 Mar 2026 17:22:20 -0600	[thread overview]
Message-ID: <20260306232238.2039675-2-sean.wang@kernel.org> (raw)
In-Reply-To: <20260306232238.2039675-1-sean.wang@kernel.org>

From: Sean Wang <sean.wang@mediatek.com>

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>
---
 drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index abcdd0e0b3b5..fa5f79004a6e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -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);
-- 
2.43.0


  reply	other threads:[~2026-03-06 23:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 23:22 [PATCH 00/19] wifi: mt76: mt7925: fix up MLO link lifetime and error handling Sean Wang
2026-03-06 23:22 ` Sean Wang [this message]
2026-03-06 23:22 ` [PATCH 02/19] wifi: mt76: mt7925: pass WCID indices to bss_basic_tlv() Sean Wang
2026-03-07 13:45   ` kernel test robot
2026-03-07 17:59   ` kernel test robot
2026-03-06 23:22 ` [PATCH 03/19] wifi: mt76: mt7925: pass mlink and mconf to sta_mld_tlv() Sean Wang
2026-03-06 23:22 ` [PATCH 04/19] wifi: mt76: mt7925: pass mlink to mcu_sta_update() Sean Wang
2026-03-06 23:22 ` [PATCH 05/19] wifi: mt76: mt7925: resolve primary mlink via def_wcid Sean Wang
2026-03-06 23:22 ` [PATCH 06/19] wifi: mt76: mt7925: pass mlink to mac_link_sta_remove() Sean Wang
2026-03-06 23:22 ` [PATCH 07/19] wifi: mt76: mt7925: pass mlink to sta_hdr_trans_tlv() Sean Wang
2026-03-06 23:22 ` [PATCH 08/19] wifi: mt76: mt7925: validate mlink in sta_hdr_trans_tlv() Sean Wang
2026-03-06 23:22 ` [PATCH 09/19] wifi: mt76: mt7925: pass mlink to wtbl_update_hdr_trans() Sean Wang
2026-03-06 23:22 ` [PATCH 10/19] wifi: mt76: mt7925: pass mlink to set_link_key() Sean Wang
2026-03-06 23:22 ` [PATCH 11/19] wifi: mt76: mt7925: resolve link after acquiring mt76 mutex Sean Wang
2026-03-06 23:22 ` [PATCH 12/19] wifi: mt76: mt7925: pass mconf and mlink to wtbl_update_hdr_trans() Sean Wang
2026-03-06 23:22 ` [PATCH 13/19] wifi: mt76: mt7925: make WCID cleanup unconditional in sta_remove_links() Sean Wang
2026-03-06 23:22 ` [PATCH 14/19] wifi: mt76: mt7925: unwind WCID setup on link STA add failure Sean Wang
2026-03-06 23:22 ` [PATCH 15/19] wifi: mt76: mt7925: drop WCID reinit after publish Sean Wang
2026-03-06 23:22 ` [PATCH 16/19] wifi: mt76: mt7925: move WCID teardown into link_sta_remove() Sean Wang
2026-03-06 23:22 ` [PATCH 17/19] wifi: mt76: mt7925: switch link STA allocation to RCU lifetime Sean Wang
2026-03-06 23:22 ` [PATCH 18/19] wifi: mt76: mt7925: publish msta->link after successful link add Sean Wang
2026-03-06 23:22 ` [PATCH 19/19] wifi: mt76: mt7925: host-only unwind published links on add failure Sean Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260306232238.2039675-2-sean.wang@kernel.org \
    --to=sean.wang@kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=sean.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox