summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2020-11-11 14:47:25 +0100
committerFelix Fietkau <nbd@nbd.name>2020-12-04 14:31:14 +0100
commitafc2b59cb985b5007666ff0adad29f3457892419 (patch)
treed89fde93dce9397a4f888ef04c5c1341c0149ef5
parenta2a93548db88b73f5781f4c3df3c757656d50c67 (diff)
mt76: sdio: rely on mt76_queue in mt76s_process_tx_queue signature
This is a preliminary patch to move data queues in mt76_phy and properly support dbdc for mt7915 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/sdio.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c
index 4c6a65cec318..ddd454d628aa 100644
--- a/drivers/net/wireless/mediatek/mt76/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/sdio.c
@@ -155,12 +155,11 @@ static void mt76s_net_worker(struct mt76_worker *w)
} while (nframes > 0);
}
-static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid)
+static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
{
- struct mt76_queue *q = dev->q_tx[qid];
+ bool wake, mcu = q == dev->q_tx[MT_TXQ_MCU];
struct mt76_queue_entry entry;
int nframes = 0;
- bool wake;
while (q->queued > 0) {
if (!q->entry[q->tail].done)
@@ -169,7 +168,7 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid)
entry = q->entry[q->tail];
q->entry[q->tail].done = false;
- if (qid == MT_TXQ_MCU) {
+ if (mcu) {
dev_kfree_skb(entry.skb);
entry.skb = NULL;
}
@@ -185,13 +184,13 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid)
if (!q->queued)
wake_up(&dev->tx_wait);
- if (qid == MT_TXQ_MCU)
+ if (mcu)
goto out;
- mt76_txq_schedule(&dev->phy, qid);
+ mt76_txq_schedule(&dev->phy, q->qid);
if (wake)
- ieee80211_wake_queue(dev->hw, qid);
+ ieee80211_wake_queue(dev->hw, q->qid);
out:
return nframes;
}
@@ -206,7 +205,7 @@ static void mt76s_status_worker(struct mt76_worker *w)
do {
nframes = 0;
for (i = 0; i < MT_TXQ_MCU_WA; i++)
- nframes += mt76s_process_tx_queue(dev, i);
+ nframes += mt76s_process_tx_queue(dev, dev->q_tx[i]);
if (dev->drv->tx_status_data &&
!test_and_set_bit(MT76_READING_STATS, &dev->phy.state))