]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211: move TDLS work to wiphy work
authorJohannes Berg <johannes.berg@intel.com>
Mon, 2 Feb 2026 16:49:24 +0000 (18:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Feb 2026 15:44:22 +0000 (16:44 +0100)
[ Upstream commit 777b26002b73127e81643d9286fadf3d41e0e477 ]

Again, to have the wiphy locked for it.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ Summary of conflict resolutions:
  - In mlme.c, move only tdls_peer_del_work
    to wiphy work, and none the other works ]
Signed-off-by: Hanne-Lotta Mäenpää <hannelotta@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/tdls.c

index 6cc5bba2ba52c8ce91308abf662bc0541896ffa5..e94a370da4c4bda6f16b29f88f4f74d6d8e30dcb 100644 (file)
@@ -531,7 +531,7 @@ struct ieee80211_if_managed {
 
        /* TDLS support */
        u8 tdls_peer[ETH_ALEN] __aligned(2);
-       struct delayed_work tdls_peer_del_work;
+       struct wiphy_delayed_work tdls_peer_del_work;
        struct sk_buff *orig_teardown_skb; /* The original teardown skb */
        struct sk_buff *teardown_skb; /* A copy to send through the AP */
        spinlock_t teardown_lock; /* To lock changing teardown_skb */
@@ -2525,7 +2525,7 @@ int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
                        size_t extra_ies_len);
 int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
                        const u8 *peer, enum nl80211_tdls_operation oper);
-void ieee80211_tdls_peer_del_work(struct work_struct *wk);
+void ieee80211_tdls_peer_del_work(struct wiphy *wiphy, struct wiphy_work *wk);
 int ieee80211_tdls_channel_switch(struct wiphy *wiphy, struct net_device *dev,
                                  const u8 *addr, u8 oper_class,
                                  struct cfg80211_chan_def *chandef);
index 8824460a206094ca4e995cf30951baca42b278a5..30db27df6b79385da050fd18660738e88e85b3f7 100644 (file)
@@ -6517,8 +6517,8 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
                  ieee80211_beacon_connection_loss_work);
        INIT_WORK(&ifmgd->csa_connection_drop_work,
                  ieee80211_csa_connection_drop_work);
-       INIT_DELAYED_WORK(&ifmgd->tdls_peer_del_work,
-                         ieee80211_tdls_peer_del_work);
+       wiphy_delayed_work_init(&ifmgd->tdls_peer_del_work,
+                               ieee80211_tdls_peer_del_work);
        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);
@@ -7524,7 +7524,8 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata)
        cancel_work_sync(&ifmgd->monitor_work);
        cancel_work_sync(&ifmgd->beacon_connection_loss_work);
        cancel_work_sync(&ifmgd->csa_connection_drop_work);
-       cancel_delayed_work_sync(&ifmgd->tdls_peer_del_work);
+       wiphy_delayed_work_cancel(sdata->local->hw.wiphy,
+                                 &ifmgd->tdls_peer_del_work);
 
        sdata_lock(sdata);
        if (ifmgd->assoc_data)
index 04531d18fa931c3f7f36875586444df760b8c88a..1f07b598a6a17ff61f0e56662d66f0c1c260d85b 100644 (file)
@@ -21,7 +21,7 @@
 /* give usermode some time for retries in setting up the TDLS session */
 #define TDLS_PEER_SETUP_TIMEOUT        (15 * HZ)
 
-void ieee80211_tdls_peer_del_work(struct work_struct *wk)
+void ieee80211_tdls_peer_del_work(struct wiphy *wiphy, struct wiphy_work *wk)
 {
        struct ieee80211_sub_if_data *sdata;
        struct ieee80211_local *local;
@@ -1128,9 +1128,9 @@ ieee80211_tdls_mgmt_setup(struct wiphy *wiphy, struct net_device *dev,
                return ret;
        }
 
-       ieee80211_queue_delayed_work(&sdata->local->hw,
-                                    &sdata->u.mgd.tdls_peer_del_work,
-                                    TDLS_PEER_SETUP_TIMEOUT);
+       wiphy_delayed_work_queue(sdata->local->hw.wiphy,
+                                &sdata->u.mgd.tdls_peer_del_work,
+                                TDLS_PEER_SETUP_TIMEOUT);
        return 0;
 
 out_unlock:
@@ -1427,7 +1427,8 @@ int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
        }
 
        if (ret == 0 && ether_addr_equal(sdata->u.mgd.tdls_peer, peer)) {
-               cancel_delayed_work(&sdata->u.mgd.tdls_peer_del_work);
+               wiphy_delayed_work_cancel(sdata->local->hw.wiphy,
+                                         &sdata->u.mgd.tdls_peer_del_work);
                eth_zero_addr(sdata->u.mgd.tdls_peer);
        }