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/tenxpress.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/tenxpress.c')
-rw-r--r-- | drivers/net/sfc/tenxpress.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index 19c78d281700..6a8e3ea03811 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c | |||
@@ -613,21 +613,29 @@ static void tenxpress_phy_fini(struct efx_nic *efx) | |||
613 | } | 613 | } |
614 | 614 | ||
615 | 615 | ||
616 | /* Set the RX and TX LEDs and Link LED flashing. The other LEDs | 616 | /* Override the RX, TX and link LEDs */ |
617 | * (which probably aren't wired anyway) are left in AUTO mode */ | 617 | void tenxpress_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) |
618 | void tenxpress_phy_blink(struct efx_nic *efx, bool blink) | ||
619 | { | 618 | { |
620 | int reg; | 619 | int reg; |
621 | 620 | ||
622 | if (blink) | 621 | switch (mode) { |
623 | reg = (PMA_PMD_LED_FLASH << PMA_PMD_LED_TX_LBN) | | 622 | case EFX_LED_OFF: |
624 | (PMA_PMD_LED_FLASH << PMA_PMD_LED_RX_LBN) | | 623 | reg = (PMA_PMD_LED_OFF << PMA_PMD_LED_TX_LBN) | |
625 | (PMA_PMD_LED_FLASH << PMA_PMD_LED_LINK_LBN); | 624 | (PMA_PMD_LED_OFF << PMA_PMD_LED_RX_LBN) | |
626 | else | 625 | (PMA_PMD_LED_OFF << PMA_PMD_LED_LINK_LBN); |
626 | break; | ||
627 | case EFX_LED_ON: | ||
628 | reg = (PMA_PMD_LED_ON << PMA_PMD_LED_TX_LBN) | | ||
629 | (PMA_PMD_LED_ON << PMA_PMD_LED_RX_LBN) | | ||
630 | (PMA_PMD_LED_ON << PMA_PMD_LED_LINK_LBN); | ||
631 | break; | ||
632 | default: | ||
627 | if (efx->phy_type == PHY_TYPE_SFX7101) | 633 | if (efx->phy_type == PHY_TYPE_SFX7101) |
628 | reg = SFX7101_PMA_PMD_LED_DEFAULT; | 634 | reg = SFX7101_PMA_PMD_LED_DEFAULT; |
629 | else | 635 | else |
630 | reg = SFT9001_PMA_PMD_LED_DEFAULT; | 636 | reg = SFT9001_PMA_PMD_LED_DEFAULT; |
637 | break; | ||
638 | } | ||
631 | 639 | ||
632 | efx_mdio_write(efx, MDIO_MMD_PMAPMD, PMA_PMD_LED_OVERR_REG, reg); | 640 | efx_mdio_write(efx, MDIO_MMD_PMAPMD, PMA_PMD_LED_OVERR_REG, reg); |
633 | } | 641 | } |