r6040: fix link checking with switches
Subsystems (2)
PATCH 1/1 r6040: fix link checking with switches
The current link checking logic only works for one port, which is not correct for swiches were multiple ports can have different link status. As a result we would only check for link status on port 1 of the switch. Move the calls to mii_check_media in r6040_timer which will be polling a single PHY chip correctly and assume link is up for switches.
--- drivers/net/r6040.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/net/r6040.c +3 -5
@@ -400,9 +400,6 @@ static void r6040_init_mac_regs(struct net_device *dev)* we may got called by r6040_tx_timeout which has left * some unsent tx buffers */ iowrite16 (0x01 , ioaddr +MTPR ); - -/* Check media */ -mii_check_media (&lp->mii_if,1 ,1 ); }static void r6040_tx_timeout (struct net_device *dev)
@@ -530,8 +527,6 @@ static int r6040_phy_mode_chk(struct net_device *dev) phy_dat =0x0000 ; } -mii_check_media (&lp->mii_if,0 ,1 ); -return phy_dat; };
@@ -813,6 +808,9 @@ static void r6040_timer(unsigned long data)/* Timer active again */ mod_timer (&lp->timer,round_jiffies (jiffies +HZ )); + +/* Check media */ +mii_check_media (&lp->mii_if,1 ,1 ); }/* Read/set MAC address routines */
Signature · 1 line
1.7.1
From: Florian Fainelli <[email protected]>
Date: Sun, 16 May 2010 14:30:56 +0200
Quoted 7 lines
The current link checking logic only works for one port, which is not correct for swiches were multiple ports can have different link status. As a result we would only check for link status on port 1 of the switch. Move the calls to
mii_check_mediainr6040_timerwhich will be polling a single PHY chip correctly and assume link is up for switches.Signed-off-by Florian Fainelli <[email protected]>
Applied.