Commit 5ee3e780 authored by Allen Pais's avatar Allen Pais Committed by Felix Fietkau

wireless: mt76: convert tasklets to use new tasklet_setup() API

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: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAllen Pais <apais@linux.microsoft.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 30578752
...@@ -64,9 +64,9 @@ mt7603_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif) ...@@ -64,9 +64,9 @@ mt7603_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif)
data->count[mvif->idx]++; data->count[mvif->idx]++;
} }
void mt7603_pre_tbtt_tasklet(unsigned long arg) void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
{ {
struct mt7603_dev *dev = (struct mt7603_dev *)arg; struct mt7603_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet);
struct mt76_queue *q; struct mt76_queue *q;
struct beacon_bc_data data = {}; struct beacon_bc_data data = {};
struct sk_buff *skb; struct sk_buff *skb;
......
...@@ -533,8 +533,7 @@ int mt7603_register_device(struct mt7603_dev *dev) ...@@ -533,8 +533,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
spin_lock_init(&dev->ps_lock); spin_lock_init(&dev->ps_lock);
INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7603_mac_work); INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7603_mac_work);
tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet, tasklet_setup(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet);
(unsigned long)dev);
dev->slottime = 9; dev->slottime = 9;
dev->sensitivity_limit = 28; dev->sensitivity_limit = 28;
......
...@@ -256,7 +256,7 @@ void mt7603_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif, ...@@ -256,7 +256,7 @@ void mt7603_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
void mt7603_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, void mt7603_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta); struct ieee80211_sta *sta);
void mt7603_pre_tbtt_tasklet(unsigned long arg); void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t);
void mt7603_update_channel(struct mt76_dev *mdev); void mt7603_update_channel(struct mt76_dev *mdev);
......
...@@ -98,9 +98,9 @@ static irqreturn_t mt7615_irq_handler(int irq, void *dev_instance) ...@@ -98,9 +98,9 @@ static irqreturn_t mt7615_irq_handler(int irq, void *dev_instance)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void mt7615_irq_tasklet(unsigned long data) static void mt7615_irq_tasklet(struct tasklet_struct *t)
{ {
struct mt7615_dev *dev = (struct mt7615_dev *)data; struct mt7615_dev *dev = from_tasklet(dev, t, irq_tasklet);
u32 intr, mask = 0, tx_mcu_mask = mt7615_tx_mcu_int_mask(dev); u32 intr, mask = 0, tx_mcu_mask = mt7615_tx_mcu_int_mask(dev);
mt76_wr(dev, MT_INT_MASK_CSR, 0); mt76_wr(dev, MT_INT_MASK_CSR, 0);
...@@ -203,7 +203,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, ...@@ -203,7 +203,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,
dev = container_of(mdev, struct mt7615_dev, mt76); dev = container_of(mdev, struct mt7615_dev, mt76);
mt76_mmio_init(&dev->mt76, mem_base); mt76_mmio_init(&dev->mt76, mem_base);
tasklet_init(&dev->irq_tasklet, mt7615_irq_tasklet, (unsigned long)dev); tasklet_setup(&dev->irq_tasklet, mt7615_irq_tasklet);
dev->reg_map = map; dev->reg_map = map;
dev->ops = ops; dev->ops = ops;
......
...@@ -609,10 +609,11 @@ static void mt76x02_dfs_check_event_window(struct mt76x02_dev *dev) ...@@ -609,10 +609,11 @@ static void mt76x02_dfs_check_event_window(struct mt76x02_dev *dev)
} }
} }
static void mt76x02_dfs_tasklet(unsigned long arg) static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
{ {
struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; struct mt76x02_dfs_pattern_detector *dfs_pd = from_tasklet(dfs_pd, t,
struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; dfs_tasklet);
struct mt76x02_dev *dev = container_of(dfs_pd, typeof(*dev), dfs_pd);
u32 engine_mask; u32 engine_mask;
int i; int i;
...@@ -860,8 +861,7 @@ void mt76x02_dfs_init_detector(struct mt76x02_dev *dev) ...@@ -860,8 +861,7 @@ void mt76x02_dfs_init_detector(struct mt76x02_dev *dev)
INIT_LIST_HEAD(&dfs_pd->seq_pool); INIT_LIST_HEAD(&dfs_pd->seq_pool);
dev->mt76.region = NL80211_DFS_UNSET; dev->mt76.region = NL80211_DFS_UNSET;
dfs_pd->last_sw_check = jiffies; dfs_pd->last_sw_check = jiffies;
tasklet_init(&dfs_pd->dfs_tasklet, mt76x02_dfs_tasklet, tasklet_setup(&dfs_pd->dfs_tasklet, mt76x02_dfs_tasklet);
(unsigned long)dev);
} }
static void static void
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include "mt76x02_mcu.h" #include "mt76x02_mcu.h"
#include "trace.h" #include "trace.h"
static void mt76x02_pre_tbtt_tasklet(unsigned long arg) static void mt76x02_pre_tbtt_tasklet(struct tasklet_struct *t)
{ {
struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; struct mt76x02_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet);
struct mt76_queue *q = dev->mt76.q_tx[MT_TXQ_PSD]; struct mt76_queue *q = dev->mt76.q_tx[MT_TXQ_PSD];
struct beacon_bc_data data = {}; struct beacon_bc_data data = {};
struct sk_buff *skb; struct sk_buff *skb;
...@@ -198,8 +198,7 @@ int mt76x02_dma_init(struct mt76x02_dev *dev) ...@@ -198,8 +198,7 @@ int mt76x02_dma_init(struct mt76x02_dev *dev)
return -ENOMEM; return -ENOMEM;
dev->mt76.tx_worker.fn = mt76x02_tx_worker; dev->mt76.tx_worker.fn = mt76x02_tx_worker;
tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet, tasklet_setup(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet);
(unsigned long)dev);
spin_lock_init(&dev->txstatus_fifo_lock); spin_lock_init(&dev->txstatus_fifo_lock);
kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size); kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size);
......
...@@ -669,9 +669,9 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q) ...@@ -669,9 +669,9 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL); mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL);
} }
static void mt76u_rx_tasklet(unsigned long data) static void mt76u_rx_tasklet(struct tasklet_struct *t)
{ {
struct mt76_dev *dev = (struct mt76_dev *)data; struct mt76_dev *dev = from_tasklet(dev, t, usb.rx_tasklet);
int i; int i;
rcu_read_lock(); rcu_read_lock();
...@@ -1110,7 +1110,7 @@ int mt76u_init(struct mt76_dev *dev, ...@@ -1110,7 +1110,7 @@ int mt76u_init(struct mt76_dev *dev,
mt76u_ops.write_copy = ext ? mt76u_copy_ext : mt76u_copy; mt76u_ops.write_copy = ext ? mt76u_copy_ext : mt76u_copy;
dev->tx_worker.fn = mt76u_tx_worker; dev->tx_worker.fn = mt76u_tx_worker;
tasklet_init(&usb->rx_tasklet, mt76u_rx_tasklet, (unsigned long)dev); tasklet_setup(&usb->rx_tasklet, mt76u_rx_tasklet);
INIT_WORK(&usb->stat_work, mt76u_tx_status_data); INIT_WORK(&usb->stat_work, mt76u_tx_status_data);
usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1); usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment