From b0eb7edcc62418f5322e065b85e68892fd531f79 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Wed, 11 Nov 2020 14:47:30 +0100 Subject: [PATCH] mt76: rely on mt76_queue in tx_queue_skb_raw signature This is a preliminary patch to move data queues in mt76_phy and properly support dbdc Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- dma.c | 3 +-- mt76.h | 2 +- mt7603/main.c | 8 +++++--- mt7603/mcu.c | 2 +- mt7615/debugfs.c | 2 +- mt7615/mcu.c | 2 +- mt7615/sdio_mcu.c | 2 +- mt76x02_mcu.c | 2 +- mt7915/mcu.c | 2 +- sdio.c | 3 +-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dma.c b/dma.c index a6986511..0c828343 100644 --- a/dma.c +++ b/dma.c @@ -313,10 +313,9 @@ mt76_dma_dequeue(struct mt76_dev *dev, struct mt76_queue *q, bool flush, } static int -mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid, +mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q, struct sk_buff *skb, u32 tx_info) { - struct mt76_queue *q = dev->q_tx[qid]; struct mt76_queue_buf buf; dma_addr_t addr; diff --git a/mt76.h b/mt76.h index cefbfe74..9fce64c0 100644 --- a/mt76.h +++ b/mt76.h @@ -175,7 +175,7 @@ struct mt76_queue_ops { struct sk_buff *skb, struct mt76_wcid *wcid, struct ieee80211_sta *sta); - int (*tx_queue_skb_raw)(struct mt76_dev *dev, enum mt76_txq_id qid, + int (*tx_queue_skb_raw)(struct mt76_dev *dev, struct mt76_queue *q, struct sk_buff *skb, u32 tx_info); void *(*dequeue)(struct mt76_dev *dev, struct mt76_queue *q, bool flush, diff --git a/mt7603/main.c b/mt7603/main.c index c9226dce..64b25912 100644 --- a/mt7603/main.c +++ b/mt7603/main.c @@ -380,9 +380,11 @@ mt7603_ps_tx_list(struct mt7603_dev *dev, struct sk_buff_head *list) { struct sk_buff *skb; - while ((skb = __skb_dequeue(list)) != NULL) - mt76_tx_queue_skb_raw(dev, skb_get_queue_mapping(skb), - skb, 0); + while ((skb = __skb_dequeue(list)) != NULL) { + int qid = skb_get_queue_mapping(skb); + + mt76_tx_queue_skb_raw(dev, dev->mt76.q_tx[qid], skb, 0); + } } void diff --git a/mt7603/mcu.c b/mt7603/mcu.c index 9e6c8e1b..d275aa6e 100644 --- a/mt7603/mcu.c +++ b/mt7603/mcu.c @@ -73,7 +73,7 @@ mt7603_mcu_skb_send_msg(struct mt76_dev *mdev, struct sk_buff *skb, if (wait_seq) *wait_seq = seq; - return mt76_tx_queue_skb_raw(dev, MT_TXQ_MCU, skb, 0); + return mt76_tx_queue_skb_raw(dev, mdev->q_tx[MT_TXQ_MCU], skb, 0); } static int diff --git a/mt7615/debugfs.c b/mt7615/debugfs.c index a35ff054..ffe36e5e 100644 --- a/mt7615/debugfs.c +++ b/mt7615/debugfs.c @@ -187,7 +187,7 @@ mt7615_reset_test_set(void *data, u64 val) skb_put(skb, 1); mt7615_mutex_acquire(dev); - mt76_tx_queue_skb_raw(dev, 0, skb, 0); + mt76_tx_queue_skb_raw(dev, dev->mt76.q_tx[0], skb, 0); mt7615_mutex_release(dev); return 0; diff --git a/mt7615/mcu.c b/mt7615/mcu.c index 1e4e77e6..925546e7 100644 --- a/mt7615/mcu.c +++ b/mt7615/mcu.c @@ -239,7 +239,7 @@ mt7615_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, else qid = MT_TXQ_FWDL; - return mt76_tx_queue_skb_raw(dev, qid, skb, 0); + return mt76_tx_queue_skb_raw(dev, dev->mt76.q_tx[qid], skb, 0); } u32 mt7615_rf_rr(struct mt7615_dev *dev, u32 wf, u32 reg) diff --git a/mt7615/sdio_mcu.c b/mt7615/sdio_mcu.c index e4995c64..a6f28b80 100644 --- a/mt7615/sdio_mcu.c +++ b/mt7615/sdio_mcu.c @@ -42,7 +42,7 @@ mt7663s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, int ret; mt7615_mcu_fill_msg(dev, skb, cmd, seq); - ret = mt76_tx_queue_skb_raw(dev, MT_TXQ_MCU, skb, 0); + ret = mt76_tx_queue_skb_raw(dev, mdev->q_tx[MT_TXQ_MCU], skb, 0); if (ret) return ret; diff --git a/mt76x02_mcu.c b/mt76x02_mcu.c index 3b218425..3846e5be 100644 --- a/mt76x02_mcu.c +++ b/mt76x02_mcu.c @@ -61,7 +61,7 @@ int mt76x02_mcu_msg_send(struct mt76_dev *mdev, int cmd, const void *data, FIELD_PREP(MT_MCU_MSG_PORT, CPU_TX_PORT) | FIELD_PREP(MT_MCU_MSG_LEN, skb->len); - ret = mt76_tx_queue_skb_raw(dev, MT_TXQ_MCU, skb, tx_info); + ret = mt76_tx_queue_skb_raw(dev, mdev->q_tx[MT_TXQ_MCU], skb, tx_info); if (ret) goto out; diff --git a/mt7915/mcu.c b/mt7915/mcu.c index 21aa1b6b..b39f34ed 100644 --- a/mt7915/mcu.c +++ b/mt7915/mcu.c @@ -326,7 +326,7 @@ exit: if (wait_seq) *wait_seq = seq; - return mt76_tx_queue_skb_raw(dev, txq, skb, 0); + return mt76_tx_queue_skb_raw(dev, mdev->q_tx[txq], skb, 0); } static void diff --git a/sdio.c b/sdio.c index b1bc459a..fce13373 100644 --- a/sdio.c +++ b/sdio.c @@ -266,10 +266,9 @@ mt76s_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, } static int -mt76s_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid, +mt76s_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q, struct sk_buff *skb, u32 tx_info) { - struct mt76_queue *q = dev->q_tx[qid]; int ret = -ENOSPC, len = skb->len, pad; if (q->queued == q->ndesc)