diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2008-11-21 19:50:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 19:50:34 -0500 |
commit | 63dcf3d353f32ca7007bfa53a9384f3283076afc (patch) | |
tree | 63d9115b2275213b50c9b7b926449f4031e4ee69 | |
parent | 5aa49c82118d2aa08c6cfaba01fd86f969b3f1d7 (diff) |
e1000e: 82571 check for link fix on 82571 serdes
Check for link test does not work properly for 82571 parts in a blade
environment with an unterminated serdes link partner. Make the test more
robust by checking the invalid bit.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-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; |