diff options
Diffstat (limited to 'drivers/net/e1000e/ethtool.c')
-rw-r--r-- | drivers/net/e1000e/ethtool.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c index 4d25ede88369..1bf4d2a5d34f 100644 --- a/drivers/net/e1000e/ethtool.c +++ b/drivers/net/e1000e/ethtool.c | |||
@@ -167,6 +167,15 @@ static int e1000_get_settings(struct net_device *netdev, | |||
167 | 167 | ||
168 | ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) || | 168 | ecmd->autoneg = ((hw->phy.media_type == e1000_media_type_fiber) || |
169 | hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE; | 169 | hw->mac.autoneg) ? AUTONEG_ENABLE : AUTONEG_DISABLE; |
170 | |||
171 | /* MDI-X => 2; MDI =>1; Invalid =>0 */ | ||
172 | if ((hw->phy.media_type == e1000_media_type_copper) && | ||
173 | !hw->mac.get_link_status) | ||
174 | ecmd->eth_tp_mdix = hw->phy.is_mdix ? ETH_TP_MDI_X : | ||
175 | ETH_TP_MDI; | ||
176 | else | ||
177 | ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID; | ||
178 | |||
170 | return 0; | 179 | return 0; |
171 | } | 180 | } |
172 | 181 | ||
@@ -776,6 +785,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
776 | u32 after; | 785 | u32 after; |
777 | u32 i; | 786 | u32 i; |
778 | u32 toggle; | 787 | u32 toggle; |
788 | u32 mask; | ||
779 | 789 | ||
780 | /* | 790 | /* |
781 | * The status register is Read Only, so a write should fail. | 791 | * The status register is Read Only, so a write should fail. |
@@ -788,17 +798,9 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
788 | case e1000_80003es2lan: | 798 | case e1000_80003es2lan: |
789 | toggle = 0x7FFFF3FF; | 799 | toggle = 0x7FFFF3FF; |
790 | break; | 800 | break; |
791 | case e1000_82573: | 801 | default: |
792 | case e1000_82574: | ||
793 | case e1000_82583: | ||
794 | case e1000_ich8lan: | ||
795 | case e1000_ich9lan: | ||
796 | case e1000_ich10lan: | ||
797 | toggle = 0x7FFFF033; | 802 | toggle = 0x7FFFF033; |
798 | break; | 803 | break; |
799 | default: | ||
800 | toggle = 0xFFFFF833; | ||
801 | break; | ||
802 | } | 804 | } |
803 | 805 | ||
804 | before = er32(STATUS); | 806 | before = er32(STATUS); |
@@ -844,11 +846,18 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
844 | REG_PATTERN_TEST(E1000_TXCW, 0xC000FFFF, 0x0000FFFF); | 846 | REG_PATTERN_TEST(E1000_TXCW, 0xC000FFFF, 0x0000FFFF); |
845 | REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); | 847 | REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); |
846 | REG_PATTERN_TEST(E1000_TIDV, 0x0000FFFF, 0x0000FFFF); | 848 | REG_PATTERN_TEST(E1000_TIDV, 0x0000FFFF, 0x0000FFFF); |
849 | mask = 0x8003FFFF; | ||
850 | switch (mac->type) { | ||
851 | case e1000_ich10lan: | ||
852 | case e1000_pchlan: | ||
853 | mask |= (1 << 18); | ||
854 | break; | ||
855 | default: | ||
856 | break; | ||
857 | } | ||
847 | for (i = 0; i < mac->rar_entry_count; i++) | 858 | for (i = 0; i < mac->rar_entry_count; i++) |
848 | REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), | 859 | REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), |
849 | ((mac->type == e1000_ich10lan) ? | 860 | mask, 0xFFFFFFFF); |
850 | 0x8007FFFF : 0x8003FFFF), | ||
851 | 0xFFFFFFFF); | ||
852 | 861 | ||
853 | for (i = 0; i < mac->mta_reg_count; i++) | 862 | for (i = 0; i < mac->mta_reg_count; i++) |
854 | REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF); | 863 | REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF); |
@@ -1786,15 +1795,22 @@ static int e1000_set_wol(struct net_device *netdev, | |||
1786 | /* bit defines for adapter->led_status */ | 1795 | /* bit defines for adapter->led_status */ |
1787 | #define E1000_LED_ON 0 | 1796 | #define E1000_LED_ON 0 |
1788 | 1797 | ||
1789 | static void e1000_led_blink_callback(unsigned long data) | 1798 | static void e1000e_led_blink_task(struct work_struct *work) |
1790 | { | 1799 | { |
1791 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 1800 | struct e1000_adapter *adapter = container_of(work, |
1801 | struct e1000_adapter, led_blink_task); | ||
1792 | 1802 | ||
1793 | if (test_and_change_bit(E1000_LED_ON, &adapter->led_status)) | 1803 | if (test_and_change_bit(E1000_LED_ON, &adapter->led_status)) |
1794 | adapter->hw.mac.ops.led_off(&adapter->hw); | 1804 | adapter->hw.mac.ops.led_off(&adapter->hw); |
1795 | else | 1805 | else |
1796 | adapter->hw.mac.ops.led_on(&adapter->hw); | 1806 | adapter->hw.mac.ops.led_on(&adapter->hw); |
1807 | } | ||
1808 | |||
1809 | static void e1000_led_blink_callback(unsigned long data) | ||
1810 | { | ||
1811 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | ||
1797 | 1812 | ||
1813 | schedule_work(&adapter->led_blink_task); | ||
1798 | mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL); | 1814 | mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL); |
1799 | } | 1815 | } |
1800 | 1816 | ||
@@ -1807,7 +1823,9 @@ static int e1000_phys_id(struct net_device *netdev, u32 data) | |||
1807 | data = INT_MAX; | 1823 | data = INT_MAX; |
1808 | 1824 | ||
1809 | if ((hw->phy.type == e1000_phy_ife) || | 1825 | if ((hw->phy.type == e1000_phy_ife) || |
1826 | (hw->mac.type == e1000_pchlan) || | ||
1810 | (hw->mac.type == e1000_82574)) { | 1827 | (hw->mac.type == e1000_82574)) { |
1828 | INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task); | ||
1811 | if (!adapter->blink_timer.function) { | 1829 | if (!adapter->blink_timer.function) { |
1812 | init_timer(&adapter->blink_timer); | 1830 | init_timer(&adapter->blink_timer); |
1813 | adapter->blink_timer.function = | 1831 | adapter->blink_timer.function = |