Commit c325c9c7 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: move mt76_tx_tasklet in mt76 module

Move mt76{15,03}_tx_tasklet in mt76_alloc_device in order to be used as
default tx_tasklet initialization. Remove duplicated code in
mt7603/mt7615 drivers
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 863c15a1
...@@ -283,6 +283,8 @@ mt76_alloc_device(struct device *pdev, unsigned int size, ...@@ -283,6 +283,8 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
init_waitqueue_head(&dev->tx_wait); init_waitqueue_head(&dev->tx_wait);
skb_queue_head_init(&dev->status_list); skb_queue_head_init(&dev->status_list);
tasklet_init(&dev->tx_tasklet, mt76_tx_tasklet, (unsigned long)dev);
return dev; return dev;
} }
EXPORT_SYMBOL_GPL(mt76_alloc_device); EXPORT_SYMBOL_GPL(mt76_alloc_device);
......
...@@ -708,6 +708,7 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, ...@@ -708,6 +708,7 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
bool send_bar); bool send_bar);
void mt76_txq_schedule(struct mt76_dev *dev, enum mt76_txq_id qid); void mt76_txq_schedule(struct mt76_dev *dev, enum mt76_txq_id qid);
void mt76_txq_schedule_all(struct mt76_dev *dev); void mt76_txq_schedule_all(struct mt76_dev *dev);
void mt76_tx_tasklet(unsigned long data);
void mt76_release_buffered_frames(struct ieee80211_hw *hw, void mt76_release_buffered_frames(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
u16 tids, int nframes, u16 tids, int nframes,
......
...@@ -135,14 +135,6 @@ mt7603_init_rx_queue(struct mt7603_dev *dev, struct mt76_queue *q, ...@@ -135,14 +135,6 @@ mt7603_init_rx_queue(struct mt7603_dev *dev, struct mt76_queue *q,
return 0; return 0;
} }
static void
mt7603_tx_tasklet(unsigned long data)
{
struct mt7603_dev *dev = (struct mt7603_dev *)data;
mt76_txq_schedule_all(&dev->mt76);
}
static int mt7603_poll_tx(struct napi_struct *napi, int budget) static int mt7603_poll_tx(struct napi_struct *napi, int budget)
{ {
struct mt7603_dev *dev; struct mt7603_dev *dev;
...@@ -181,9 +173,6 @@ int mt7603_dma_init(struct mt7603_dev *dev) ...@@ -181,9 +173,6 @@ int mt7603_dma_init(struct mt7603_dev *dev)
init_waitqueue_head(&dev->mt76.mmio.mcu.wait); init_waitqueue_head(&dev->mt76.mmio.mcu.wait);
skb_queue_head_init(&dev->mt76.mmio.mcu.res_q); skb_queue_head_init(&dev->mt76.mmio.mcu.res_q);
tasklet_init(&dev->mt76.tx_tasklet, mt7603_tx_tasklet,
(unsigned long)dev);
mt76_clear(dev, MT_WPDMA_GLO_CFG, mt76_clear(dev, MT_WPDMA_GLO_CFG,
MT_WPDMA_GLO_CFG_TX_DMA_EN | MT_WPDMA_GLO_CFG_TX_DMA_EN |
MT_WPDMA_GLO_CFG_RX_DMA_EN | MT_WPDMA_GLO_CFG_RX_DMA_EN |
......
...@@ -90,13 +90,6 @@ void mt7615_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, ...@@ -90,13 +90,6 @@ void mt7615_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
} }
} }
static void mt7615_tx_tasklet(unsigned long data)
{
struct mt7615_dev *dev = (struct mt7615_dev *)data;
mt76_txq_schedule_all(&dev->mt76);
}
static int mt7615_poll_tx(struct napi_struct *napi, int budget) static int mt7615_poll_tx(struct napi_struct *napi, int budget)
{ {
static const u8 queue_map[] = { static const u8 queue_map[] = {
...@@ -128,9 +121,6 @@ int mt7615_dma_init(struct mt7615_dev *dev) ...@@ -128,9 +121,6 @@ int mt7615_dma_init(struct mt7615_dev *dev)
mt76_dma_attach(&dev->mt76); mt76_dma_attach(&dev->mt76);
tasklet_init(&dev->mt76.tx_tasklet, mt7615_tx_tasklet,
(unsigned long)dev);
mt76_wr(dev, MT_WPDMA_GLO_CFG, mt76_wr(dev, MT_WPDMA_GLO_CFG,
MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE | MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE |
MT_WPDMA_GLO_CFG_FIFO_LITTLE_ENDIAN | MT_WPDMA_GLO_CFG_FIFO_LITTLE_ENDIAN |
......
...@@ -557,6 +557,13 @@ void mt76_txq_schedule_all(struct mt76_dev *dev) ...@@ -557,6 +557,13 @@ void mt76_txq_schedule_all(struct mt76_dev *dev)
} }
EXPORT_SYMBOL_GPL(mt76_txq_schedule_all); EXPORT_SYMBOL_GPL(mt76_txq_schedule_all);
void mt76_tx_tasklet(unsigned long data)
{
struct mt76_dev *dev = (struct mt76_dev *)data;
mt76_txq_schedule_all(dev);
}
void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
bool send_bar) bool send_bar)
{ {
......
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