mt76: move mt76_init_tx_queue in common code

Move mt76_init_tx_queue in mac80211.c since it is shared by all
drivers.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2020-11-12 14:59:29 +01:00
committed by Felix Fietkau
parent b9a50da503
commit c79d18723d
6 changed files with 58 additions and 85 deletions
+2 -8
View File
@@ -105,19 +105,13 @@ EXPORT_SYMBOL_GPL(mt76x02e_init_beacon_config);
static int
mt76x02_init_tx_queue(struct mt76x02_dev *dev, int qid, int idx, int n_desc)
{
struct mt76_queue *hwq;
int err;
hwq = devm_kzalloc(dev->mt76.dev, sizeof(*hwq), GFP_KERNEL);
if (!hwq)
return -ENOMEM;
err = mt76_queue_alloc(dev, hwq, idx, n_desc, 0, MT_TX_RING_BASE);
err = mt76_init_tx_queue(&dev->mt76, qid, idx, n_desc,
MT_TX_RING_BASE);
if (err < 0)
return err;
dev->mt76.q_tx[qid] = hwq;
mt76x02_irq_enable(dev, MT_INT_TX_DONE(idx));
return 0;