wifi: mac80211_hwsim: always activate all links
authorJohannes Berg <johannes.berg@intel.com>
Fri, 2 Sep 2022 14:12:57 +0000 (16:12 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 6 Sep 2022 08:17:27 +0000 (10:17 +0200)
By default, even in client mode, hwsim always had all links
active, where it then uses them in a round-robin fashion.
Re-enable that by activating all valid links work right after
the connection is authorized.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c

index 0780a1c..df51b5b 100644 (file)
@@ -2476,6 +2476,14 @@ static int mac80211_hwsim_sta_state(struct ieee80211_hw *hw,
        if (old_state == IEEE80211_STA_NOTEXIST)
                return mac80211_hwsim_sta_add(hw, vif, sta);
 
+       /*
+        * when client is authorized (AP station marked as such),
+        * enable all links
+        */
+       if (vif->type == NL80211_IFTYPE_STATION &&
+           new_state == IEEE80211_STA_AUTHORIZED && !sta->tdls)
+               ieee80211_set_active_links_async(vif, vif->valid_links);
+
        return 0;
 }