diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index f9ba2e478a69..1f647b9ce352 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -470,7 +470,7 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) | |||
470 | { | 470 | { |
471 | int i; | 471 | int i; |
472 | 472 | ||
473 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0xFF) << 16 | value); | 473 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0x1f) << 16 | (value & 0xffff)); |
474 | 474 | ||
475 | for (i = 20; i > 0; i--) { | 475 | for (i = 20; i > 0; i--) { |
476 | /* | 476 | /* |
@@ -487,7 +487,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
487 | { | 487 | { |
488 | int i, value = -1; | 488 | int i, value = -1; |
489 | 489 | ||
490 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0xFF) << 16); | 490 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0x1f) << 16); |
491 | 491 | ||
492 | for (i = 20; i > 0; i--) { | 492 | for (i = 20; i > 0; i--) { |
493 | /* | 493 | /* |
@@ -495,7 +495,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
495 | * the specified MII register. | 495 | * the specified MII register. |
496 | */ | 496 | */ |
497 | if (RTL_R32(PHYAR) & 0x80000000) { | 497 | if (RTL_R32(PHYAR) & 0x80000000) { |
498 | value = (int) (RTL_R32(PHYAR) & 0xFFFF); | 498 | value = RTL_R32(PHYAR) & 0xffff; |
499 | break; | 499 | break; |
500 | } | 500 | } |
501 | udelay(25); | 501 | udelay(25); |