diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-04-01 19:43:46 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-04-05 10:12:12 -0400 |
commit | c5e129ac2fc72c119b85db79a629de66332f136d (patch) | |
tree | 5ed9a12cc574e81793ee53b645a52ee6dd1a1506 /drivers/net/sfc | |
parent | 68f512f21a64c9b264df6c61a9333e7890faf74b (diff) |
sfc: Implement ethtool_ops::set_phys_id instead of ethtool_ops::phys_id
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 0d5543972574..644f7c1d6e7b 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -178,19 +178,27 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = { | |||
178 | */ | 178 | */ |
179 | 179 | ||
180 | /* Identify device by flashing LEDs */ | 180 | /* Identify device by flashing LEDs */ |
181 | static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count) | 181 | static int efx_ethtool_phys_id(struct net_device *net_dev, |
182 | enum ethtool_phys_id_state state) | ||
182 | { | 183 | { |
183 | struct efx_nic *efx = netdev_priv(net_dev); | 184 | struct efx_nic *efx = netdev_priv(net_dev); |
185 | enum efx_led_mode mode; | ||
184 | 186 | ||
185 | do { | 187 | switch (state) { |
186 | efx->type->set_id_led(efx, EFX_LED_ON); | 188 | case ETHTOOL_ID_ON: |
187 | schedule_timeout_interruptible(HZ / 2); | 189 | mode = EFX_LED_ON; |
188 | 190 | break; | |
189 | efx->type->set_id_led(efx, EFX_LED_OFF); | 191 | case ETHTOOL_ID_OFF: |
190 | schedule_timeout_interruptible(HZ / 2); | 192 | mode = EFX_LED_OFF; |
191 | } while (!signal_pending(current) && --count != 0); | 193 | break; |
194 | case ETHTOOL_ID_INACTIVE: | ||
195 | mode = EFX_LED_DEFAULT; | ||
196 | break; | ||
197 | default: | ||
198 | return -EINVAL; | ||
199 | } | ||
192 | 200 | ||
193 | efx->type->set_id_led(efx, EFX_LED_DEFAULT); | 201 | efx->type->set_id_led(efx, mode); |
194 | return 0; | 202 | return 0; |
195 | } | 203 | } |
196 | 204 | ||
@@ -1007,7 +1015,7 @@ const struct ethtool_ops efx_ethtool_ops = { | |||
1007 | .get_sset_count = efx_ethtool_get_sset_count, | 1015 | .get_sset_count = efx_ethtool_get_sset_count, |
1008 | .self_test = efx_ethtool_self_test, | 1016 | .self_test = efx_ethtool_self_test, |
1009 | .get_strings = efx_ethtool_get_strings, | 1017 | .get_strings = efx_ethtool_get_strings, |
1010 | .phys_id = efx_ethtool_phys_id, | 1018 | .set_phys_id = efx_ethtool_phys_id, |
1011 | .get_ethtool_stats = efx_ethtool_get_stats, | 1019 | .get_ethtool_stats = efx_ethtool_get_stats, |
1012 | .get_wol = efx_ethtool_get_wol, | 1020 | .get_wol = efx_ethtool_get_wol, |
1013 | .set_wol = efx_ethtool_set_wol, | 1021 | .set_wol = efx_ethtool_set_wol, |