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>

SVN-Revision: 23127
This commit is contained in:
Gabor Juhos 2010-09-27 14:42:05 +00:00
parent 5721f06fe1
commit dc4df4ca65
2 changed files with 10 additions and 0 deletions

View file

@ -26,6 +26,7 @@
#define RTL8366RB_PHY_NO_MAX 4 #define RTL8366RB_PHY_NO_MAX 4
#define RTL8366RB_PHY_PAGE_MAX 7 #define RTL8366RB_PHY_PAGE_MAX 7
#define RTL8366RB_PHY_ADDR_MAX 31 #define RTL8366RB_PHY_ADDR_MAX 31
#define RTL8366RB_PHY_WAN 4
/* Switch Global Configuration register */ /* Switch Global Configuration register */
#define RTL8366RB_SGCR 0x0000 #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) 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; return 0;
} }

View file

@ -25,6 +25,7 @@
#define RTL8366S_PHY_NO_MAX 4 #define RTL8366S_PHY_NO_MAX 4
#define RTL8366S_PHY_PAGE_MAX 7 #define RTL8366S_PHY_PAGE_MAX 7
#define RTL8366S_PHY_ADDR_MAX 31 #define RTL8366S_PHY_ADDR_MAX 31
#define RTL8366S_PHY_WAN 4
/* Switch Global Configuration register */ /* Switch Global Configuration register */
#define RTL8366S_SGCR 0x0000 #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) 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; return 0;
} }