diff options
author | Allan, Bruce W <bruce.w.allan@intel.com> | 2011-04-13 09:09:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-15 00:15:49 -0400 |
commit | fce55922f5299a04c0a56b170a141fab34f13465 (patch) | |
tree | 91c6eeea0957b41199641c43add0e8170ad65f89 /drivers/net/sfc | |
parent | 21d8c49e01a0c1c6eb6c750cd04110db4a539284 (diff) |
ethtool: allow custom interval for physical identification
When physical identification of an adapter is done by toggling the
mechanism on and off through software utilizing the set_phys_id operation,
it is done with a fixed duration for both on and off states. Some drivers
may want to set a custom duration for the on/off intervals. This patch
changes the API so the return code from the driver's entry point when it
is called with ETHTOOL_ID_ACTIVE can specify the frequency at which to
cycle the on/off states, and updates the drivers that have already been
converted to use the new set_phys_id and use the synchronous method for
identifying an adapter.
The physical identification frequency set in the updated drivers is based
on how it was done prior to the introduction of set_phys_id.
Compile tested only. Also fixes a compiler warning in sfc.
v2: drivers do not return -EINVAL for ETHOOL_ID_ACTIVE
v3: fold patchset into single patch and cleanup per Ben's feedback
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Divy Le Ray <divy@chelsio.com>
Cc: Don Fry <pcnet32@frontier.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Steve Hodgson <shodgson@solarflare.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Matt Carlson <mcarlson@broadcom.com>
Acked-by: Jon Mason <jdmason@kudzu.us>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 644f7c1d6e7b..5d8468fc5804 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -182,7 +182,7 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, | |||
182 | enum ethtool_phys_id_state state) | 182 | enum ethtool_phys_id_state state) |
183 | { | 183 | { |
184 | struct efx_nic *efx = netdev_priv(net_dev); | 184 | struct efx_nic *efx = netdev_priv(net_dev); |
185 | enum efx_led_mode mode; | 185 | enum efx_led_mode mode = EFX_LED_DEFAULT; |
186 | 186 | ||
187 | switch (state) { | 187 | switch (state) { |
188 | case ETHTOOL_ID_ON: | 188 | case ETHTOOL_ID_ON: |
@@ -194,8 +194,8 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, | |||
194 | case ETHTOOL_ID_INACTIVE: | 194 | case ETHTOOL_ID_INACTIVE: |
195 | mode = EFX_LED_DEFAULT; | 195 | mode = EFX_LED_DEFAULT; |
196 | break; | 196 | break; |
197 | default: | 197 | case ETHTOOL_ID_ACTIVE: |
198 | return -EINVAL; | 198 | return 1; /* cycle on/off once per second */ |
199 | } | 199 | } |
200 | 200 | ||
201 | efx->type->set_id_led(efx, mode); | 201 | efx->type->set_id_led(efx, mode); |