a002a5f85163d4c0d91bc5c2d4e13dd019795402
[openwrt/staging/ldir.git] /
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
4
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()
8
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Signed-off-by: David S. Miller <davem@davemloft.net>
11 ---
12
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
16
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]);
23 }
24
25 static void
26 @@ -688,10 +688,10 @@ mtk_wed_ring_alloc(struct mtk_wed_device
27 }
28
29 static int
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)
32 {
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];
36
37 if (mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE, desc_size))
38 return -ENOMEM;
39 @@ -805,9 +805,9 @@ mtk_wed_start(struct mtk_wed_device *dev
40 {
41 int i;
42
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);
49
50 mtk_wed_hw_init(dev);
51 mtk_wed_configure_irq(dev, irq_mask);
52 @@ -916,7 +916,7 @@ mtk_wed_tx_ring_setup(struct mtk_wed_dev
53 sizeof(*ring->desc)))
54 return -ENOMEM;
55
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))
58 return -ENOMEM;
59
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
63 @@ -7,6 +7,7 @@
64 #include <linux/pci.h>
65
66 #define MTK_WED_TX_QUEUES 2
67 +#define MTK_WED_RX_QUEUES 2
68
69 struct mtk_wed_hw;
70 struct mtk_wdma_desc;
71 @@ -66,7 +67,7 @@ struct mtk_wed_device {
72
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];
77
78 struct {
79 int size;