diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2019-03-02 14:47:41 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-05-01 13:03:55 +0200 |
commit | af005f2605956e596b335b40bce364963f0575a0 (patch) | |
tree | 80748168f835ef73d7fc66eff42c68dd809c4363 /drivers/net/wireless/mediatek/mt76/dma.c | |
parent | mt76: remove mt76_queue dependency from tx_complete_skb function pointer (diff) | |
download | linux-af005f2605956e596b335b40bce364963f0575a0.tar.xz linux-af005f2605956e596b335b40bce364963f0575a0.zip |
mt76: introduce mt76_sw_queue data structure
Introduce mt76_sw_queue data structure in order to support new
chipsets (e.g. mt7615) that have a shared hardware queue for all traffic
identifiers. mt76_sw_queue will be used to track outstanding packets
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/dma.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/dma.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 58c67df9f185..3bd277ec99f0 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -29,7 +29,6 @@ mt76_dma_alloc_queue(struct mt76_dev *dev, struct mt76_queue *q, int i; spin_lock_init(&q->lock); - INIT_LIST_HEAD(&q->swq); q->regs = dev->mmio.regs + ring_base + idx * MT_RING_SIZE; q->ndesc = n_desc; @@ -147,12 +146,13 @@ mt76_dma_sync_idx(struct mt76_dev *dev, struct mt76_queue *q) static void mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) { - struct mt76_queue *q = &dev->q_tx[qid]; + struct mt76_sw_queue *sq = &dev->q_tx[qid]; + struct mt76_queue *q = sq->q; struct mt76_queue_entry entry; bool wake = false; int last; - if (!q->ndesc) + if (!q) return; spin_lock_bh(&q->lock); @@ -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) - q->swq_queued--; + dev->q_tx[qid].swq_queued--; q->tail = (q->tail + 1) % q->ndesc; q->queued--; @@ -185,7 +185,7 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) } if (!flush) - mt76_txq_schedule(dev, q); + mt76_txq_schedule(dev, sq); else mt76_dma_sync_idx(dev, q); @@ -258,7 +258,7 @@ static int mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, u32 tx_info) { - struct mt76_queue *q = &dev->q_tx[qid]; + struct mt76_queue *q = dev->q_tx[qid].q; struct mt76_queue_buf buf; dma_addr_t addr; @@ -282,7 +282,7 @@ int mt76_dma_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid, struct sk_buff *skb, struct mt76_wcid *wcid, struct ieee80211_sta *sta) { - struct mt76_queue *q = &dev->q_tx[qid]; + struct mt76_queue *q = dev->q_tx[qid].q; struct mt76_queue_entry e; struct mt76_txwi_cache *t; struct mt76_queue_buf buf[32]; |