Skip to content

Commit 0be996b

Browse files
committed
wifi: mt76: mt7996: Update mt7996_tx to MLO support
JIRA: https://issues.redhat.com/browse/RHEL-89169 commit 3ce8acb Author: Lorenzo Bianconi <lorenzo@kernel.org> Date: Wed Mar 12 12:14:05 2025 +0100 wifi: mt76: mt7996: Update mt7996_tx to MLO support Rework mt7996_tx routine in order to support multi-link setup. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20250312-b4-mt7996-mlo-p2-v1-21-015b3d6fd928@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent 89977ae commit 0be996b

File tree

1 file changed

+20
-11
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7996

1 file changed

+20
-11
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/main.c

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,12 +1200,18 @@ static void mt7996_tx(struct ieee80211_hw *hw,
12001200
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
12011201
struct ieee80211_vif *vif = info->control.vif;
12021202
struct mt76_wcid *wcid = &dev->mt76.global_wcid;
1203+
u8 link_id = u32_get_bits(info->control.flags,
1204+
IEEE80211_TX_CTRL_MLO_LINK);
1205+
1206+
rcu_read_lock();
12031207

12041208
if (vif) {
1205-
struct mt7996_vif *mvif;
1209+
struct mt7996_vif *mvif = (void *)vif->drv_priv;
1210+
struct mt76_vif_link *mlink;
12061211

1207-
mvif = (struct mt7996_vif *)vif->drv_priv;
1208-
wcid = &mvif->deflink.msta_link.wcid;
1212+
mlink = rcu_dereference(mvif->mt76.link[link_id]);
1213+
if (mlink && mlink->wcid)
1214+
wcid = mlink->wcid;
12091215

12101216
if (mvif->mt76.roc_phy &&
12111217
(info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)) {
@@ -1217,19 +1223,22 @@ static void mt7996_tx(struct ieee80211_hw *hw,
12171223
}
12181224
}
12191225

1220-
if (control->sta) {
1221-
struct mt7996_sta_link *msta_link;
1222-
1223-
msta_link = (struct mt7996_sta_link *)control->sta->drv_priv;
1224-
wcid = &msta_link->wcid;
1225-
}
1226-
12271226
if (!mphy) {
12281227
ieee80211_free_txskb(hw, skb);
1229-
return;
1228+
goto unlock;
12301229
}
12311230

1231+
if (control->sta) {
1232+
struct mt7996_sta *msta = (void *)control->sta->drv_priv;
1233+
struct mt7996_sta_link *msta_link;
1234+
1235+
msta_link = rcu_dereference(msta->link[link_id]);
1236+
if (msta_link)
1237+
wcid = &msta_link->wcid;
1238+
}
12321239
mt76_tx(mphy, control->sta, wcid, skb);
1240+
unlock:
1241+
rcu_read_unlock();
12331242
}
12341243

12351244
static int mt7996_set_rts_threshold(struct ieee80211_hw *hw, u32 val)

0 commit comments

Comments
 (0)