summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-09-02 16:12:57 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-09-06 10:17:27 +0200
commit8fb7e2ef4bab89a7a266ff9ea4d284d0552f4b0d (patch)
tree1b87fd4c0e96f500f30b2ea2d4332cf2f5f951f3
parent3d901102922723eedce6ef10ebd03315a7abb8a5 (diff)
downloadlinux-8fb7e2ef4bab89a7a266ff9ea4d284d0552f4b0d.tar.bz2
wifi: mac80211_hwsim: always activate all links
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>
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 0780a1cc63a4..df51b5b1f171 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -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;
}