aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000/e1000_ethtool.c')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index b27b71b8834f..58a1836f53fd 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -651,6 +651,9 @@ err_setup_rx:
651 E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \ 651 E1000_WRITE_REG(&adapter->hw, R, (test[pat] & W)); \
652 value = E1000_READ_REG(&adapter->hw, R); \ 652 value = E1000_READ_REG(&adapter->hw, R); \
653 if(value != (test[pat] & W & M)) { \ 653 if(value != (test[pat] & W & M)) { \
654 DPRINTK(DRV, ERR, "pattern test reg %04X failed: got " \
655 "0x%08X expected 0x%08X\n", \
656 E1000_##R, value, (test[pat] & W & M)); \
654 *data = (adapter->hw.mac_type < e1000_82543) ? \ 657 *data = (adapter->hw.mac_type < e1000_82543) ? \
655 E1000_82542_##R : E1000_##R; \ 658 E1000_82542_##R : E1000_##R; \
656 return 1; \ 659 return 1; \
@@ -663,7 +666,9 @@ err_setup_rx:
663 uint32_t value; \ 666 uint32_t value; \
664 E1000_WRITE_REG(&adapter->hw, R, W & M); \ 667 E1000_WRITE_REG(&adapter->hw, R, W & M); \
665 value = E1000_READ_REG(&adapter->hw, R); \ 668 value = E1000_READ_REG(&adapter->hw, R); \
666 if ((W & M) != (value & M)) { \ 669 if((W & M) != (value & M)) { \
670 DPRINTK(DRV, ERR, "set/check reg %04X test failed: got 0x%08X "\
671 "expected 0x%08X\n", E1000_##R, (value & M), (W & M)); \
667 *data = (adapter->hw.mac_type < e1000_82543) ? \ 672 *data = (adapter->hw.mac_type < e1000_82543) ? \
668 E1000_82542_##R : E1000_##R; \ 673 E1000_82542_##R : E1000_##R; \
669 return 1; \ 674 return 1; \
@@ -673,18 +678,33 @@ err_setup_rx:
673static int 678static int
674e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data) 679e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
675{ 680{
676 uint32_t value; 681 uint32_t value, before, after;
677 uint32_t i; 682 uint32_t i, toggle;
678 683
679 /* The status register is Read Only, so a write should fail. 684 /* The status register is Read Only, so a write should fail.
680 * Some bits that get toggled are ignored. 685 * Some bits that get toggled are ignored.
681 */ 686 */
682 value = (E1000_READ_REG(&adapter->hw, STATUS) & (0xFFFFF833)); 687 switch (adapter->hw.mac_type) {
683 E1000_WRITE_REG(&adapter->hw, STATUS, (0xFFFFFFFF)); 688 case e1000_82573:
684 if(value != (E1000_READ_REG(&adapter->hw, STATUS) & (0xFFFFF833))) { 689 toggle = 0x7FFFF033;
690 break;
691 default:
692 toggle = 0xFFFFF833;
693 break;
694 }
695
696 before = E1000_READ_REG(&adapter->hw, STATUS);
697 value = (E1000_READ_REG(&adapter->hw, STATUS) & toggle);
698 E1000_WRITE_REG(&adapter->hw, STATUS, toggle);
699 after = E1000_READ_REG(&adapter->hw, STATUS) & toggle;
700 if(value != after) {
701 DPRINTK(DRV, ERR, "failed STATUS register test got: "
702 "0x%08X expected: 0x%08X\n", after, value);
685 *data = 1; 703 *data = 1;
686 return 1; 704 return 1;
687 } 705 }
706 /* restore previous status */
707 E1000_WRITE_REG(&adapter->hw, STATUS, before);
688 708
689 REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); 709 REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
690 REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); 710 REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF);