Skip to content

Commit 6ca6672

Browse files
LorenzoBianconinbd168
authored andcommitted
mt76: dma: introduce skb field in mt76_txwi_cache
Introduce skb field in mt76_txwi_cache. Moreover add txwi_flags to mt76_driver_ops since new chipsets will release mt76_txwi_cache/skbs at tx completion instead of dma one. This is a preliminary patch to add mt7615 support Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent cfaae9e commit 6ca6672

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

drivers/net/wireless/mediatek/mt76/dma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush)
174174
dev->drv->tx_complete_skb(dev, qid, &entry);
175175

176176
if (entry.txwi) {
177-
mt76_put_txwi(dev, entry.txwi);
177+
if (!(dev->drv->txwi_flags & MT_TXWI_NO_FREE))
178+
mt76_put_txwi(dev, entry.txwi);
178179
wake = !flush;
179180
}
180181

drivers/net/wireless/mediatek/mt76/mt76.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ struct mt76_txq {
232232
struct mt76_txwi_cache {
233233
struct list_head list;
234234
dma_addr_t dma_addr;
235+
236+
struct sk_buff *skb;
235237
};
236238

237239
struct mt76_rx_tid {
@@ -285,8 +287,11 @@ struct mt76_hw_cap {
285287
bool has_5ghz;
286288
};
287289

290+
#define MT_TXWI_NO_FREE BIT(0)
291+
288292
struct mt76_driver_ops {
289293
bool tx_aligned4_skbs;
294+
u32 txwi_flags;
290295
u16 txwi_size;
291296

292297
void (*update_survey)(struct mt76_dev *dev);

drivers/net/wireless/mediatek/mt76/tx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t)
7474
list_add(&t->list, &dev->txwi_cache);
7575
spin_unlock_bh(&dev->lock);
7676
}
77+
EXPORT_SYMBOL_GPL(mt76_put_txwi);
7778

7879
void mt76_tx_free(struct mt76_dev *dev)
7980
{

0 commit comments

Comments
 (0)