mt76: introduce mt76_txq_id field in mt76_queue_entry
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 2 Mar 2019 13:47:42 +0000 (14:47 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 May 2019 11:03:55 +0000 (13:03 +0200)
Add mt76_txq_id field to mt76_queue_entry in order to properly
track outstanding frames for mt7615 that relies on a single hw queue

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/dma.c
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/tx.c

index 3bd277ec99f072fe77fd53cf1b5945b03cce0c8e..f812406c0ab6a6ebe13c4dfee413898855d3fc91 100644 (file)
@@ -164,7 +164,7 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush)
        while (q->queued && q->tail != last) {
                mt76_dma_tx_cleanup_idx(dev, q, q->tail, &entry);
                if (entry.schedule)
-                       dev->q_tx[qid].swq_queued--;
+                       dev->q_tx[entry.qid].swq_queued--;
 
                q->tail = (q->tail + 1) % q->ndesc;
                q->queued--;
index e53d89e9c4502fcd02b642d661e04f87ea7146b1..a687640098dcb8b074d8104bb45c583003d36139 100644 (file)
@@ -100,6 +100,7 @@ struct mt76_queue_entry {
                struct mt76_txwi_cache *txwi;
                struct mt76u_buf ubuf;
        };
+       enum mt76_txq_id qid;
        bool schedule;
 };
 
index d3d4d87fadb57fe3035f065af1fee0d3d7ed6134..2c82db0b58343cd73e6f565bcc07364a7def61b6 100644 (file)
@@ -468,6 +468,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_sw_queue *sq,
        } while (n_frames < limit);
 
        if (!probe) {
+               hwq->entry[idx].qid = sq - dev->q_tx;
                hwq->entry[idx].schedule = true;
                sq->swq_queued++;
        }