Commit 936db355 authored by Jeff Kirsher's avatar Jeff Kirsher

igb: convert to ethtool set_phys_id

Based on patch from Stephen Hemminger.
Convert igb driver to use new set_phys_id ethtool interface.

CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 64359091
...@@ -1964,27 +1964,28 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) ...@@ -1964,27 +1964,28 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
/* bit defines for adapter->led_status */ /* bit defines for adapter->led_status */
#define IGB_LED_ON 0 #define IGB_LED_ON 0
static int igb_phys_id(struct net_device *netdev, u32 data) static int igb_set_phys_id(struct net_device *netdev,
enum ethtool_phys_id_state state)
{ {
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
unsigned long timeout;
timeout = data * 1000; switch (state) {
case ETHTOOL_ID_ACTIVE:
/* igb_blink_led(hw);
* msleep_interruptable only accepts unsigned int so we are limited return 2;
* in how long a duration we can wait case ETHTOOL_ID_ON:
*/ igb_blink_led(hw);
if (!timeout || timeout > UINT_MAX) break;
timeout = UINT_MAX; case ETHTOOL_ID_OFF:
igb_led_off(hw);
igb_blink_led(hw); break;
msleep_interruptible(timeout); case ETHTOOL_ID_INACTIVE:
igb_led_off(hw);
igb_led_off(hw); clear_bit(IGB_LED_ON, &adapter->led_status);
clear_bit(IGB_LED_ON, &adapter->led_status); igb_cleanup_led(hw);
igb_cleanup_led(hw); break;
}
return 0; return 0;
} }
...@@ -2216,7 +2217,7 @@ static const struct ethtool_ops igb_ethtool_ops = { ...@@ -2216,7 +2217,7 @@ static const struct ethtool_ops igb_ethtool_ops = {
.set_tso = igb_set_tso, .set_tso = igb_set_tso,
.self_test = igb_diag_test, .self_test = igb_diag_test,
.get_strings = igb_get_strings, .get_strings = igb_get_strings,
.phys_id = igb_phys_id, .set_phys_id = igb_set_phys_id,
.get_sset_count = igb_get_sset_count, .get_sset_count = igb_get_sset_count,
.get_ethtool_stats = igb_get_ethtool_stats, .get_ethtool_stats = igb_get_ethtool_stats,
.get_coalesce = igb_get_coalesce, .get_coalesce = igb_get_coalesce,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment