mt76: move pre_tbtt_tasklet in mt76_dev
Move pre_tbtt_tasklet tasklet in mt76_dev data structure since it is used by all drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
f1103fa6b3
commit
dc6057f49a
|
@ -469,6 +469,7 @@ struct mt76_dev {
|
|||
u8 antenna_mask;
|
||||
u16 chainmask;
|
||||
|
||||
struct tasklet_struct pre_tbtt_tasklet;
|
||||
int beacon_int;
|
||||
u8 beacon_mask;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ irqreturn_t mt7603_irq_handler(int irq, void *dev_instance)
|
|||
|
||||
mt76_wr(dev, MT_HW_INT_STATUS(3), hwintr);
|
||||
if (hwintr & MT_HW_INT3_PRE_TBTT0)
|
||||
tasklet_schedule(&dev->pre_tbtt_tasklet);
|
||||
tasklet_schedule(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
if ((hwintr & MT_HW_INT3_TBTT0) && dev->mt76.csa_complete)
|
||||
mt76_csa_finish(&dev->mt76);
|
||||
|
|
|
@ -515,7 +515,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
|
|||
spin_lock_init(&dev->ps_lock);
|
||||
|
||||
INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7603_mac_work);
|
||||
tasklet_init(&dev->pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet,
|
||||
tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet,
|
||||
(unsigned long)dev);
|
||||
|
||||
/* Check for 7688, which only has 1SS */
|
||||
|
@ -574,7 +574,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
|
|||
|
||||
void mt7603_unregister_device(struct mt7603_dev *dev)
|
||||
{
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
mt76_unregister_device(&dev->mt76);
|
||||
mt7603_mcu_exit(dev);
|
||||
mt7603_dma_cleanup(dev);
|
||||
|
|
|
@ -1279,7 +1279,7 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
|
|||
mt76_txq_schedule_all(&dev->mt76);
|
||||
|
||||
tasklet_disable(&dev->mt76.tx_tasklet);
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
napi_disable(&dev->mt76.napi[0]);
|
||||
napi_disable(&dev->mt76.napi[1]);
|
||||
|
||||
|
@ -1328,7 +1328,7 @@ skip_dma_reset:
|
|||
tasklet_enable(&dev->mt76.tx_tasklet);
|
||||
tasklet_schedule(&dev->mt76.tx_tasklet);
|
||||
|
||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
mt7603_beacon_set_timer(dev, -1, beacon_int);
|
||||
|
||||
napi_enable(&dev->mt76.napi[0]);
|
||||
|
|
|
@ -294,9 +294,9 @@ mt7603_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|||
if (changed & (BSS_CHANGED_BEACON_ENABLED | BSS_CHANGED_BEACON_INT)) {
|
||||
int beacon_int = !!info->enable_beacon * info->beacon_int;
|
||||
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
mt7603_beacon_set_timer(dev, mvif->idx, beacon_int);
|
||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
}
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
|
|
@ -140,8 +140,6 @@ struct mt7603_dev {
|
|||
u32 reset_test;
|
||||
|
||||
unsigned int reset_cause[__RESET_CAUSE_MAX];
|
||||
|
||||
struct tasklet_struct pre_tbtt_tasklet;
|
||||
};
|
||||
|
||||
extern const struct mt76_driver_ops mt7603_drv_ops;
|
||||
|
|
|
@ -213,7 +213,7 @@ error:
|
|||
static void mt76x0e_cleanup(struct mt76x02_dev *dev)
|
||||
{
|
||||
clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state);
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
mt76x0_chip_onoff(dev, false, false);
|
||||
mt76x0e_stop_hw(dev);
|
||||
mt76x02_dma_cleanup(dev);
|
||||
|
|
|
@ -91,7 +91,6 @@ struct mt76x02_dev {
|
|||
struct sk_buff *rx_head;
|
||||
|
||||
struct napi_struct tx_napi;
|
||||
struct tasklet_struct pre_tbtt_tasklet;
|
||||
struct delayed_work cal_work;
|
||||
struct delayed_work wdt_work;
|
||||
|
||||
|
|
|
@ -68,9 +68,9 @@ static void mt76x02_pre_tbtt_tasklet(unsigned long arg)
|
|||
static void mt76x02e_pre_tbtt_enable(struct mt76x02_dev *dev, bool en)
|
||||
{
|
||||
if (en)
|
||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
else
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
}
|
||||
|
||||
static void mt76x02e_beacon_enable(struct mt76x02_dev *dev, bool en)
|
||||
|
@ -198,7 +198,7 @@ int mt76x02_dma_init(struct mt76x02_dev *dev)
|
|||
|
||||
tasklet_init(&dev->mt76.tx_tasklet, mt76x02_tx_tasklet,
|
||||
(unsigned long) dev);
|
||||
tasklet_init(&dev->pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet,
|
||||
tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet,
|
||||
(unsigned long)dev);
|
||||
|
||||
spin_lock_init(&dev->txstatus_fifo_lock);
|
||||
|
@ -285,7 +285,7 @@ irqreturn_t mt76x02_irq_handler(int irq, void *dev_instance)
|
|||
}
|
||||
|
||||
if (intr & MT_INT_PRE_TBTT)
|
||||
tasklet_schedule(&dev->pre_tbtt_tasklet);
|
||||
tasklet_schedule(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
/* send buffered multicast frames now */
|
||||
if (intr & MT_INT_TBTT) {
|
||||
|
@ -449,7 +449,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
|
|||
ieee80211_stop_queues(dev->mt76.hw);
|
||||
set_bit(MT76_RESET, &dev->mt76.state);
|
||||
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.tx_tasklet);
|
||||
napi_disable(&dev->tx_napi);
|
||||
|
||||
|
@ -508,7 +508,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
|
|||
napi_enable(&dev->tx_napi);
|
||||
napi_schedule(&dev->tx_napi);
|
||||
|
||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) {
|
||||
napi_enable(&dev->mt76.napi[i]);
|
||||
|
|
|
@ -594,7 +594,7 @@ void mt76x02_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|||
struct mt76x02_dev *dev = hw->priv;
|
||||
|
||||
if (mt76_is_mmio(dev))
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
set_bit(MT76_SCANNING, &dev->mt76.state);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76x02_sw_scan);
|
||||
|
@ -606,7 +606,7 @@ void mt76x02_sw_scan_complete(struct ieee80211_hw *hw,
|
|||
|
||||
clear_bit(MT76_SCANNING, &dev->mt76.state);
|
||||
if (mt76_is_mmio(dev))
|
||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
if (dev->cal.gain_init_done) {
|
||||
/* Restore AGC gain and resume calibration after scanning. */
|
||||
|
|
|
@ -300,7 +300,7 @@ void mt76x2_stop_hardware(struct mt76x02_dev *dev)
|
|||
void mt76x2_cleanup(struct mt76x02_dev *dev)
|
||||
{
|
||||
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
mt76x2_stop_hardware(dev);
|
||||
mt76x02_dma_cleanup(dev);
|
||||
mt76x02_mcu_cleanup(dev);
|
||||
|
|
|
@ -59,7 +59,7 @@ mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
|||
|
||||
mt76_set_channel(&dev->mt76);
|
||||
|
||||
tasklet_disable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
|
||||
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
|
||||
|
||||
mt76x2_mac_stop(dev, true);
|
||||
|
@ -73,7 +73,7 @@ mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
|
|||
|
||||
mt76x2_mac_resume(dev);
|
||||
tasklet_enable(&dev->dfs_pd.dfs_tasklet);
|
||||
tasklet_enable(&dev->pre_tbtt_tasklet);
|
||||
tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
|
||||
|
||||
clear_bit(MT76_RESET, &dev->mt76.state);
|
||||
|
||||
|
|
Loading…
Reference in a new issue