OSDN Git Service

net: mac80211: convert tasklets to use new tasklet_setup() API
authorAllen Pais <apais@linux.microsoft.com>
Tue, 3 Nov 2020 09:18:18 +0000 (14:48 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Nov 2020 18:40:56 +0000 (10:40 -0800)
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mac80211/ieee80211_i.h
net/mac80211/main.c
net/mac80211/tx.c
net/mac80211/util.c

index 2a21226..2a3b0ee 100644 (file)
@@ -1795,7 +1795,7 @@ static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
 
 /* tx handling */
 void ieee80211_clear_tx_pending(struct ieee80211_local *local);
-void ieee80211_tx_pending(unsigned long data);
+void ieee80211_tx_pending(struct tasklet_struct *t);
 netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
                                         struct net_device *dev);
 netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
@@ -2146,7 +2146,7 @@ void ieee80211_txq_remove_vlan(struct ieee80211_local *local,
                               struct ieee80211_sub_if_data *sdata);
 void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats,
                              struct txq_info *txqi);
-void ieee80211_wake_txqs(unsigned long data);
+void ieee80211_wake_txqs(struct tasklet_struct *t);
 void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
                         u16 transaction, u16 auth_alg, u16 status,
                         const u8 *extra, size_t extra_len, const u8 *bssid,
index 523380a..48ab051 100644 (file)
@@ -220,9 +220,9 @@ u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
               BSS_CHANGED_ERP_SLOT;
 }
 
-static void ieee80211_tasklet_handler(unsigned long data)
+static void ieee80211_tasklet_handler(struct tasklet_struct *t)
 {
-       struct ieee80211_local *local = (struct ieee80211_local *) data;
+       struct ieee80211_local *local = from_tasklet(local, t, tasklet);
        struct sk_buff *skb;
 
        while ((skb = skb_dequeue(&local->skb_queue)) ||
@@ -733,16 +733,12 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
                skb_queue_head_init(&local->pending[i]);
                atomic_set(&local->agg_queue_stop[i], 0);
        }
-       tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending,
-                    (unsigned long)local);
+       tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending);
 
        if (ops->wake_tx_queue)
-               tasklet_init(&local->wake_txqs_tasklet, ieee80211_wake_txqs,
-                            (unsigned long)local);
+               tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs);
 
-       tasklet_init(&local->tasklet,
-                    ieee80211_tasklet_handler,
-                    (unsigned long) local);
+       tasklet_setup(&local->tasklet, ieee80211_tasklet_handler);
 
        skb_queue_head_init(&local->skb_queue);
        skb_queue_head_init(&local->skb_queue_unreliable);
index 56a4d0d..5f05f46 100644 (file)
@@ -4418,9 +4418,10 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
 /*
  * Transmit all pending packets. Called from tasklet.
  */
-void ieee80211_tx_pending(unsigned long data)
+void ieee80211_tx_pending(struct tasklet_struct *t)
 {
-       struct ieee80211_local *local = (struct ieee80211_local *)data;
+       struct ieee80211_local *local = from_tasklet(local, t,
+                                                    tx_pending_tasklet);
        unsigned long flags;
        int i;
        bool txok;
index 4934206..a25e477 100644 (file)
@@ -386,9 +386,10 @@ _ieee80211_wake_txqs(struct ieee80211_local *local, unsigned long *flags)
        rcu_read_unlock();
 }
 
-void ieee80211_wake_txqs(unsigned long data)
+void ieee80211_wake_txqs(struct tasklet_struct *t)
 {
-       struct ieee80211_local *local = (struct ieee80211_local *)data;
+       struct ieee80211_local *local = from_tasklet(local, t,
+                                                    wake_txqs_tasklet);
        unsigned long flags;
 
        spin_lock_irqsave(&local->queue_stop_reason_lock, flags);