diff options
Diffstat (limited to 'drivers/net/r8169.c')
| -rw-r--r-- | drivers/net/r8169.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 2e1bed153c39..6e1018448eea 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -484,13 +484,12 @@ static void mdio_write(void __iomem *ioaddr, int RegAddr, int value) | |||
| 484 | int i; | 484 | int i; |
| 485 | 485 | ||
| 486 | RTL_W32(PHYAR, 0x80000000 | (RegAddr & 0xFF) << 16 | value); | 486 | RTL_W32(PHYAR, 0x80000000 | (RegAddr & 0xFF) << 16 | value); |
| 487 | udelay(1000); | ||
| 488 | 487 | ||
| 489 | for (i = 2000; i > 0; i--) { | 488 | for (i = 20; i > 0; i--) { |
| 490 | /* Check if the RTL8169 has completed writing to the specified MII register */ | 489 | /* Check if the RTL8169 has completed writing to the specified MII register */ |
| 491 | if (!(RTL_R32(PHYAR) & 0x80000000)) | 490 | if (!(RTL_R32(PHYAR) & 0x80000000)) |
| 492 | break; | 491 | break; |
| 493 | udelay(100); | 492 | udelay(25); |
| 494 | } | 493 | } |
| 495 | } | 494 | } |
| 496 | 495 | ||
| @@ -499,15 +498,14 @@ static int mdio_read(void __iomem *ioaddr, int RegAddr) | |||
| 499 | int i, value = -1; | 498 | int i, value = -1; |
| 500 | 499 | ||
| 501 | RTL_W32(PHYAR, 0x0 | (RegAddr & 0xFF) << 16); | 500 | RTL_W32(PHYAR, 0x0 | (RegAddr & 0xFF) << 16); |
| 502 | udelay(1000); | ||
| 503 | 501 | ||
| 504 | for (i = 2000; i > 0; i--) { | 502 | for (i = 20; i > 0; i--) { |
| 505 | /* Check if the RTL8169 has completed retrieving data from the specified MII register */ | 503 | /* Check if the RTL8169 has completed retrieving data from the specified MII register */ |
| 506 | if (RTL_R32(PHYAR) & 0x80000000) { | 504 | if (RTL_R32(PHYAR) & 0x80000000) { |
| 507 | value = (int) (RTL_R32(PHYAR) & 0xFFFF); | 505 | value = (int) (RTL_R32(PHYAR) & 0xFFFF); |
| 508 | break; | 506 | break; |
| 509 | } | 507 | } |
| 510 | udelay(100); | 508 | udelay(25); |
| 511 | } | 509 | } |
| 512 | return value; | 510 | return value; |
| 513 | } | 511 | } |
| @@ -677,6 +675,9 @@ static int rtl8169_set_speed_xmii(struct net_device *dev, | |||
| 677 | 675 | ||
| 678 | if (duplex == DUPLEX_HALF) | 676 | if (duplex == DUPLEX_HALF) |
| 679 | auto_nego &= ~(PHY_Cap_10_Full | PHY_Cap_100_Full); | 677 | auto_nego &= ~(PHY_Cap_10_Full | PHY_Cap_100_Full); |
| 678 | |||
| 679 | if (duplex == DUPLEX_FULL) | ||
| 680 | auto_nego &= ~(PHY_Cap_10_Half | PHY_Cap_100_Half); | ||
| 680 | } | 681 | } |
| 681 | 682 | ||
| 682 | tp->phy_auto_nego_reg = auto_nego; | 683 | tp->phy_auto_nego_reg = auto_nego; |
