aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/e1000e/82571.c2
-rw-r--r--drivers/net/e1000e/e1000.h6
-rw-r--r--drivers/net/e1000e/es2lan.c1
-rw-r--r--drivers/net/e1000e/ethtool.c71
-rw-r--r--drivers/net/e1000e/hw.h1
-rw-r--r--drivers/net/e1000e/ich8lan.c4
-rw-r--r--drivers/net/e1000e/lib.c4
-rw-r--r--drivers/net/e1000e/netdev.c2
8 files changed, 32 insertions, 59 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index ae07d37903ba..8295f2192439 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -300,6 +300,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
300 func->set_lan_id = e1000_set_lan_id_single_port; 300 func->set_lan_id = e1000_set_lan_id_single_port;
301 func->check_mng_mode = e1000e_check_mng_mode_generic; 301 func->check_mng_mode = e1000e_check_mng_mode_generic;
302 func->led_on = e1000e_led_on_generic; 302 func->led_on = e1000e_led_on_generic;
303 func->blink_led = e1000e_blink_led_generic;
303 304
304 /* FWSM register */ 305 /* FWSM register */
305 mac->has_fwsm = true; 306 mac->has_fwsm = true;
@@ -320,6 +321,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
320 default: 321 default:
321 func->check_mng_mode = e1000e_check_mng_mode_generic; 322 func->check_mng_mode = e1000e_check_mng_mode_generic;
322 func->led_on = e1000e_led_on_generic; 323 func->led_on = e1000e_led_on_generic;
324 func->blink_led = e1000e_blink_led_generic;
323 325
324 /* FWSM register */ 326 /* FWSM register */
325 mac->has_fwsm = true; 327 mac->has_fwsm = true;
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 3be5478dfdf1..9549879e66a0 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -391,13 +391,10 @@ struct e1000_adapter {
391 391
392 bool fc_autoneg; 392 bool fc_autoneg;
393 393
394 unsigned long led_status;
395
396 unsigned int flags; 394 unsigned int flags;
397 unsigned int flags2; 395 unsigned int flags2;
398 struct work_struct downshift_task; 396 struct work_struct downshift_task;
399 struct work_struct update_phy_task; 397 struct work_struct update_phy_task;
400 struct work_struct led_blink_task;
401 struct work_struct print_hang_task; 398 struct work_struct print_hang_task;
402 399
403 bool idle_check; 400 bool idle_check;
@@ -487,7 +484,6 @@ extern const char e1000e_driver_version[];
487 484
488extern void e1000e_check_options(struct e1000_adapter *adapter); 485extern void e1000e_check_options(struct e1000_adapter *adapter);
489extern void e1000e_set_ethtool_ops(struct net_device *netdev); 486extern void e1000e_set_ethtool_ops(struct net_device *netdev);
490extern void e1000e_led_blink_task(struct work_struct *work);
491 487
492extern int e1000e_up(struct e1000_adapter *adapter); 488extern int e1000e_up(struct e1000_adapter *adapter);
493extern void e1000e_down(struct e1000_adapter *adapter); 489extern void e1000e_down(struct e1000_adapter *adapter);
@@ -575,7 +571,7 @@ extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
575extern void e1000e_config_collision_dist(struct e1000_hw *hw); 571extern void e1000e_config_collision_dist(struct e1000_hw *hw);
576extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw); 572extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
577extern s32 e1000e_force_mac_fc(struct e1000_hw *hw); 573extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
578extern s32 e1000e_blink_led(struct e1000_hw *hw); 574extern s32 e1000e_blink_led_generic(struct e1000_hw *hw);
579extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value); 575extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
580extern s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw); 576extern s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw);
581extern void e1000e_reset_adaptive(struct e1000_hw *hw); 577extern void e1000e_reset_adaptive(struct e1000_hw *hw);
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
index 0279695b6942..f4bbeb22f51f 100644
--- a/drivers/net/e1000e/es2lan.c
+++ b/drivers/net/e1000e/es2lan.c
@@ -1434,6 +1434,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
1434static struct e1000_mac_operations es2_mac_ops = { 1434static struct e1000_mac_operations es2_mac_ops = {
1435 .read_mac_addr = e1000_read_mac_addr_80003es2lan, 1435 .read_mac_addr = e1000_read_mac_addr_80003es2lan,
1436 .id_led_init = e1000e_id_led_init, 1436 .id_led_init = e1000e_id_led_init,
1437 .blink_led = e1000e_blink_led_generic,
1437 .check_mng_mode = e1000e_check_mng_mode_generic, 1438 .check_mng_mode = e1000e_check_mng_mode_generic,
1438 /* check_for_link dependent on media type */ 1439 /* check_for_link dependent on media type */
1439 .cleanup_led = e1000e_cleanup_led_generic, 1440 .cleanup_led = e1000e_cleanup_led_generic,
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index a31d280ffb6d..1d7bf4049c02 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1851,64 +1851,35 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
1851 return 0; 1851 return 0;
1852} 1852}
1853 1853
1854/* toggle LED 4 times per second = 2 "blinks" per second */ 1854static int e1000_set_phys_id(struct net_device *netdev,
1855#define E1000_ID_INTERVAL (HZ/4) 1855 enum ethtool_phys_id_state state)
1856
1857/* bit defines for adapter->led_status */
1858#define E1000_LED_ON 0
1859
1860void e1000e_led_blink_task(struct work_struct *work)
1861{
1862 struct e1000_adapter *adapter = container_of(work,
1863 struct e1000_adapter, led_blink_task);
1864
1865 if (test_and_change_bit(E1000_LED_ON, &adapter->led_status))
1866 adapter->hw.mac.ops.led_off(&adapter->hw);
1867 else
1868 adapter->hw.mac.ops.led_on(&adapter->hw);
1869}
1870
1871static void e1000_led_blink_callback(unsigned long data)
1872{
1873 struct e1000_adapter *adapter = (struct e1000_adapter *) data;
1874
1875 schedule_work(&adapter->led_blink_task);
1876 mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL);
1877}
1878
1879static int e1000_phys_id(struct net_device *netdev, u32 data)
1880{ 1856{
1881 struct e1000_adapter *adapter = netdev_priv(netdev); 1857 struct e1000_adapter *adapter = netdev_priv(netdev);
1882 struct e1000_hw *hw = &adapter->hw; 1858 struct e1000_hw *hw = &adapter->hw;
1883 1859
1884 if (!data) 1860 switch (state) {
1885 data = INT_MAX; 1861 case ETHTOOL_ID_ACTIVE:
1862 if (!hw->mac.ops.blink_led)
1863 return 2; /* cycle on/off twice per second */
1886 1864
1887 if ((hw->phy.type == e1000_phy_ife) || 1865 hw->mac.ops.blink_led(hw);
1888 (hw->mac.type == e1000_pchlan) || 1866 break;
1889 (hw->mac.type == e1000_pch2lan) || 1867
1890 (hw->mac.type == e1000_82583) || 1868 case ETHTOOL_ID_INACTIVE:
1891 (hw->mac.type == e1000_82574)) {
1892 if (!adapter->blink_timer.function) {
1893 init_timer(&adapter->blink_timer);
1894 adapter->blink_timer.function =
1895 e1000_led_blink_callback;
1896 adapter->blink_timer.data = (unsigned long) adapter;
1897 }
1898 mod_timer(&adapter->blink_timer, jiffies);
1899 msleep_interruptible(data * 1000);
1900 del_timer_sync(&adapter->blink_timer);
1901 if (hw->phy.type == e1000_phy_ife) 1869 if (hw->phy.type == e1000_phy_ife)
1902 e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0); 1870 e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0);
1903 } else { 1871 hw->mac.ops.led_off(hw);
1904 e1000e_blink_led(hw); 1872 hw->mac.ops.cleanup_led(hw);
1905 msleep_interruptible(data * 1000); 1873 break;
1906 }
1907 1874
1908 hw->mac.ops.led_off(hw); 1875 case ETHTOOL_ID_ON:
1909 clear_bit(E1000_LED_ON, &adapter->led_status); 1876 adapter->hw.mac.ops.led_on(&adapter->hw);
1910 hw->mac.ops.cleanup_led(hw); 1877 break;
1911 1878
1879 case ETHTOOL_ID_OFF:
1880 adapter->hw.mac.ops.led_off(&adapter->hw);
1881 break;
1882 }
1912 return 0; 1883 return 0;
1913} 1884}
1914 1885
@@ -2074,7 +2045,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
2074 .set_tso = e1000_set_tso, 2045 .set_tso = e1000_set_tso,
2075 .self_test = e1000_diag_test, 2046 .self_test = e1000_diag_test,
2076 .get_strings = e1000_get_strings, 2047 .get_strings = e1000_get_strings,
2077 .phys_id = e1000_phys_id, 2048 .set_phys_id = e1000_set_phys_id,
2078 .get_ethtool_stats = e1000_get_ethtool_stats, 2049 .get_ethtool_stats = e1000_get_ethtool_stats,
2079 .get_sset_count = e1000e_get_sset_count, 2050 .get_sset_count = e1000e_get_sset_count,
2080 .get_coalesce = e1000_get_coalesce, 2051 .get_coalesce = e1000_get_coalesce,
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 307e1ec22417..6c2fa8327f5c 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -756,6 +756,7 @@ struct e1000_host_mng_command_info {
756/* Function pointers and static data for the MAC. */ 756/* Function pointers and static data for the MAC. */
757struct e1000_mac_operations { 757struct e1000_mac_operations {
758 s32 (*id_led_init)(struct e1000_hw *); 758 s32 (*id_led_init)(struct e1000_hw *);
759 s32 (*blink_led)(struct e1000_hw *);
759 bool (*check_mng_mode)(struct e1000_hw *); 760 bool (*check_mng_mode)(struct e1000_hw *);
760 s32 (*check_for_link)(struct e1000_hw *); 761 s32 (*check_for_link)(struct e1000_hw *);
761 s32 (*cleanup_led)(struct e1000_hw *); 762 s32 (*cleanup_led)(struct e1000_hw *);
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 06ff884bc2c7..3369d1f6a39c 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -564,6 +564,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
564 mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan; 564 mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan;
565 /* ID LED init */ 565 /* ID LED init */
566 mac->ops.id_led_init = e1000e_id_led_init; 566 mac->ops.id_led_init = e1000e_id_led_init;
567 /* blink LED */
568 mac->ops.blink_led = e1000e_blink_led_generic;
567 /* setup LED */ 569 /* setup LED */
568 mac->ops.setup_led = e1000e_setup_led_generic; 570 mac->ops.setup_led = e1000e_setup_led_generic;
569 /* cleanup LED */ 571 /* cleanup LED */
@@ -767,6 +769,8 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
767 (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LSECCK)))) { 769 (!(er32(CTRL_EXT) & E1000_CTRL_EXT_LSECCK)))) {
768 adapter->flags &= ~FLAG_HAS_JUMBO_FRAMES; 770 adapter->flags &= ~FLAG_HAS_JUMBO_FRAMES;
769 adapter->max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN; 771 adapter->max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN;
772
773 hw->mac.ops.blink_led = NULL;
770 } 774 }
771 775
772 if ((adapter->hw.mac.type == e1000_ich8lan) && 776 if ((adapter->hw.mac.type == e1000_ich8lan) &&
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 30ef8fa4968c..6432ddab40ce 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -1530,12 +1530,12 @@ s32 e1000e_cleanup_led_generic(struct e1000_hw *hw)
1530} 1530}
1531 1531
1532/** 1532/**
1533 * e1000e_blink_led - Blink LED 1533 * e1000e_blink_led_generic - Blink LED
1534 * @hw: pointer to the HW structure 1534 * @hw: pointer to the HW structure
1535 * 1535 *
1536 * Blink the LEDs which are set to be on. 1536 * Blink the LEDs which are set to be on.
1537 **/ 1537 **/
1538s32 e1000e_blink_led(struct e1000_hw *hw) 1538s32 e1000e_blink_led_generic(struct e1000_hw *hw)
1539{ 1539{
1540 u32 ledctl_blink = 0; 1540 u32 ledctl_blink = 0;
1541 u32 i; 1541 u32 i;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 4deb67d98e36..0939040305fa 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -6020,7 +6020,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
6020 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); 6020 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
6021 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); 6021 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
6022 INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); 6022 INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
6023 INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
6024 6023
6025 /* Initialize link parameters. User can change them with ethtool */ 6024 /* Initialize link parameters. User can change them with ethtool */
6026 adapter->hw.mac.autoneg = 1; 6025 adapter->hw.mac.autoneg = 1;
@@ -6153,7 +6152,6 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
6153 cancel_work_sync(&adapter->watchdog_task); 6152 cancel_work_sync(&adapter->watchdog_task);
6154 cancel_work_sync(&adapter->downshift_task); 6153 cancel_work_sync(&adapter->downshift_task);
6155 cancel_work_sync(&adapter->update_phy_task); 6154 cancel_work_sync(&adapter->update_phy_task);
6156 cancel_work_sync(&adapter->led_blink_task);
6157 cancel_work_sync(&adapter->print_hang_task); 6155 cancel_work_sync(&adapter->print_hang_task);
6158 6156
6159 if (!(netdev->flags & IFF_UP)) 6157 if (!(netdev->flags & IFF_UP))