wifi: mac80211: move color change finalize to wiphy work
authorJohannes Berg <johannes.berg@intel.com>
Mon, 28 Aug 2023 11:59:51 +0000 (13:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 09:27:21 +0000 (11:27 +0200)
Again this should be per link and will get cancellation
issues, move it to a wiphy work.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/iface.c
net/mac80211/link.c

index 75fa3c90b1b4bff2a7de1d86febbd24ca584da83..1fa389b67aaa7d77d57d3cbb796a4d3978363f64 100644 (file)
@@ -4745,7 +4745,8 @@ static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata)
        return 0;
 }
 
-void ieee80211_color_change_finalize_work(struct work_struct *work)
+void ieee80211_color_change_finalize_work(struct wiphy *wiphy,
+                                         struct wiphy_work *work)
 {
        struct ieee80211_sub_if_data *sdata =
                container_of(work, struct ieee80211_sub_if_data,
@@ -4786,8 +4787,8 @@ void ieee80211_color_change_finish(struct ieee80211_vif *vif)
 {
        struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
 
-       ieee80211_queue_work(&sdata->local->hw,
-                            &sdata->deflink.color_change_finalize_work);
+       wiphy_work_queue(sdata->local->hw.wiphy,
+                        &sdata->deflink.color_change_finalize_work);
 }
 EXPORT_SYMBOL_GPL(ieee80211_color_change_finish);
 
index 8d9ced5180870d0d609795298301f89e9b05c0b4..8d53ab9732f99ae2ce6e7fc9cf34ace4e1ac8833 100644 (file)
@@ -997,7 +997,7 @@ struct ieee80211_link_data {
 
        struct cfg80211_chan_def csa_chandef;
 
-       struct work_struct color_change_finalize_work;
+       struct wiphy_work color_change_finalize_work;
        struct delayed_work color_collision_detect_work;
        u64 color_bitmap;
 
@@ -1994,7 +1994,8 @@ int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
                             struct cfg80211_csa_settings *params);
 
 /* color change handling */
-void ieee80211_color_change_finalize_work(struct work_struct *work);
+void ieee80211_color_change_finalize_work(struct wiphy *wiphy,
+                                         struct wiphy_work *work);
 void ieee80211_color_collision_detection_work(struct work_struct *work);
 
 /* interface handling */
index 3b419af7720cac0f211941946dc21cbaa2390c99..e09fec1507a6845ac6af1c7c67eb3e0a6749177b 100644 (file)
@@ -535,9 +535,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
        mutex_unlock(&local->mtx);
        sdata_unlock(sdata);
 
-       cancel_work_sync(&sdata->deflink.color_change_finalize_work);
-
        wiphy_work_cancel(local->hw.wiphy, &sdata->deflink.csa_finalize_work);
+       wiphy_work_cancel(local->hw.wiphy,
+                         &sdata->deflink.color_change_finalize_work);
        wiphy_delayed_work_cancel(local->hw.wiphy,
                                  &sdata->deflink.dfs_cac_timer_work);
 
index 2f7e2fc60be35045a712fca7cf6e8ca5eed40056..72b5000502a54cdc96d8e25ebacfdb82ba3ced0e 100644 (file)
@@ -39,8 +39,8 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
 
        wiphy_work_init(&link->csa_finalize_work,
                        ieee80211_csa_finalize_work);
-       INIT_WORK(&link->color_change_finalize_work,
-                 ieee80211_color_change_finalize_work);
+       wiphy_work_init(&link->color_change_finalize_work,
+                       ieee80211_color_change_finalize_work);
        INIT_DELAYED_WORK(&link->color_collision_detect_work,
                          ieee80211_color_collision_detection_work);
        INIT_LIST_HEAD(&link->assigned_chanctx_list);