mt76: introduce mt76_init_mcu_queue utility routine

Introduce mt76_init_mcu_queue utility routine in order to allocate
dedicate q_mcu pointers for mcu hw queues. This is a preliminary patch
to move data queues in mt76_phy and add dbdc support to mt7915 driver

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 0f9350bef1
commit 8932975be0
6 changed files with 56 additions and 23 deletions
+7 -9
View File
@@ -1214,23 +1214,21 @@ int mt76_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant)
}
EXPORT_SYMBOL_GPL(mt76_get_antenna);
int mt76_init_tx_queue(struct mt76_dev *dev, int qid, int idx,
int n_desc, int ring_base)
struct mt76_queue *
mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
int ring_base)
{
struct mt76_queue *hwq;
int err;
hwq = devm_kzalloc(dev->dev, sizeof(*hwq), GFP_KERNEL);
if (!hwq)
return -ENOMEM;
return ERR_PTR(-ENOMEM);
err = dev->queue_ops->alloc(dev, hwq, idx, n_desc, 0, ring_base);
if (err < 0)
return err;
return ERR_PTR(err);
hwq->qid = qid;
dev->q_tx[qid] = hwq;
return 0;
return hwq;
}
EXPORT_SYMBOL_GPL(mt76_init_tx_queue);
EXPORT_SYMBOL_GPL(mt76_init_queue);