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>
This commit is contained in:
Ben Hutchings
2009-11-23 16:03:45 +00:00
committed by David S. Miller
parent dcf477b2d2
commit 398468ed1b
8 changed files with 62 additions and 77 deletions

View File

@@ -187,13 +187,15 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count)
{
struct efx_nic *efx = netdev_priv(net_dev);
efx->board_info.blink(efx, 1);
set_current_state(TASK_INTERRUPTIBLE);
if (count)
schedule_timeout(count * HZ);
else
schedule();
efx->board_info.blink(efx, 0);
do {
efx->board_info.set_id_led(efx, EFX_LED_ON);
schedule_timeout_interruptible(HZ / 2);
efx->board_info.set_id_led(efx, EFX_LED_OFF);
schedule_timeout_interruptible(HZ / 2);
} while (!signal_pending(current) && --count != 0);
efx->board_info.set_id_led(efx, EFX_LED_DEFAULT);
return 0;
}