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.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 773821e4cf57..da459f7177c6 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -85,6 +85,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
85 { "tx_single_coll_ok", E1000_STAT(stats.scc) }, 85 { "tx_single_coll_ok", E1000_STAT(stats.scc) },
86 { "tx_multi_coll_ok", E1000_STAT(stats.mcc) }, 86 { "tx_multi_coll_ok", E1000_STAT(stats.mcc) },
87 { "tx_timeout_count", E1000_STAT(tx_timeout_count) }, 87 { "tx_timeout_count", E1000_STAT(tx_timeout_count) },
88 { "tx_restart_queue", E1000_STAT(restart_queue) },
88 { "rx_long_length_errors", E1000_STAT(stats.roc) }, 89 { "rx_long_length_errors", E1000_STAT(stats.roc) },
89 { "rx_short_length_errors", E1000_STAT(stats.ruc) }, 90 { "rx_short_length_errors", E1000_STAT(stats.ruc) },
90 { "rx_align_errors", E1000_STAT(stats.algnerrc) }, 91 { "rx_align_errors", E1000_STAT(stats.algnerrc) },
@@ -133,9 +134,7 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
133 134
134 if (hw->autoneg == 1) { 135 if (hw->autoneg == 1) {
135 ecmd->advertising |= ADVERTISED_Autoneg; 136 ecmd->advertising |= ADVERTISED_Autoneg;
136
137 /* the e1000 autoneg seems to match ethtool nicely */ 137 /* the e1000 autoneg seems to match ethtool nicely */
138
139 ecmd->advertising |= hw->autoneg_advertised; 138 ecmd->advertising |= hw->autoneg_advertised;
140 } 139 }
141 140
@@ -285,7 +284,7 @@ e1000_set_pauseparam(struct net_device *netdev,
285 e1000_reset(adapter); 284 e1000_reset(adapter);
286 } else 285 } else
287 retval = ((hw->media_type == e1000_media_type_fiber) ? 286 retval = ((hw->media_type == e1000_media_type_fiber) ?
288 e1000_setup_link(hw) : e1000_force_mac_fc(hw)); 287 e1000_setup_link(hw) : e1000_force_mac_fc(hw));
289 288
290 clear_bit(__E1000_RESETTING, &adapter->flags); 289 clear_bit(__E1000_RESETTING, &adapter->flags);
291 return retval; 290 return retval;
@@ -350,6 +349,13 @@ e1000_set_tso(struct net_device *netdev, uint32_t data)
350 else 349 else
351 netdev->features &= ~NETIF_F_TSO; 350 netdev->features &= ~NETIF_F_TSO;
352 351
352#ifdef NETIF_F_TSO6
353 if (data)
354 netdev->features |= NETIF_F_TSO6;
355 else
356 netdev->features &= ~NETIF_F_TSO6;
357#endif
358
353 DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); 359 DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
354 adapter->tso_force = TRUE; 360 adapter->tso_force = TRUE;
355 return 0; 361 return 0;
@@ -461,7 +467,8 @@ e1000_get_regs(struct net_device *netdev,
461 regs_buff[24] = (uint32_t)phy_data; /* phy local receiver status */ 467 regs_buff[24] = (uint32_t)phy_data; /* phy local receiver status */
462 regs_buff[25] = regs_buff[24]; /* phy remote receiver status */ 468 regs_buff[25] = regs_buff[24]; /* phy remote receiver status */
463 if (hw->mac_type >= e1000_82540 && 469 if (hw->mac_type >= e1000_82540 &&
464 hw->media_type == e1000_media_type_copper) { 470 hw->mac_type < e1000_82571 &&
471 hw->media_type == e1000_media_type_copper) {
465 regs_buff[26] = E1000_READ_REG(hw, MANC); 472 regs_buff[26] = E1000_READ_REG(hw, MANC);
466 } 473 }
467} 474}
@@ -773,7 +780,7 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
773 /* The status register is Read Only, so a write should fail. 780 /* The status register is Read Only, so a write should fail.
774 * Some bits that get toggled are ignored. 781 * Some bits that get toggled are ignored.
775 */ 782 */
776 switch (adapter->hw.mac_type) { 783 switch (adapter->hw.mac_type) {
777 /* there are several bits on newer hardware that are r/w */ 784 /* there are several bits on newer hardware that are r/w */
778 case e1000_82571: 785 case e1000_82571:
779 case e1000_82572: 786 case e1000_82572:
@@ -801,12 +808,14 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
801 } 808 }
802 /* restore previous status */ 809 /* restore previous status */
803 E1000_WRITE_REG(&adapter->hw, STATUS, before); 810 E1000_WRITE_REG(&adapter->hw, STATUS, before);
811
804 if (adapter->hw.mac_type != e1000_ich8lan) { 812 if (adapter->hw.mac_type != e1000_ich8lan) {
805 REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF); 813 REG_PATTERN_TEST(FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
806 REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF); 814 REG_PATTERN_TEST(FCAH, 0x0000FFFF, 0xFFFFFFFF);
807 REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF); 815 REG_PATTERN_TEST(FCT, 0x0000FFFF, 0xFFFFFFFF);
808 REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF); 816 REG_PATTERN_TEST(VET, 0x0000FFFF, 0xFFFFFFFF);
809 } 817 }
818
810 REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF); 819 REG_PATTERN_TEST(RDTR, 0x0000FFFF, 0xFFFFFFFF);
811 REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF); 820 REG_PATTERN_TEST(RDBAH, 0xFFFFFFFF, 0xFFFFFFFF);
812 REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF); 821 REG_PATTERN_TEST(RDLEN, 0x000FFF80, 0x000FFFFF);
@@ -819,8 +828,9 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
819 REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF); 828 REG_PATTERN_TEST(TDLEN, 0x000FFF80, 0x000FFFFF);
820 829
821 REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000); 830 REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x00000000);
831
822 before = (adapter->hw.mac_type == e1000_ich8lan ? 832 before = (adapter->hw.mac_type == e1000_ich8lan ?
823 0x06C3B33E : 0x06DFB3FE); 833 0x06C3B33E : 0x06DFB3FE);
824 REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB); 834 REG_SET_AND_CHECK(RCTL, before, 0x003FFFFB);
825 REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); 835 REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000);
826 836
@@ -833,10 +843,10 @@ e1000_reg_test(struct e1000_adapter *adapter, uint64_t *data)
833 REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); 843 REG_PATTERN_TEST(TDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
834 REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF); 844 REG_PATTERN_TEST(TIDV, 0x0000FFFF, 0x0000FFFF);
835 value = (adapter->hw.mac_type == e1000_ich8lan ? 845 value = (adapter->hw.mac_type == e1000_ich8lan ?
836 E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES); 846 E1000_RAR_ENTRIES_ICH8LAN : E1000_RAR_ENTRIES);
837 for (i = 0; i < value; i++) { 847 for (i = 0; i < value; i++) {
838 REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, 848 REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF,
839 0xFFFFFFFF); 849 0xFFFFFFFF);
840 } 850 }
841 851
842 } else { 852 } else {
@@ -882,8 +892,7 @@ e1000_eeprom_test(struct e1000_adapter *adapter, uint64_t *data)
882} 892}
883 893
884static irqreturn_t 894static irqreturn_t
885e1000_test_intr(int irq, 895e1000_test_intr(int irq, void *data)
886 void *data)
887{ 896{
888 struct net_device *netdev = (struct net_device *) data; 897 struct net_device *netdev = (struct net_device *) data;
889 struct e1000_adapter *adapter = netdev_priv(netdev); 898 struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -904,11 +913,11 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
904 913
905 /* NOTE: we don't test MSI interrupts here, yet */ 914 /* NOTE: we don't test MSI interrupts here, yet */
906 /* Hook up test interrupt handler just for this test */ 915 /* Hook up test interrupt handler just for this test */
907 if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, 916 if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
908 netdev->name, netdev)) 917 netdev))
909 shared_int = FALSE; 918 shared_int = FALSE;
910 else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED, 919 else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
911 netdev->name, netdev)) { 920 netdev->name, netdev)) {
912 *data = 1; 921 *data = 1;
913 return -1; 922 return -1;
914 } 923 }
@@ -924,6 +933,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
924 933
925 if (adapter->hw.mac_type == e1000_ich8lan && i == 8) 934 if (adapter->hw.mac_type == e1000_ich8lan && i == 8)
926 continue; 935 continue;
936
927 /* Interrupt to test */ 937 /* Interrupt to test */
928 mask = 1 << i; 938 mask = 1 << i;
929 939
@@ -1673,7 +1683,7 @@ e1000_diag_test(struct net_device *netdev,
1673 if (e1000_link_test(adapter, &data[4])) 1683 if (e1000_link_test(adapter, &data[4]))
1674 eth_test->flags |= ETH_TEST_FL_FAILED; 1684 eth_test->flags |= ETH_TEST_FL_FAILED;
1675 1685
1676 /* Offline tests aren't run; pass by default */ 1686 /* Online tests aren't run; pass by default */
1677 data[0] = 0; 1687 data[0] = 0;
1678 data[1] = 0; 1688 data[1] = 0;
1679 data[2] = 0; 1689 data[2] = 0;
@@ -1690,6 +1700,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
1690 int retval = 1; /* fail by default */ 1700 int retval = 1; /* fail by default */
1691 1701
1692 switch (hw->device_id) { 1702 switch (hw->device_id) {
1703 case E1000_DEV_ID_82542:
1693 case E1000_DEV_ID_82543GC_FIBER: 1704 case E1000_DEV_ID_82543GC_FIBER:
1694 case E1000_DEV_ID_82543GC_COPPER: 1705 case E1000_DEV_ID_82543GC_COPPER:
1695 case E1000_DEV_ID_82544EI_FIBER: 1706 case E1000_DEV_ID_82544EI_FIBER:
@@ -1715,6 +1726,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol
1715 retval = 0; 1726 retval = 0;
1716 break; 1727 break;
1717 case E1000_DEV_ID_82571EB_QUAD_COPPER: 1728 case E1000_DEV_ID_82571EB_QUAD_COPPER:
1729 case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
1718 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: 1730 case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
1719 /* quad port adapters only support WoL on port A */ 1731 /* quad port adapters only support WoL on port A */
1720 if (!adapter->quad_port_a) { 1732 if (!adapter->quad_port_a) {