diff options
| -rw-r--r-- | drivers/net/e1000e/lib.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index 089578f6855a..37753d13cd22 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
| @@ -575,20 +575,42 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) | |||
| 575 | */ | 575 | */ |
| 576 | /* SYNCH bit and IV bit are sticky. */ | 576 | /* SYNCH bit and IV bit are sticky. */ |
| 577 | udelay(10); | 577 | udelay(10); |
| 578 | if (E1000_RXCW_SYNCH & er32(RXCW)) { | 578 | rxcw = er32(RXCW); |
| 579 | if (rxcw & E1000_RXCW_SYNCH) { | ||
| 579 | if (!(rxcw & E1000_RXCW_IV)) { | 580 | if (!(rxcw & E1000_RXCW_IV)) { |
| 580 | mac->serdes_has_link = 1; | 581 | mac->serdes_has_link = true; |
| 581 | hw_dbg(hw, "SERDES: Link is up.\n"); | 582 | hw_dbg(hw, "SERDES: Link up - forced.\n"); |
| 582 | } | 583 | } |
| 583 | } else { | 584 | } else { |
| 584 | mac->serdes_has_link = 0; | 585 | mac->serdes_has_link = false; |
| 585 | hw_dbg(hw, "SERDES: Link is down.\n"); | 586 | hw_dbg(hw, "SERDES: Link down - force failed.\n"); |
| 586 | } | 587 | } |
| 587 | } | 588 | } |
| 588 | 589 | ||
| 589 | if (E1000_TXCW_ANE & er32(TXCW)) { | 590 | if (E1000_TXCW_ANE & er32(TXCW)) { |
| 590 | status = er32(STATUS); | 591 | status = er32(STATUS); |
| 591 | mac->serdes_has_link = (status & E1000_STATUS_LU); | 592 | if (status & E1000_STATUS_LU) { |
| 593 | /* SYNCH bit and IV bit are sticky, so reread rxcw. */ | ||
| 594 | udelay(10); | ||
| 595 | rxcw = er32(RXCW); | ||
| 596 | if (rxcw & E1000_RXCW_SYNCH) { | ||
| 597 | if (!(rxcw & E1000_RXCW_IV)) { | ||
| 598 | mac->serdes_has_link = true; | ||
| 599 | hw_dbg(hw, "SERDES: Link up - autoneg " | ||
| 600 | "completed sucessfully.\n"); | ||
| 601 | } else { | ||
| 602 | mac->serdes_has_link = false; | ||
| 603 | hw_dbg(hw, "SERDES: Link down - invalid" | ||
| 604 | "codewords detected in autoneg.\n"); | ||
| 605 | } | ||
| 606 | } else { | ||
| 607 | mac->serdes_has_link = false; | ||
| 608 | hw_dbg(hw, "SERDES: Link down - no sync.\n"); | ||
| 609 | } | ||
| 610 | } else { | ||
| 611 | mac->serdes_has_link = false; | ||
| 612 | hw_dbg(hw, "SERDES: Link down - autoneg failed\n"); | ||
| 613 | } | ||
| 592 | } | 614 | } |
| 593 | 615 | ||
| 594 | return 0; | 616 | return 0; |
