1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Sat, 5 Nov 2022 23:36:20 +0100
3 Subject: [PATCH] net: ethernet: mtk_wed: rename tx_wdma array in rx_wdma
5 Rename tx_wdma queue array in rx_wdma since this is rx side of wdma soc.
6 Moreover rename mtk_wed_wdma_ring_setup routine in
7 mtk_wed_wdma_rx_ring_setup()
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Signed-off-by: David S. Miller <davem@davemloft.net>
13 --- a/drivers/net/ethernet/mediatek/mtk_wed.c
14 +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
15 @@ -253,8 +253,8 @@ mtk_wed_free_tx_rings(struct mtk_wed_dev
17 for (i = 0; i < ARRAY_SIZE(dev->tx_ring); i++)
18 mtk_wed_free_ring(dev, &dev->tx_ring[i]);
19 - for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
20 - mtk_wed_free_ring(dev, &dev->tx_wdma[i]);
21 + for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
22 + mtk_wed_free_ring(dev, &dev->rx_wdma[i]);
26 @@ -688,10 +688,10 @@ mtk_wed_ring_alloc(struct mtk_wed_device
30 -mtk_wed_wdma_ring_setup(struct mtk_wed_device *dev, int idx, int size)
31 +mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size)
33 u32 desc_size = sizeof(struct mtk_wdma_desc) * dev->hw->version;
34 - struct mtk_wed_ring *wdma = &dev->tx_wdma[idx];
35 + struct mtk_wed_ring *wdma = &dev->rx_wdma[idx];
37 if (mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE, desc_size))
39 @@ -805,9 +805,9 @@ mtk_wed_start(struct mtk_wed_device *dev
43 - for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
44 - if (!dev->tx_wdma[i].desc)
45 - mtk_wed_wdma_ring_setup(dev, i, 16);
46 + for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
47 + if (!dev->rx_wdma[i].desc)
48 + mtk_wed_wdma_rx_ring_setup(dev, i, 16);
51 mtk_wed_configure_irq(dev, irq_mask);
52 @@ -916,7 +916,7 @@ mtk_wed_tx_ring_setup(struct mtk_wed_dev
56 - if (mtk_wed_wdma_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE))
57 + if (mtk_wed_wdma_rx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE))
60 ring->reg_base = MTK_WED_RING_TX(idx);
61 --- a/include/linux/soc/mediatek/mtk_wed.h
62 +++ b/include/linux/soc/mediatek/mtk_wed.h
64 #include <linux/pci.h>
66 #define MTK_WED_TX_QUEUES 2
67 +#define MTK_WED_RX_QUEUES 2
71 @@ -66,7 +67,7 @@ struct mtk_wed_device {
73 struct mtk_wed_ring tx_ring[MTK_WED_TX_QUEUES];
74 struct mtk_wed_ring txfree_ring;
75 - struct mtk_wed_ring tx_wdma[MTK_WED_TX_QUEUES];
76 + struct mtk_wed_ring rx_wdma[MTK_WED_RX_QUEUES];