aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/r8169.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 2e1bed153c39..a81338b501fb 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}