aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-05-07 02:37:14 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-05-07 06:11:57 -0400
commit936db3559fc4f6d2892234cadcbd88b8a7d34898 (patch)
tree13c2aec72195e09f8da750d79b0bc7b8ea631923
parent6435909199c2d1b0aad3ebbfa01f641aaa24fa2a (diff)
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: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/igb/igb_ethtool.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 6e29634b1fb5..fdc895e5a3f8 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1964,27 +1964,28 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
1964/* bit defines for adapter->led_status */ 1964/* bit defines for adapter->led_status */
1965#define IGB_LED_ON 0 1965#define IGB_LED_ON 0
1966 1966
1967static int igb_phys_id(struct net_device *netdev, u32 data) 1967static int igb_set_phys_id(struct net_device *netdev,
1968 enum ethtool_phys_id_state state)
1968{ 1969{
1969 struct igb_adapter *adapter = netdev_priv(netdev); 1970 struct igb_adapter *adapter = netdev_priv(netdev);
1970 struct e1000_hw *hw = &adapter->hw; 1971 struct e1000_hw *hw = &adapter->hw;
1971 unsigned long timeout;
1972 1972
1973 timeout = data * 1000; 1973 switch (state) {
1974 1974 case ETHTOOL_ID_ACTIVE:
1975 /* 1975 igb_blink_led(hw);
1976 * msleep_interruptable only accepts unsigned int so we are limited 1976 return 2;
1977 * in how long a duration we can wait 1977 case ETHTOOL_ID_ON:
1978 */ 1978 igb_blink_led(hw);
1979 if (!timeout || timeout > UINT_MAX) 1979 break;
1980 timeout = UINT_MAX; 1980 case ETHTOOL_ID_OFF:
1981 1981 igb_led_off(hw);
1982 igb_blink_led(hw); 1982 break;
1983 msleep_interruptible(timeout); 1983 case ETHTOOL_ID_INACTIVE:
1984 1984 igb_led_off(hw);
1985 igb_led_off(hw); 1985 clear_bit(IGB_LED_ON, &adapter->led_status);
1986 clear_bit(IGB_LED_ON, &adapter->led_status); 1986 igb_cleanup_led(hw);
1987 igb_cleanup_led(hw); 1987 break;
1988 }
1988 1989
1989 return 0; 1990 return 0;
1990} 1991}
@@ -2216,7 +2217,7 @@ static const struct ethtool_ops igb_ethtool_ops = {
2216 .set_tso = igb_set_tso, 2217 .set_tso = igb_set_tso,
2217 .self_test = igb_diag_test, 2218 .self_test = igb_diag_test,
2218 .get_strings = igb_get_strings, 2219 .get_strings = igb_get_strings,
2219 .phys_id = igb_phys_id, 2220 .set_phys_id = igb_set_phys_id,
2220 .get_sset_count = igb_get_sset_count, 2221 .get_sset_count = igb_get_sset_count,
2221 .get_ethtool_stats = igb_get_ethtool_stats, 2222 .get_ethtool_stats = igb_get_ethtool_stats,
2222 .get_coalesce = igb_get_coalesce, 2223 .get_coalesce = igb_get_coalesce,