]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mt76: rename mt76_driver_ops txwi_flags to drv_flags and include tx aligned4
authorFelix Fietkau <nbd@nbd.name>
Sat, 31 Aug 2019 10:41:59 +0000 (12:41 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Nov 2019 12:23:49 +0000 (13:23 +0100)
This reduces the struct size and is useful for adding more flags later

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/mt7615/pci.c
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci.c

index 8f69d00bd940a98aaa84a0166c7375357ecab82a..6442a45ba303e7499fa22e1b37d3623a3606c408 100644 (file)
@@ -166,7 +166,7 @@ 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) {
-                       if (!(dev->drv->txwi_flags & MT_TXWI_NO_FREE))
+                       if (!(dev->drv->drv_flags & MT_DRV_TXWI_NO_FREE))
                                mt76_put_txwi(dev, entry.txwi);
                        wake = !flush;
                }
@@ -301,7 +301,7 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid,
        txwi = mt76_get_txwi_ptr(dev, t);
 
        skb->prev = skb->next = NULL;
-       if (dev->drv->tx_aligned4_skbs)
+       if (dev->drv->drv_flags & MT_DRV_TX_ALIGNED4_SKBS)
                mt76_insert_hdr_pad(skb);
 
        len = skb_headlen(skb);
index 187c3e8998d614c121e6d0561167b6fac0f29d8e..daf2b640e4d485e8e0c2fc32dcb1556c453ad9af 100644 (file)
@@ -280,11 +280,11 @@ struct mt76_hw_cap {
        bool has_5ghz;
 };
 
-#define MT_TXWI_NO_FREE                        BIT(0)
+#define MT_DRV_TXWI_NO_FREE            BIT(0)
+#define MT_DRV_TX_ALIGNED4_SKBS                BIT(1)
 
 struct mt76_driver_ops {
-       bool tx_aligned4_skbs;
-       u32 txwi_flags;
+       u32 drv_flags;
        u16 txwi_size;
 
        void (*update_survey)(struct mt76_dev *dev);
index e250607e0a80e7a5a708134936ff64f1009a0eb3..73744563a5730b2eb461aaca3f3018cbc128a504 100644 (file)
@@ -72,7 +72,7 @@ static int mt7615_pci_probe(struct pci_dev *pdev,
        static const struct mt76_driver_ops drv_ops = {
                /* txwi_size = txd size + txp size */
                .txwi_size = MT_TXD_SIZE + sizeof(struct mt7615_txp),
-               .txwi_flags = MT_TXWI_NO_FREE,
+               .drv_flags = MT_DRV_TXWI_NO_FREE,
                .tx_prepare_skb = mt7615_tx_prepare_skb,
                .tx_complete_skb = mt7615_tx_complete_skb,
                .rx_skb = mt7615_queue_rx_skb,
index 7705e55aa3d1728e2c3eaff69b16be9bc6d9827e..d20fd40418a77867808b5a97fbf14d5c907b1b17 100644 (file)
@@ -155,7 +155,7 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
        static const struct mt76_driver_ops drv_ops = {
                .txwi_size = sizeof(struct mt76x02_txwi),
-               .tx_aligned4_skbs = true,
+               .drv_flags = MT_DRV_TX_ALIGNED4_SKBS,
                .update_survey = mt76x02_update_channel,
                .tx_prepare_skb = mt76x02_tx_prepare_skb,
                .tx_complete_skb = mt76x02_tx_complete_skb,
index cf611d1b817c07dd5179c1dc2aa0182975904a3f..3d8408d11f0e3eabb292db324c25abf290761c6a 100644 (file)
@@ -21,7 +21,7 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
        static const struct mt76_driver_ops drv_ops = {
                .txwi_size = sizeof(struct mt76x02_txwi),
-               .tx_aligned4_skbs = true,
+               .drv_flags = MT_DRV_TX_ALIGNED4_SKBS,
                .update_survey = mt76x02_update_channel,
                .tx_prepare_skb = mt76x02_tx_prepare_skb,
                .tx_complete_skb = mt76x02_tx_complete_skb,