diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-23 11:03:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-24 13:58:39 -0500 |
commit | 398468ed1b5c61fe8bcbc8cc1ed323e3c23b58ef (patch) | |
tree | 2c9f8932143b91d8affe388bd21d98beab7c7488 /drivers/net/sfc/ethtool.c | |
parent | dcf477b2d205abb8ccdb3b1cb668a0db2de202c0 (diff) |
sfc: Use a single blink implementation
Only some PHYs have firmware support for a LED blink mode, so we
currently blink the others in a timer function. Since all PHYs have
simple on and off modes, we don't gain anything by using multiple
blink implementations. Also, since we have a process context there
is no need to use a timer.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index a313b61c8ff4..18e02712818c 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -187,13 +187,15 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count) | |||
187 | { | 187 | { |
188 | struct efx_nic *efx = netdev_priv(net_dev); | 188 | struct efx_nic *efx = netdev_priv(net_dev); |
189 | 189 | ||
190 | efx->board_info.blink(efx, 1); | 190 | do { |
191 | set_current_state(TASK_INTERRUPTIBLE); | 191 | efx->board_info.set_id_led(efx, EFX_LED_ON); |
192 | if (count) | 192 | schedule_timeout_interruptible(HZ / 2); |
193 | schedule_timeout(count * HZ); | 193 | |
194 | else | 194 | efx->board_info.set_id_led(efx, EFX_LED_OFF); |
195 | schedule(); | 195 | schedule_timeout_interruptible(HZ / 2); |
196 | efx->board_info.blink(efx, 0); | 196 | } while (!signal_pending(current) && --count != 0); |
197 | |||
198 | efx->board_info.set_id_led(efx, EFX_LED_DEFAULT); | ||
197 | return 0; | 199 | return 0; |
198 | } | 200 | } |
199 | 201 | ||