wifi: mac80211: reactivate multi-link later in restart
authorJohannes Berg <johannes.berg@intel.com>
Wed, 20 Mar 2024 07:14:05 +0000 (09:14 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2024 14:39:29 +0000 (15:39 +0100)
In case of restart, we currently reactivate multi-link on
interfaces before reconfiguring keys etc. which means the
drivers need to handle this case differently. Enable more
links later to allow them to handle it the same way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.d0f18a56335d.Ib3338d93872a4a568f38db0d02546534d3eff810@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/util.c

index fe81ab6416207f76b1170232d4895e0c7dc7e1b9..def611e4e55feac5b72ccedeb32d47660c2d637a 100644 (file)
@@ -1161,6 +1161,8 @@ struct ieee80211_sub_if_data {
        struct wiphy_work activate_links_work;
        u16 desired_active_links;
 
+       u16 restart_active_links;
+
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct {
                struct dentry *subdir_stations;
index a5d5e05688b44db3985d950abdf6f28afc8de3c3..cda398d8f60da9e8703a543cf285d762a4823370 100644 (file)
@@ -1932,6 +1932,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                                             old);
                }
 
+               sdata->restart_active_links = active_links;
+
                for (link_id = 0;
                     link_id < ARRAY_SIZE(sdata->vif.link_conf);
                     link_id++) {
@@ -2059,9 +2061,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                        WARN_ON(1);
                        break;
                }
-
-               if (active_links)
-                       ieee80211_set_active_links(&sdata->vif, active_links);
        }
 
        ieee80211_recalc_ps(local);
@@ -2102,6 +2101,13 @@ int ieee80211_reconfig(struct ieee80211_local *local)
        list_for_each_entry(sdata, &local->interfaces, list)
                ieee80211_reenable_keys(sdata);
 
+       /* re-enable multi-link for client interfaces */
+       list_for_each_entry(sdata, &local->interfaces, list) {
+               if (sdata->restart_active_links)
+                       ieee80211_set_active_links(&sdata->vif,
+                                                  sdata->restart_active_links);
+       }
+
        /* Reconfigure sched scan if it was interrupted by FW restart */
        sched_scan_sdata = rcu_dereference_protected(local->sched_scan_sdata,
                                                lockdep_is_held(&local->hw.wiphy->mtx));