From: Allen Pais <allen.lkml@gmail.com>
To: davem@davemloft.net
Cc: gerrit@erg.abdn.ac.uk, kuba@kernel.org, edumazet@google.com,
kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org,
johannes@sipsolutions.net, alex.aring@gmail.com,
stefan@datenfreihafen.org, santosh.shilimkar@oracle.com,
jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
netdev@vger.kernel.org, Allen Pais <allen.lkml@gmail.com>,
Romain Perier <romain.perier@gmail.com>,
Allen Pais <apais@linux.microsoft.com>
Subject: [RESEND net-next 3/8] net: mac80211: convert tasklets to use new tasklet_setup() API
Date: Tue, 6 Oct 2020 12:01:56 +0530 [thread overview]
Message-ID: <20201006063201.294959-4-allen.lkml@gmail.com> (raw)
In-Reply-To: <20201006063201.294959-1-allen.lkml@gmail.com>
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.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
---
net/mac80211/ieee80211_i.h | 4 ++--
net/mac80211/main.c | 14 +++++---------
net/mac80211/tx.c | 5 +++--
net/mac80211/util.c | 5 +++--
4 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c3e357857..6d083a146 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -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,
@@ -2143,7 +2143,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,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 523380aed..48ab05186 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -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);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8ba10a48d..a50c0edb1 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4406,9 +4406,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;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 493420604..a25e47750 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -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);
--
2.25.1
next prev parent reply other threads:[~2020-10-06 6:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-06 6:31 [RESEND net-next 0/8] net: convert tasklets to use new Allen Pais
2020-10-06 6:31 ` [RESEND net-next 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Allen Pais
2020-10-06 14:42 ` Jakub Kicinski
2020-10-07 9:40 ` Allen Pais
2020-10-06 6:31 ` [RESEND net-next 2/8] net: ipv4: " Allen Pais
2020-10-06 6:31 ` Allen Pais [this message]
2020-10-06 6:31 ` [RESEND net-next 4/8] net: mac802154: " Allen Pais
2020-10-06 7:52 ` Stefan Schmidt
2020-10-06 6:31 ` [RESEND net-next 5/8] net: rds: " Allen Pais
2020-10-06 6:31 ` [RESEND net-next 6/8] net: sched: " Allen Pais
2020-10-06 6:32 ` [RESEND net-next 7/8] net: smc: " Allen Pais
2020-10-06 6:32 ` [RESEND net-next 8/8] net: xfrm: " Allen Pais
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201006063201.294959-4-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=alex.aring@gmail.com \
--cc=apais@linux.microsoft.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gerrit@erg.abdn.ac.uk \
--cc=herbert@gondor.apana.org.au \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=romain.perier@gmail.com \
--cc=santosh.shilimkar@oracle.com \
--cc=stefan@datenfreihafen.org \
--cc=steffen.klassert@secunet.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).