aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-09-27 14:42:05 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-09-27 14:42:05 +0000
commit9ec1d552dbb27f26fd4de11374d2b572b524742d (patch)
tree65a725524a0e85eb2e03e837caf61db72d8e2020
parente0c47b311ff5e1e4ab60beb3cd7c1b599efb6f12 (diff)
downloadmaster-187ad058-9ec1d552dbb27f26fd4de11374d2b572b524742d.tar.gz
master-187ad058-9ec1d552dbb27f26fd4de11374d2b572b524742d.tar.bz2
master-187ad058-9ec1d552dbb27f26fd4de11374d2b572b524742d.zip
generic: RTL8366S/RB: Fix autonegotiation for the WAN port.
The RTL8366S/RB support connecting a second mac to it and using the 5th port as an independent phy. Therefore we need to handle autonegotiation changes for phy 4 like on a single phy device. This fixes #7980, verified on a WNDR3700. Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23127 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366rb.c5
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366s.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
index 7db3e65780..b55729bb75 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
@@ -26,6 +26,7 @@
#define RTL8366RB_PHY_NO_MAX 4
#define RTL8366RB_PHY_PAGE_MAX 7
#define RTL8366RB_PHY_ADDR_MAX 31
+#define RTL8366RB_PHY_WAN 4
/* Switch Global Configuration register */
#define RTL8366RB_SGCR 0x0000
@@ -1272,6 +1273,10 @@ static int rtl8366rb_phy_config_init(struct phy_device *phydev)
static int rtl8366rb_phy_config_aneg(struct phy_device *phydev)
{
+ /* phy 4 might be connected to a second mac, allow aneg config */
+ if (phydev->addr == RTL8366RB_PHY_WAN)
+ return genphy_config_aneg(phydev);
+
return 0;
}
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
index 66dc2db0df..d45e4d76c3 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
@@ -25,6 +25,7 @@
#define RTL8366S_PHY_NO_MAX 4
#define RTL8366S_PHY_PAGE_MAX 7
#define RTL8366S_PHY_ADDR_MAX 31
+#define RTL8366S_PHY_WAN 4
/* Switch Global Configuration register */
#define RTL8366S_SGCR 0x0000
@@ -1090,6 +1091,10 @@ static int rtl8366s_phy_config_init(struct phy_device *phydev)
static int rtl8366s_phy_config_aneg(struct phy_device *phydev)
{
+ /* phy 4 might be connected to a second mac, allow aneg config */
+ if (phydev->addr == RTL8366S_PHY_WAN)
+ return genphy_config_aneg(phydev);
+
return 0;
}