wifi: mt76: mt7996: Add mt7996_mac_sta_change_links callback

Intrdouce mt7996_mac_sta_change_links routine to set change_sta_links
required by mac80211. This is a preliminary patch to introduce MLO
support for MT7996 driver.

Co-developed-by: Bo Jiao <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Shayne Chen
2025-03-12 10:38:01 +01:00
committed by Felix Fietkau
parent 46e20e5d74
commit 1de1808215
+21
View File
@@ -950,6 +950,26 @@ error_unlink:
return err;
}
static int
mt7996_mac_sta_change_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, u16 old_links,
u16 new_links)
{
struct mt7996_dev *dev = mt7996_hw_dev(hw);
unsigned long add = new_links & ~old_links;
unsigned long rem = old_links & ~new_links;
int ret;
mutex_lock(&dev->mt76.mutex);
mt7996_mac_sta_remove_links(dev, sta, rem);
ret = mt7996_mac_sta_add_links(dev, vif, sta, add);
mutex_unlock(&dev->mt76.mutex);
return ret;
}
static int
mt7996_mac_sta_add(struct mt76_phy *mphy, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
@@ -1918,4 +1938,5 @@ const struct ieee80211_ops mt7996_ops = {
.net_setup_tc = mt76_wed_net_setup_tc,
#endif
.change_vif_links = mt7996_change_vif_links,
.change_sta_links = mt7996_mac_sta_change_links,
};