wifi: mac80211: move TDLS work to wiphy work
authorJohannes Berg <johannes.berg@intel.com>
Mon, 28 Aug 2023 11:59:46 +0000 (13:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 09:27:20 +0000 (11:27 +0200)
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>
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/tdls.c

index 47040a3a103bcd66d8176ddda82561e49cb63a52..1dc49bbd35bfa95dabbcc4dbd03bb0507d7bda50 100644 (file)
@@ -536,7 +536,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 */
@@ -2597,7 +2597,7 @@ int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
                        const u8 *extra_ies, 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 f36279e8792e6d7344a589ec096734668eefa121..f5544d94efcb378bd78f5956ccb4d68dfd4ca3e4 100644 (file)
@@ -6830,8 +6830,8 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
                        ieee80211_beacon_connection_loss_work);
        wiphy_work_init(&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);
        wiphy_delayed_work_init(&ifmgd->ml_reconf_work,
                                ieee80211_ml_reconf_work);
        timer_setup(&ifmgd->timer, ieee80211_sta_timer, 0);
@@ -7860,7 +7860,8 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata)
                          &ifmgd->beacon_connection_loss_work);
        wiphy_work_cancel(sdata->local->hw.wiphy,
                          &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);
        wiphy_delayed_work_cancel(sdata->local->hw.wiphy,
                                  &ifmgd->ml_reconf_work);
 
index a4af3b7675efaea435567fa47b0b5ff474e16716..fafbcef49ec0b1d38487c44261a83b567233c944 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;
@@ -1224,9 +1224,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:
@@ -1526,7 +1526,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);
        }