wifi: mac80211: move filter reconfig to wiphy work
authorJohannes Berg <johannes.berg@intel.com>
Mon, 28 Aug 2023 11:59:49 +0000 (13:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 09:27:20 +0000 (11:27 +0200)
This again is intended for future cleanups that are
possible when mac80211 and drivers can assume the
wiphy is locked.

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

index 34f528f7c13e0e1adc82797593de787117d7692b..a5569f9bb83f9479a44c9e428436fbdebe8c8e32 100644 (file)
@@ -1368,7 +1368,7 @@ struct ieee80211_local {
        spinlock_t filter_lock;
 
        /* used for uploading changed mc list */
-       struct work_struct reconfig_filter;
+       struct wiphy_work reconfig_filter;
 
        /* aggregated multicast list */
        struct netdev_hw_addr_list mc_list;
index fbfb9037b5239b0844869b7094c72c90653152ac..82bb340ef4be9cccedad72ac17f960058090af1a 100644 (file)
@@ -778,7 +778,7 @@ static void ieee80211_set_multicast_list(struct net_device *dev)
        spin_lock_bh(&local->filter_lock);
        __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
        spin_unlock_bh(&local->filter_lock);
-       ieee80211_queue_work(&local->hw, &local->reconfig_filter);
+       wiphy_work_queue(local->hw.wiphy, &local->reconfig_filter);
 }
 
 /*
index a66cfdca42efefffd6828b689597d3b9354347c3..37714dcf9f060a96eac2691c63466dd58c2b5a9e 100644 (file)
@@ -84,7 +84,8 @@ void ieee80211_configure_filter(struct ieee80211_local *local)
        local->filter_flags = new_flags & ~(1<<31);
 }
 
-static void ieee80211_reconfig_filter(struct work_struct *work)
+static void ieee80211_reconfig_filter(struct wiphy *wiphy,
+                                     struct wiphy_work *work)
 {
        struct ieee80211_local *local =
                container_of(work, struct ieee80211_local, reconfig_filter);
@@ -835,7 +836,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
        wiphy_work_init(&local->radar_detected_work,
                        ieee80211_dfs_radar_detected_work);
 
-       INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter);
+       wiphy_work_init(&local->reconfig_filter, ieee80211_reconfig_filter);
        local->smps_mode = IEEE80211_SMPS_OFF;
 
        wiphy_work_init(&local->dynamic_ps_enable_work,
@@ -1503,13 +1504,13 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
 
        wiphy_lock(local->hw.wiphy);
        wiphy_delayed_work_cancel(local->hw.wiphy, &local->roc_work);
+       wiphy_work_cancel(local->hw.wiphy, &local->reconfig_filter);
        wiphy_work_cancel(local->hw.wiphy, &local->sched_scan_stopped_work);
        wiphy_work_cancel(local->hw.wiphy, &local->radar_detected_work);
        wiphy_unlock(local->hw.wiphy);
        rtnl_unlock();
 
        cancel_work_sync(&local->restart_work);
-       cancel_work_sync(&local->reconfig_filter);
 
        ieee80211_clear_tx_pending(local);
        rate_control_deinitialize(local);
index 2815f54c5aa1dcabda67420e51ecea1ac0c94130..bb4c7dd03758e9fe664b3b58a88e9141c8fe18db 100644 (file)
@@ -2316,7 +2316,7 @@ void ieee80211_stop_device(struct ieee80211_local *local)
        ieee80211_led_radio(local, false);
        ieee80211_mod_tpt_led_trig(local, 0, IEEE80211_TPT_LEDTRIG_FL_RADIO);
 
-       cancel_work_sync(&local->reconfig_filter);
+       wiphy_work_cancel(local->hw.wiphy, &local->reconfig_filter);
 
        flush_workqueue(local->workqueue);
        wiphy_work_flush(local->hw.wiphy, NULL);