mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: Enable MLO support for client interfaces
Report MT7996 MLO STA capabilities to mac80211 stack. 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:
committed by
Felix Fietkau
parent
08df8dd7b0
commit
15fa4e33ee
+52
@@ -2051,3 +2051,55 @@ void mt76_vif_cleanup(struct mt76_dev *dev, struct ieee80211_vif *vif)
|
||||
mt76_abort_roc(mvif->roc_phy);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_vif_cleanup);
|
||||
|
||||
u16 mt76_select_links(struct ieee80211_vif *vif, int max_active_links)
|
||||
{
|
||||
unsigned long usable_links = ieee80211_vif_usable_links(vif);
|
||||
struct {
|
||||
u8 link_id;
|
||||
enum nl80211_band band;
|
||||
} data[IEEE80211_MLD_MAX_NUM_LINKS];
|
||||
unsigned int link_id;
|
||||
int i, n_data = 0;
|
||||
u16 sel_links = 0;
|
||||
|
||||
if (!ieee80211_vif_is_mld(vif))
|
||||
return 0;
|
||||
|
||||
if (vif->active_links == usable_links)
|
||||
return vif->active_links;
|
||||
|
||||
rcu_read_lock();
|
||||
for_each_set_bit(link_id, &usable_links, IEEE80211_MLD_MAX_NUM_LINKS) {
|
||||
struct ieee80211_bss_conf *link_conf;
|
||||
|
||||
link_conf = rcu_dereference(vif->link_conf[link_id]);
|
||||
if (WARN_ON_ONCE(!link_conf))
|
||||
continue;
|
||||
|
||||
data[n_data].link_id = link_id;
|
||||
data[n_data].band = link_conf->chanreq.oper.chan->band;
|
||||
n_data++;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
for (i = 0; i < n_data; i++) {
|
||||
int j;
|
||||
|
||||
if (!(BIT(data[i].link_id) & vif->active_links))
|
||||
continue;
|
||||
|
||||
sel_links = BIT(data[i].link_id);
|
||||
for (j = 0; j < n_data; j++) {
|
||||
if (data[i].band != data[j].band) {
|
||||
sel_links |= BIT(data[j].link_id);
|
||||
if (hweight16(sel_links) == max_active_links)
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return sel_links;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_select_links);
|
||||
|
||||
Reference in New Issue
Block a user