]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
mt76: dma: introduce skb field in mt76_txwi_cache
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 2 Apr 2019 09:47:58 +0000 (11:47 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 May 2019 11:03:58 +0000 (13:03 +0200)
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 <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 5c6f5f5786e796e90c2287b81d90f18d79656e5e..4ffee2e208b284574aec477f5efaff7c9a49958d 100644 (file)
@@ -174,7 +174,8 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush)
                        dev->drv->tx_complete_skb(dev, qid, &entry);
 
                if (entry.txwi) {
-                       mt76_put_txwi(dev, entry.txwi);
+                       if (!(dev->drv->txwi_flags & MT_TXWI_NO_FREE))
+                               mt76_put_txwi(dev, entry.txwi);
                        wake = !flush;
                }
 
index 065c79c08844bb1e49205b21ce73c52876f07161..48e0f4867f6219aa0fe2e7a4b33ea40283aabea0 100644 (file)
@@ -232,6 +232,8 @@ struct mt76_txq {
 struct mt76_txwi_cache {
        struct list_head list;
        dma_addr_t dma_addr;
+
+       struct sk_buff *skb;
 };
 
 struct mt76_rx_tid {
@@ -285,8 +287,11 @@ struct mt76_hw_cap {
        bool has_5ghz;
 };
 
+#define MT_TXWI_NO_FREE                        BIT(0)
+
 struct mt76_driver_ops {
        bool tx_aligned4_skbs;
+       u32 txwi_flags;
        u16 txwi_size;
 
        void (*update_survey)(struct mt76_dev *dev);
index 32e04f60114539b4d27b64905aeb3c368e48476d..5397827668b91a8caaec8471c099c56c5ae4d18f 100644 (file)
@@ -74,6 +74,7 @@ mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t)
        list_add(&t->list, &dev->txwi_cache);
        spin_unlock_bh(&dev->lock);
 }
+EXPORT_SYMBOL_GPL(mt76_put_txwi);
 
 void mt76_tx_free(struct mt76_dev *dev)
 {