wifi: mac80211_hwsim: Handle BSS_CHANGED_VALID_LINKS
authorIlan Peer <ilan.peer@intel.com>
Wed, 20 Sep 2023 18:25:23 +0000 (21:25 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Sep 2023 07:12:33 +0000 (09:12 +0200)
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>
Link: https://lore.kernel.org/r/20230920211508.6218307226d3.I249f52b4773423a33c3121e31002abe0a8d98e78@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/virtual/mac80211_hwsim.c

index 17ecd5fe7258efa1631e98bd8ef3af393faa1cdf..c7b4414cc6c3e0127adbcaa55ecb01db02f4c977 100644 (file)
@@ -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,