diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2020-11-11 14:47:29 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-12-04 14:31:14 +0100 |
commit | b1cb42add6d60560e21e53bcec63d150cab7e1df (patch) | |
tree | 19b25a1ddf01d6c696bfccf115f84cff4500d07c /drivers/net/wireless/mediatek/mt76/mt76.h | |
parent | 8987059475f503cbf8c5fbb8e8fe537d602bec92 (diff) | |
download | linux-b1cb42add6d60560e21e53bcec63d150cab7e1df.tar.gz linux-b1cb42add6d60560e21e53bcec63d150cab7e1df.tar.bz2 linux-b1cb42add6d60560e21e53bcec63d150cab7e1df.zip |
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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index ac0886a01aed..3e6b8a647450 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -72,6 +72,10 @@ enum mt76_txq_id { __MT_TXQ_MAX }; +enum mt76_mcuq_id { + __MT_MCUQ_MAX +}; + enum mt76_rxq_id { MT_RXQ_MAIN, MT_RXQ_MCU, @@ -604,6 +608,7 @@ struct mt76_dev { struct list_head txwi_cache; struct mt76_queue *q_tx[2 * __MT_TXQ_MAX]; + struct mt76_queue *q_mcu[__MT_MCUQ_MAX]; struct mt76_queue q_rx[__MT_RXQ_MAX]; const struct mt76_queue_ops *queue_ops; int tx_dma_idx[4]; @@ -779,8 +784,38 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str, int mt76_eeprom_init(struct mt76_dev *dev, int len); void mt76_eeprom_override(struct mt76_dev *dev); -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); +static inline int mt76_init_tx_queue(struct mt76_phy *phy, int qid, int idx, + int n_desc, int ring_base) +{ + struct mt76_queue *q; + + q = mt76_init_queue(phy->dev, qid, idx, n_desc, ring_base); + if (IS_ERR(q)) + return PTR_ERR(q); + + q->qid = qid; + phy->dev->q_tx[qid] = q; + + return 0; +} + +static inline int mt76_init_mcu_queue(struct mt76_dev *dev, int qid, int idx, + int n_desc, int ring_base) +{ + struct mt76_queue *q; + + q = mt76_init_queue(dev, qid, idx, n_desc, ring_base); + if (IS_ERR(q)) + return PTR_ERR(q); + + q->qid = qid; + dev->q_mcu[qid] = q; + + return 0; +} static inline struct mt76_phy * mt76_dev_phy(struct mt76_dev *dev, bool phy_ext) |