rt2x00: 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: Romain Perier <romain.perier@gmail.com> Signed-off-by: Allen Pais <allen.lkml@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200817090637.26887-15-allen.cryptic@gmail.com
This commit is contained in:
Родитель
aff8e8d02e
Коммит
a0d6ea9b6e
|
@ -1319,9 +1319,10 @@ static inline void rt2400pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
|
|||
spin_unlock_irq(&rt2x00dev->irqmask_lock);
|
||||
}
|
||||
|
||||
static void rt2400pci_txstatus_tasklet(unsigned long data)
|
||||
static void rt2400pci_txstatus_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
txstatus_tasklet);
|
||||
u32 reg;
|
||||
|
||||
/*
|
||||
|
@ -1347,17 +1348,18 @@ static void rt2400pci_txstatus_tasklet(unsigned long data)
|
|||
}
|
||||
}
|
||||
|
||||
static void rt2400pci_tbtt_tasklet(unsigned long data)
|
||||
static void rt2400pci_tbtt_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet);
|
||||
rt2x00lib_beacondone(rt2x00dev);
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt2400pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE);
|
||||
}
|
||||
|
||||
static void rt2400pci_rxdone_tasklet(unsigned long data)
|
||||
static void rt2400pci_rxdone_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
rxdone_tasklet);
|
||||
if (rt2x00mmio_rxdone(rt2x00dev))
|
||||
tasklet_schedule(&rt2x00dev->rxdone_tasklet);
|
||||
else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
|
|
|
@ -1447,9 +1447,10 @@ static inline void rt2500pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
|
|||
spin_unlock_irq(&rt2x00dev->irqmask_lock);
|
||||
}
|
||||
|
||||
static void rt2500pci_txstatus_tasklet(unsigned long data)
|
||||
static void rt2500pci_txstatus_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
txstatus_tasklet);
|
||||
u32 reg;
|
||||
|
||||
/*
|
||||
|
@ -1475,17 +1476,18 @@ static void rt2500pci_txstatus_tasklet(unsigned long data)
|
|||
}
|
||||
}
|
||||
|
||||
static void rt2500pci_tbtt_tasklet(unsigned long data)
|
||||
static void rt2500pci_tbtt_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet);
|
||||
rt2x00lib_beacondone(rt2x00dev);
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt2500pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE);
|
||||
}
|
||||
|
||||
static void rt2500pci_rxdone_tasklet(unsigned long data)
|
||||
static void rt2500pci_rxdone_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
rxdone_tasklet);
|
||||
if (rt2x00mmio_rxdone(rt2x00dev))
|
||||
tasklet_schedule(&rt2x00dev->rxdone_tasklet);
|
||||
else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
|
|
|
@ -210,18 +210,19 @@ static inline void rt2800mmio_enable_interrupt(struct rt2x00_dev *rt2x00dev,
|
|||
spin_unlock_irq(&rt2x00dev->irqmask_lock);
|
||||
}
|
||||
|
||||
void rt2800mmio_pretbtt_tasklet(unsigned long data)
|
||||
void rt2800mmio_pretbtt_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
pretbtt_tasklet);
|
||||
rt2x00lib_pretbtt(rt2x00dev);
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt2800mmio_enable_interrupt(rt2x00dev, INT_MASK_CSR_PRE_TBTT);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800mmio_pretbtt_tasklet);
|
||||
|
||||
void rt2800mmio_tbtt_tasklet(unsigned long data)
|
||||
void rt2800mmio_tbtt_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet);
|
||||
struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
|
||||
u32 reg;
|
||||
|
||||
|
@ -254,9 +255,10 @@ void rt2800mmio_tbtt_tasklet(unsigned long data)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800mmio_tbtt_tasklet);
|
||||
|
||||
void rt2800mmio_rxdone_tasklet(unsigned long data)
|
||||
void rt2800mmio_rxdone_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
rxdone_tasklet);
|
||||
if (rt2x00mmio_rxdone(rt2x00dev))
|
||||
tasklet_schedule(&rt2x00dev->rxdone_tasklet);
|
||||
else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
|
@ -264,9 +266,10 @@ void rt2800mmio_rxdone_tasklet(unsigned long data)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800mmio_rxdone_tasklet);
|
||||
|
||||
void rt2800mmio_autowake_tasklet(unsigned long data)
|
||||
void rt2800mmio_autowake_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
autowake_tasklet);
|
||||
rt2800mmio_wakeup(rt2x00dev);
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt2800mmio_enable_interrupt(rt2x00dev,
|
||||
|
@ -307,9 +310,10 @@ static void rt2800mmio_fetch_txstatus(struct rt2x00_dev *rt2x00dev)
|
|||
spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags);
|
||||
}
|
||||
|
||||
void rt2800mmio_txstatus_tasklet(unsigned long data)
|
||||
void rt2800mmio_txstatus_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
txstatus_tasklet);
|
||||
|
||||
rt2800_txdone(rt2x00dev, 16);
|
||||
|
||||
|
|
|
@ -126,11 +126,11 @@ void rt2800mmio_fill_rxdone(struct queue_entry *entry,
|
|||
struct rxdone_entry_desc *rxdesc);
|
||||
|
||||
/* Interrupt functions */
|
||||
void rt2800mmio_txstatus_tasklet(unsigned long data);
|
||||
void rt2800mmio_pretbtt_tasklet(unsigned long data);
|
||||
void rt2800mmio_tbtt_tasklet(unsigned long data);
|
||||
void rt2800mmio_rxdone_tasklet(unsigned long data);
|
||||
void rt2800mmio_autowake_tasklet(unsigned long data);
|
||||
void rt2800mmio_txstatus_tasklet(struct tasklet_struct *t);
|
||||
void rt2800mmio_pretbtt_tasklet(struct tasklet_struct *t);
|
||||
void rt2800mmio_tbtt_tasklet(struct tasklet_struct *t);
|
||||
void rt2800mmio_rxdone_tasklet(struct tasklet_struct *t);
|
||||
void rt2800mmio_autowake_tasklet(struct tasklet_struct *t);
|
||||
irqreturn_t rt2800mmio_interrupt(int irq, void *dev_instance);
|
||||
void rt2800mmio_toggle_irq(struct rt2x00_dev *rt2x00dev,
|
||||
enum dev_state state);
|
||||
|
|
|
@ -518,11 +518,11 @@ struct rt2x00lib_ops {
|
|||
/*
|
||||
* TX status tasklet handler.
|
||||
*/
|
||||
void (*txstatus_tasklet) (unsigned long data);
|
||||
void (*pretbtt_tasklet) (unsigned long data);
|
||||
void (*tbtt_tasklet) (unsigned long data);
|
||||
void (*rxdone_tasklet) (unsigned long data);
|
||||
void (*autowake_tasklet) (unsigned long data);
|
||||
void (*txstatus_tasklet) (struct tasklet_struct *t);
|
||||
void (*pretbtt_tasklet) (struct tasklet_struct *t);
|
||||
void (*tbtt_tasklet) (struct tasklet_struct *t);
|
||||
void (*rxdone_tasklet) (struct tasklet_struct *t);
|
||||
void (*autowake_tasklet) (struct tasklet_struct *t);
|
||||
|
||||
/*
|
||||
* Device init handlers.
|
||||
|
|
|
@ -1167,9 +1167,8 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
|
|||
*/
|
||||
#define RT2X00_TASKLET_INIT(taskletname) \
|
||||
if (rt2x00dev->ops->lib->taskletname) { \
|
||||
tasklet_init(&rt2x00dev->taskletname, \
|
||||
rt2x00dev->ops->lib->taskletname, \
|
||||
(unsigned long)rt2x00dev); \
|
||||
tasklet_setup(&rt2x00dev->taskletname, \
|
||||
rt2x00dev->ops->lib->taskletname); \
|
||||
}
|
||||
|
||||
RT2X00_TASKLET_INIT(txstatus_tasklet);
|
||||
|
|
|
@ -2190,34 +2190,38 @@ static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev,
|
|||
spin_unlock_irq(&rt2x00dev->irqmask_lock);
|
||||
}
|
||||
|
||||
static void rt61pci_txstatus_tasklet(unsigned long data)
|
||||
static void rt61pci_txstatus_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
txstatus_tasklet);
|
||||
|
||||
rt61pci_txdone(rt2x00dev);
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TXDONE);
|
||||
}
|
||||
|
||||
static void rt61pci_tbtt_tasklet(unsigned long data)
|
||||
static void rt61pci_tbtt_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet);
|
||||
rt2x00lib_beacondone(rt2x00dev);
|
||||
if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_BEACON_DONE);
|
||||
}
|
||||
|
||||
static void rt61pci_rxdone_tasklet(unsigned long data)
|
||||
static void rt61pci_rxdone_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
rxdone_tasklet);
|
||||
if (rt2x00mmio_rxdone(rt2x00dev))
|
||||
tasklet_schedule(&rt2x00dev->rxdone_tasklet);
|
||||
else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
|
||||
rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE);
|
||||
}
|
||||
|
||||
static void rt61pci_autowake_tasklet(unsigned long data)
|
||||
static void rt61pci_autowake_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
|
||||
struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t,
|
||||
autowake_tasklet);
|
||||
rt61pci_wakeup(rt2x00dev);
|
||||
rt2x00mmio_register_write(rt2x00dev,
|
||||
M2H_CMD_DONE_CSR, 0xffffffff);
|
||||
|
|
Загрузка…
Ссылка в новой задаче