[rdc] fix link checking with switches, only port1 of switches would report link up
[openwrt/svn-archive/archive.git] / target / linux / rdc / patches-2.6.32 / 013-r6040_fix_mii_check_media.patch
1 diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
2 index 4122916..eeee379 100644
3 --- a/drivers/net/r6040.c
4 +++ b/drivers/net/r6040.c
5 @@ -400,9 +400,6 @@ static void r6040_init_mac_regs(struct net_device *dev)
6 * we may got called by r6040_tx_timeout which has left
7 * some unsent tx buffers */
8 iowrite16(0x01, ioaddr + MTPR);
9 -
10 - /* Check media */
11 - mii_check_media(&lp->mii_if, 1, 1);
12 }
13
14 static void r6040_tx_timeout(struct net_device *dev)
15 @@ -530,8 +527,6 @@ static int r6040_phy_mode_chk(struct net_device *dev)
16 phy_dat = 0x0000;
17 }
18
19 - mii_check_media(&lp->mii_if, 0, 1);
20 -
21 return phy_dat;
22 };
23
24 @@ -813,6 +808,9 @@ static void r6040_timer(unsigned long data)
25
26 /* Timer active again */
27 mod_timer(&lp->timer, round_jiffies(jiffies + HZ));
28 +
29 + /* Check media */
30 + mii_check_media(&lp->mii_if, 1, 1);
31 }
32
33 /* Read/set MAC address routines */