* [PATCH 2/3] wifi: mt76: mt7925: pass WCID explicitly to mt7925_mcu_sta_ba()
2026-04-25 15:47 [PATCH 1/3] wifi: mt76: mt7925: keep TX BA state in the primary WCID sean.wang
@ 2026-04-25 15:47 ` sean.wang
2026-04-25 15:47 ` [PATCH 3/3] wifi: mt76: mt7925: program BA state on active links sean.wang
1 sibling, 0 replies; 3+ messages in thread
From: sean.wang @ 2026-04-25 15:47 UTC (permalink / raw)
To: nbd, lorenzo.bianconi
Cc: linux-wireless, linux-mediatek, Sean Wang, Yao Ting Hsieh
From: Sean Wang <sean.wang@mediatek.com>
mt7925_mcu_sta_ba() currently hides the BA target behind an implicit WCID
lookup.
Pass the WCID explicitly so the caller controls which BA context is being
programmed.
No functional change intended.
Tested-by: Yao Ting Hsieh <yao-ting.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 37cdf3e8a067..c720d21c1727 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -624,9 +624,8 @@ void mt7925_mcu_rx_event(struct mt792x_dev *dev, struct sk_buff *skb)
static int
mt7925_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif_link *mvif,
struct ieee80211_ampdu_params *params,
- bool enable, bool tx)
+ struct mt76_wcid *wcid, bool enable, bool tx)
{
- struct mt76_wcid *wcid = (struct mt76_wcid *)params->sta->drv_priv;
struct sta_rec_ba_uni *ba;
struct sk_buff *skb;
struct tlv *tlv;
@@ -664,6 +663,7 @@ int mt7925_mcu_uni_tx_ba(struct mt792x_dev *dev,
msta->deflink.wcid.amsdu = false;
return mt7925_mcu_sta_ba(&dev->mt76, &mvif->bss_conf.mt76, params,
+ &msta->deflink.wcid,
enable, true);
}
@@ -675,6 +675,7 @@ int mt7925_mcu_uni_rx_ba(struct mt792x_dev *dev,
struct mt792x_vif *mvif = msta->vif;
return mt7925_mcu_sta_ba(&dev->mt76, &mvif->bss_conf.mt76, params,
+ &msta->deflink.wcid,
enable, false);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 3/3] wifi: mt76: mt7925: program BA state on active links
2026-04-25 15:47 [PATCH 1/3] wifi: mt76: mt7925: keep TX BA state in the primary WCID sean.wang
2026-04-25 15:47 ` [PATCH 2/3] wifi: mt76: mt7925: pass WCID explicitly to mt7925_mcu_sta_ba() sean.wang
@ 2026-04-25 15:47 ` sean.wang
1 sibling, 0 replies; 3+ messages in thread
From: sean.wang @ 2026-04-25 15:47 UTC (permalink / raw)
To: nbd, lorenzo.bianconi
Cc: linux-wireless, linux-mediatek, Sean Wang, Yao Ting Hsieh
From: Sean Wang <sean.wang@mediatek.com>
With MLO, traffic for one TID can be sent on any active link. Programming
BA state only on the default link leaves the other active links out of
sync.
Program BA state on all active links instead.
Fixes: 766ea2cf5a39 ("Revert "wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO"")
Tested-by: Yao Ting Hsieh <yao-ting.hsieh@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
.../net/wireless/mediatek/mt76/mt7925/main.c | 10 +--
.../net/wireless/mediatek/mt76/mt7925/mcu.c | 67 ++++++++++++++-----
.../wireless/mediatek/mt76/mt7925/mt7925.h | 4 +-
3 files changed, 59 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 73d3722739d0..7c20fd9522cf 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -1372,22 +1372,22 @@ mt7925_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
case IEEE80211_AMPDU_RX_START:
mt76_rx_aggr_start(&dev->mt76, &msta->deflink.wcid, tid, ssn,
params->buf_size);
- mt7925_mcu_uni_rx_ba(dev, params, true);
+ mt7925_mcu_uni_rx_ba(dev, params, vif, true);
break;
case IEEE80211_AMPDU_RX_STOP:
mt76_rx_aggr_stop(&dev->mt76, &msta->deflink.wcid, tid);
- mt7925_mcu_uni_rx_ba(dev, params, false);
+ mt7925_mcu_uni_rx_ba(dev, params, vif, false);
break;
case IEEE80211_AMPDU_TX_OPERATIONAL:
mtxq->aggr = true;
mtxq->send_bar = false;
- mt7925_mcu_uni_tx_ba(dev, params, true);
+ mt7925_mcu_uni_tx_ba(dev, params, vif, true);
break;
case IEEE80211_AMPDU_TX_STOP_FLUSH:
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
mtxq->aggr = false;
clear_bit(tid, &msta->deflink.wcid.ampdu_state);
- mt7925_mcu_uni_tx_ba(dev, params, false);
+ mt7925_mcu_uni_tx_ba(dev, params, vif, false);
break;
case IEEE80211_AMPDU_TX_START:
set_bit(tid, &msta->deflink.wcid.ampdu_state);
@@ -1396,7 +1396,7 @@ mt7925_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
case IEEE80211_AMPDU_TX_STOP_CONT:
mtxq->aggr = false;
clear_bit(tid, &msta->deflink.wcid.ampdu_state);
- mt7925_mcu_uni_tx_ba(dev, params, false);
+ mt7925_mcu_uni_tx_ba(dev, params, vif, false);
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index c720d21c1727..b6f7e4a94f57 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -651,32 +651,69 @@ mt7925_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif_link *mvif,
MCU_UNI_CMD(STA_REC_UPDATE), true);
}
-/** starec & wtbl **/
int mt7925_mcu_uni_tx_ba(struct mt792x_dev *dev,
struct ieee80211_ampdu_params *params,
- bool enable)
+ struct ieee80211_vif *vif, bool enable)
{
- struct mt792x_sta *msta = (struct mt792x_sta *)params->sta->drv_priv;
- struct mt792x_vif *mvif = msta->vif;
+ struct ieee80211_sta *sta = params->sta;
+ struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
+ struct ieee80211_link_sta *link_sta;
+ unsigned int link_id;
+
+ for_each_sta_active_link(vif, sta, link_sta, link_id) {
+ struct mt792x_link_sta *mlink;
+ struct mt792x_bss_conf *mconf;
+ int ret;
+
+ mlink = mt792x_sta_to_link(msta, link_id);
+ if (!mlink)
+ return -EINVAL;
- if (enable && !params->amsdu)
- msta->deflink.wcid.amsdu = false;
+ mconf = mt792x_vif_to_link(msta->vif, link_id);
+ if (!mconf)
+ return -EINVAL;
+
+ if (enable && !params->amsdu)
+ mlink->wcid.amsdu = false;
- return mt7925_mcu_sta_ba(&dev->mt76, &mvif->bss_conf.mt76, params,
- &msta->deflink.wcid,
- enable, true);
+ ret = mt7925_mcu_sta_ba(&dev->mt76, &mconf->mt76, params,
+ &mlink->wcid, enable, true);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
int mt7925_mcu_uni_rx_ba(struct mt792x_dev *dev,
struct ieee80211_ampdu_params *params,
- bool enable)
+ struct ieee80211_vif *vif, bool enable)
{
- struct mt792x_sta *msta = (struct mt792x_sta *)params->sta->drv_priv;
- struct mt792x_vif *mvif = msta->vif;
+ struct ieee80211_sta *sta = params->sta;
+ struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
+ struct ieee80211_link_sta *link_sta;
+ unsigned int link_id;
+
+ for_each_sta_active_link(vif, sta, link_sta, link_id) {
+ struct mt792x_link_sta *mlink;
+ struct mt792x_bss_conf *mconf;
+ int ret;
+
+ mlink = mt792x_sta_to_link(msta, link_id);
+ if (!mlink)
+ return -EINVAL;
- return mt7925_mcu_sta_ba(&dev->mt76, &mvif->bss_conf.mt76, params,
- &msta->deflink.wcid,
- enable, false);
+ mconf = mt792x_vif_to_link(msta->vif, link_id);
+ if (!mconf)
+ return -EINVAL;
+
+ ret = mt7925_mcu_sta_ba(&dev->mt76, &mconf->mt76, params,
+ &mlink->wcid, enable, false);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
static int mt7925_mcu_read_eeprom(struct mt792x_dev *dev, u32 offset, u8 *val)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
index 46b480f7d813..01d033fb1433 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
@@ -293,10 +293,10 @@ int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev,
bool enable);
int mt7925_mcu_uni_tx_ba(struct mt792x_dev *dev,
struct ieee80211_ampdu_params *params,
- bool enable);
+ struct ieee80211_vif *vif, bool enable);
int mt7925_mcu_uni_rx_ba(struct mt792x_dev *dev,
struct ieee80211_ampdu_params *params,
- bool enable);
+ struct ieee80211_vif *vif, bool enable);
void mt7925_mlo_pm_work(struct work_struct *work);
void mt7925_scan_work(struct work_struct *work);
void mt7925_roc_work(struct work_struct *work);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread