mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: use correct link_id when filling TXD and TXP
Obtain the correct link ID and, if needed, switch to the corresponding wcid before populating the TX descriptor and TX payload. Rules for link id: - For QoS data of MLD peers (excluding EAPOL), select the primary or secondary wcid based on whether the TID is odd or even to meet FW/HW requirements - For other packets, use IEEE80211_TX_CTRL_MLO_LINK if specified (such as multicast and broadcast packets) Signed-off-by: Shayne Chen <[email protected]> Acked-by: Lorenzo Bianconi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
e9fe8bc03e
commit
0503946655
@@ -962,6 +962,7 @@ mt7996_mac_sta_init_link(struct mt7996_dev *dev,
|
||||
|
||||
msta_link = &msta->deflink;
|
||||
msta->deflink_id = link_id;
|
||||
msta->seclink_id = msta->deflink_id;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(sta->txq); i++) {
|
||||
struct mt76_txq *mtxq;
|
||||
@@ -976,6 +977,11 @@ mt7996_mac_sta_init_link(struct mt7996_dev *dev,
|
||||
msta_link = kzalloc(sizeof(*msta_link), GFP_KERNEL);
|
||||
if (!msta_link)
|
||||
return -ENOMEM;
|
||||
|
||||
if (msta->seclink_id == msta->deflink_id &&
|
||||
(sta->valid_links & ~BIT(msta->deflink_id)))
|
||||
msta->seclink_id = __ffs(sta->valid_links &
|
||||
~BIT(msta->deflink_id));
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&msta_link->rc_list);
|
||||
@@ -1050,6 +1056,8 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
if (msta->deflink_id == link_id) {
|
||||
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
|
||||
continue;
|
||||
} else if (msta->seclink_id == link_id) {
|
||||
msta->seclink_id = IEEE80211_LINK_UNSPECIFIED;
|
||||
}
|
||||
|
||||
kfree_rcu(msta_link, rcu_head);
|
||||
@@ -1145,6 +1153,7 @@ mt7996_mac_sta_add(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
|
||||
msta->seclink_id = IEEE80211_LINK_UNSPECIFIED;
|
||||
msta->vif = mvif;
|
||||
err = mt7996_mac_sta_add_links(dev, vif, sta, links);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user