diff mbox series

[12/18] wifi: mac80211_hwsim: Handle BSS_CHANGED_VALID_LINKS

Message ID 20230918140607.5819e367edc2.I249f52b4773423a33c3121e31002abe0a8d98e78@changeid
State New
Headers show
Series [01/18] wifi: mac80211: use bandwidth indication element for CSA | expand

Commit Message

Greenman, Gregory Sept. 18, 2023, 11:10 a.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

In station mode, set the active links to all the usable
links.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/virtual/mac80211_hwsim.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
index 17ecd5fe7258..c7b4414cc6c3 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -2445,6 +2445,14 @@  static void mac80211_hwsim_vif_info_changed(struct ieee80211_hw *hw,
 		vp->assoc = vif->cfg.assoc;
 		vp->aid = vif->cfg.aid;
 	}
+
+	if (vif->type == NL80211_IFTYPE_STATION &&
+	    changed & BSS_CHANGED_MLD_VALID_LINKS) {
+		u16 usable_links = ieee80211_vif_usable_links(vif);
+
+		if (vif->active_links != usable_links)
+			ieee80211_set_active_links_async(vif, usable_links);
+	}
 }
 
 static void mac80211_hwsim_link_info_changed(struct ieee80211_hw *hw,