wifi: mac80211: move tspec work to wiphy work
authorJohannes Berg <johannes.berg@intel.com>
Mon, 28 Aug 2023 11:59:48 +0000 (13:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 09:27:20 +0000 (11:27 +0200)
One more work that will now execute with the wiphy
locked, for future cleanups.

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

index c5a414b1fd0a14f8c4092e0e31bbc675810a3c25..34f528f7c13e0e1adc82797593de787117d7692b 100644 (file)
@@ -550,7 +550,7 @@ struct ieee80211_if_managed {
         * on the BE queue, but there's a lot of VO traffic, we might
         * get stuck in a downgraded situation and flush takes forever.
         */
-       struct delayed_work tx_tspec_wk;
+       struct wiphy_delayed_work tx_tspec_wk;
 
        /* Information elements from the last transmitted (Re)Association
         * Request frame.
index f5544d94efcb378bd78f5956ccb4d68dfd4ca3e4..a35769dac162a7fc0394e73d0c7fa4faca242bde 100644 (file)
@@ -2489,8 +2489,10 @@ __ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata)
                                         ac);
                        tx_tspec->action = TX_TSPEC_ACTION_NONE;
                        ret = true;
-                       schedule_delayed_work(&ifmgd->tx_tspec_wk,
-                               tx_tspec->time_slice_start + HZ - now + 1);
+                       wiphy_delayed_work_queue(local->hw.wiphy,
+                                                &ifmgd->tx_tspec_wk,
+                                                tx_tspec->time_slice_start +
+                                                HZ - now + 1);
                        break;
                case TX_TSPEC_ACTION_NONE:
                        /* nothing now */
@@ -2508,7 +2510,8 @@ void ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata)
                                                  BSS_CHANGED_QOS);
 }
 
-static void ieee80211_sta_handle_tspec_ac_params_wk(struct work_struct *work)
+static void ieee80211_sta_handle_tspec_ac_params_wk(struct wiphy *wiphy,
+                                                   struct wiphy_work *work)
 {
        struct ieee80211_sub_if_data *sdata;
 
@@ -3060,7 +3063,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 
        /* existing TX TSPEC sessions no longer exist */
        memset(ifmgd->tx_tspec, 0, sizeof(ifmgd->tx_tspec));
-       cancel_delayed_work_sync(&ifmgd->tx_tspec_wk);
+       wiphy_delayed_work_cancel(local->hw.wiphy, &ifmgd->tx_tspec_wk);
 
        sdata->vif.bss_conf.pwr_reduction = 0;
        sdata->vif.bss_conf.tx_pwr_env_num = 0;
@@ -3128,7 +3131,8 @@ static void ieee80211_sta_tx_wmm_ac_notify(struct ieee80211_sub_if_data *sdata,
 
                if (tx_tspec->downgraded) {
                        tx_tspec->action = TX_TSPEC_ACTION_STOP_DOWNGRADE;
-                       schedule_delayed_work(&ifmgd->tx_tspec_wk, 0);
+                       wiphy_delayed_work_queue(sdata->local->hw.wiphy,
+                                                &ifmgd->tx_tspec_wk, 0);
                }
        }
 
@@ -3140,7 +3144,8 @@ static void ieee80211_sta_tx_wmm_ac_notify(struct ieee80211_sub_if_data *sdata,
        if (tx_tspec->consumed_tx_time >= tx_tspec->admitted_time) {
                tx_tspec->downgraded = true;
                tx_tspec->action = TX_TSPEC_ACTION_DOWNGRADE;
-               schedule_delayed_work(&ifmgd->tx_tspec_wk, 0);
+               wiphy_delayed_work_queue(sdata->local->hw.wiphy,
+                                        &ifmgd->tx_tspec_wk, 0);
        }
 }
 
@@ -6837,8 +6842,8 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
        timer_setup(&ifmgd->timer, ieee80211_sta_timer, 0);
        timer_setup(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 0);
        timer_setup(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer, 0);
-       INIT_DELAYED_WORK(&ifmgd->tx_tspec_wk,
-                         ieee80211_sta_handle_tspec_ac_params_wk);
+       wiphy_delayed_work_init(&ifmgd->tx_tspec_wk,
+                               ieee80211_sta_handle_tspec_ac_params_wk);
 
        ifmgd->flags = 0;
        ifmgd->powersave = sdata->wdev.ps;