diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-05-15 22:30:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-17 20:44:36 -0400 |
commit | ce26b4d1d52c9a881a99fd316c32e58cdf2d586e (patch) | |
tree | 2bd36f052362f140d6aeea0182fa4039c20d4545 /drivers/net/r6040.c | |
parent | b14ed884df5968b0977114ebd5a22f58d0d15315 (diff) |
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.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r-- | drivers/net/r6040.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index 3cc7befa3eb1..9a251acf5ab8 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -400,9 +400,6 @@ static void r6040_init_mac_regs(struct net_device *dev) | |||
400 | * we may got called by r6040_tx_timeout which has left | 400 | * we may got called by r6040_tx_timeout which has left |
401 | * some unsent tx buffers */ | 401 | * some unsent tx buffers */ |
402 | iowrite16(0x01, ioaddr + MTPR); | 402 | iowrite16(0x01, ioaddr + MTPR); |
403 | |||
404 | /* Check media */ | ||
405 | mii_check_media(&lp->mii_if, 1, 1); | ||
406 | } | 403 | } |
407 | 404 | ||
408 | static void r6040_tx_timeout(struct net_device *dev) | 405 | static void r6040_tx_timeout(struct net_device *dev) |
@@ -530,8 +527,6 @@ static int r6040_phy_mode_chk(struct net_device *dev) | |||
530 | phy_dat = 0x0000; | 527 | phy_dat = 0x0000; |
531 | } | 528 | } |
532 | 529 | ||
533 | mii_check_media(&lp->mii_if, 0, 1); | ||
534 | |||
535 | return phy_dat; | 530 | return phy_dat; |
536 | }; | 531 | }; |
537 | 532 | ||
@@ -813,6 +808,9 @@ static void r6040_timer(unsigned long data) | |||
813 | 808 | ||
814 | /* Timer active again */ | 809 | /* Timer active again */ |
815 | mod_timer(&lp->timer, round_jiffies(jiffies + HZ)); | 810 | mod_timer(&lp->timer, round_jiffies(jiffies + HZ)); |
811 | |||
812 | /* Check media */ | ||
813 | mii_check_media(&lp->mii_if, 1, 1); | ||
816 | } | 814 | } |
817 | 815 | ||
818 | /* Read/set MAC address routines */ | 816 | /* Read/set MAC address routines */ |