This patch allows the platform to configure the default ethernet tx/rx ring
size (specifcally, for the ar7242 ag7240 device as found in the D-Link
DIR-632-A1).  This patch only causes the platform data to be used if
specifically initialised in the board specific support, otherwise the existing
defaults remain in place.

This change allows the DIR-632-A1 to set the ring sizes to the same values as
is done in the DD-WRT ag7240 driver.

Signed-off-by: Andrew McDonnell <[email protected]>
---
 .../mips/include/asm/mach-ath79/ag71xx_platform.h  |    3 +++
 .../net/ethernet/atheros/ag71xx/ag71xx_main.c      |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
index 656a6ef..dcc1170 100644
--- 
a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
+++ 
b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
@@ -45,6 +45,9 @@ struct ag71xx_platform_data {
        u32             fifo_cfg1;
        u32             fifo_cfg2;
        u32             fifo_cfg3;
+
+       unsigned        tx_ring_size;
+       unsigned        rx_ring_size;
 };

 struct ag71xx_mdio_platform_data {
diff --git
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 50029ff..2e1d39e 100644
--- 
a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ 
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1149,6 +1149,12 @@ static int ag71xx_probe(struct platform_device *pdev)

        ag->tx_ring.size = AG71XX_TX_RING_SIZE_DEFAULT;
        ag->rx_ring.size = AG71XX_RX_RING_SIZE_DEFAULT;
+       if (pdata->tx_ring_size > 0 && pdata->tx_ring_size <
AG71XX_TX_RING_SIZE_MAX) {
+               ag->tx_ring.size = pdata->tx_ring_size;
+       }
+       if (pdata->rx_ring_size > 0 && pdata->rx_ring_size <
AG71XX_RX_RING_SIZE_MAX) {
+               ag->rx_ring.size = pdata->rx_ring_size;
+       }

        ag->stop_desc = dma_alloc_coherent(NULL,
                sizeof(struct ag71xx_desc), &ag->stop_desc_dma, GFP_KERNEL);
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to