From 26879160c0261a7736ea49659624b3feda01bbc1 Mon Sep 17 00:00:00 2001 From: juhosg Date: Fri, 31 Oct 2008 11:50:47 +0000 Subject: [PATCH] [ar71xx] setup speed/duplex on RB-433/450 (closes #4151) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13087 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c | 4 ++++ target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h | 2 +- .../ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c index 8e63acac4..d704d7dca 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c @@ -183,6 +183,8 @@ static void __init rb433_setup(void) ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ar71xx_eth0_data.phy_mask = 0x00000003; + ar71xx_eth0_data.speed = SPEED_100; + ar71xx_eth0_data.duplex = DUPLEX_FULL; ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; ar71xx_eth1_data.phy_mask = 0x00000010; @@ -212,6 +214,8 @@ static void __init rb450_setup(void) ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ar71xx_eth0_data.phy_mask = 0x0000000f; + ar71xx_eth0_data.speed = SPEED_100; + ar71xx_eth0_data.duplex = DUPLEX_FULL; ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; ar71xx_eth1_data.phy_mask = 0x00000010; diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h index 2f60d19b5..5cd7dc2c5 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h @@ -37,7 +37,7 @@ #define ETH_FCS_LEN 4 #define AG71XX_DRV_NAME "ag71xx" -#define AG71XX_DRV_VERSION "0.4.2" +#define AG71XX_DRV_VERSION "0.4.3" #define AG71XX_NAPI_TX 1 diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c index 512b42eb5..e44bea4f1 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c @@ -276,6 +276,17 @@ int ag71xx_phy_connect(struct ag71xx *ag) break; default: + switch (pdata->speed) { + case SPEED_10: + case SPEED_100: + case SPEED_1000: + break; + default: + printk(KERN_ERR "%s: invalid speed specified\n", + dev->name); + return -EINVAL; + } + ag->phy_dev = NULL; printk(KERN_DEBUG "%s: connected to %d PHYs\n", dev->name, phy_count); -- 2.20.1