diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-28 22:43:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 19:46:31 -0500 |
commit | 06629f07248b259e08a6e4089fbe6aa3f98dfbe6 (patch) | |
tree | dfe3531f34ab8496e03dba8586bd676fed0c622b | |
parent | 0aa3fbaa3f2d29a14231ebb0c8e521c23701d41f (diff) |
sfc: Add efx_nic_type operation for identity LED control
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/sfc/ethtool.c | 6 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.c | 7 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 29aa83c2a0d0..506397527633 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -174,14 +174,14 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count) | |||
174 | struct efx_nic *efx = netdev_priv(net_dev); | 174 | struct efx_nic *efx = netdev_priv(net_dev); |
175 | 175 | ||
176 | do { | 176 | do { |
177 | falcon_board(efx)->type->set_id_led(efx, EFX_LED_ON); | 177 | efx->type->set_id_led(efx, EFX_LED_ON); |
178 | schedule_timeout_interruptible(HZ / 2); | 178 | schedule_timeout_interruptible(HZ / 2); |
179 | 179 | ||
180 | falcon_board(efx)->type->set_id_led(efx, EFX_LED_OFF); | 180 | efx->type->set_id_led(efx, EFX_LED_OFF); |
181 | schedule_timeout_interruptible(HZ / 2); | 181 | schedule_timeout_interruptible(HZ / 2); |
182 | } while (!signal_pending(current) && --count != 0); | 182 | } while (!signal_pending(current) && --count != 0); |
183 | 183 | ||
184 | falcon_board(efx)->type->set_id_led(efx, EFX_LED_DEFAULT); | 184 | efx->type->set_id_led(efx, EFX_LED_DEFAULT); |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index d4d13c13f8ae..61cc9948b233 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -3249,6 +3249,11 @@ void falcon_stop_nic_stats(struct efx_nic *efx) | |||
3249 | spin_unlock_bh(&efx->stats_lock); | 3249 | spin_unlock_bh(&efx->stats_lock); |
3250 | } | 3250 | } |
3251 | 3251 | ||
3252 | static void falcon_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) | ||
3253 | { | ||
3254 | falcon_board(efx)->type->set_id_led(efx, mode); | ||
3255 | } | ||
3256 | |||
3252 | /************************************************************************** | 3257 | /************************************************************************** |
3253 | * | 3258 | * |
3254 | * Wake on LAN | 3259 | * Wake on LAN |
@@ -3290,6 +3295,7 @@ struct efx_nic_type falcon_a1_nic_type = { | |||
3290 | .update_stats = falcon_update_nic_stats, | 3295 | .update_stats = falcon_update_nic_stats, |
3291 | .start_stats = falcon_start_nic_stats, | 3296 | .start_stats = falcon_start_nic_stats, |
3292 | .stop_stats = falcon_stop_nic_stats, | 3297 | .stop_stats = falcon_stop_nic_stats, |
3298 | .set_id_led = falcon_set_id_led, | ||
3293 | .push_irq_moderation = falcon_push_irq_moderation, | 3299 | .push_irq_moderation = falcon_push_irq_moderation, |
3294 | .push_multicast_hash = falcon_push_multicast_hash, | 3300 | .push_multicast_hash = falcon_push_multicast_hash, |
3295 | .reconfigure_port = falcon_reconfigure_port, | 3301 | .reconfigure_port = falcon_reconfigure_port, |
@@ -3328,6 +3334,7 @@ struct efx_nic_type falcon_b0_nic_type = { | |||
3328 | .update_stats = falcon_update_nic_stats, | 3334 | .update_stats = falcon_update_nic_stats, |
3329 | .start_stats = falcon_start_nic_stats, | 3335 | .start_stats = falcon_start_nic_stats, |
3330 | .stop_stats = falcon_stop_nic_stats, | 3336 | .stop_stats = falcon_stop_nic_stats, |
3337 | .set_id_led = falcon_set_id_led, | ||
3331 | .push_irq_moderation = falcon_push_irq_moderation, | 3338 | .push_irq_moderation = falcon_push_irq_moderation, |
3332 | .push_multicast_hash = falcon_push_multicast_hash, | 3339 | .push_multicast_hash = falcon_push_multicast_hash, |
3333 | .reconfigure_port = falcon_reconfigure_port, | 3340 | .reconfigure_port = falcon_reconfigure_port, |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index de7cf17f4a45..62b2089b05df 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -858,6 +858,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx) | |||
858 | * @update_stats: Update statistics not provided by event handling | 858 | * @update_stats: Update statistics not provided by event handling |
859 | * @start_stats: Start the regular fetching of statistics | 859 | * @start_stats: Start the regular fetching of statistics |
860 | * @stop_stats: Stop the regular fetching of statistics | 860 | * @stop_stats: Stop the regular fetching of statistics |
861 | * @set_id_led: Set state of identifying LED or revert to automatic function | ||
861 | * @push_irq_moderation: Apply interrupt moderation value | 862 | * @push_irq_moderation: Apply interrupt moderation value |
862 | * @push_multicast_hash: Apply multicast hash table | 863 | * @push_multicast_hash: Apply multicast hash table |
863 | * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY | 864 | * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY |
@@ -898,6 +899,7 @@ struct efx_nic_type { | |||
898 | void (*update_stats)(struct efx_nic *efx); | 899 | void (*update_stats)(struct efx_nic *efx); |
899 | void (*start_stats)(struct efx_nic *efx); | 900 | void (*start_stats)(struct efx_nic *efx); |
900 | void (*stop_stats)(struct efx_nic *efx); | 901 | void (*stop_stats)(struct efx_nic *efx); |
902 | void (*set_id_led)(struct efx_nic *efx, enum efx_led_mode mode); | ||
901 | void (*push_irq_moderation)(struct efx_channel *channel); | 903 | void (*push_irq_moderation)(struct efx_channel *channel); |
902 | void (*push_multicast_hash)(struct efx_nic *efx); | 904 | void (*push_multicast_hash)(struct efx_nic *efx); |
903 | int (*reconfigure_port)(struct efx_nic *efx); | 905 | int (*reconfigure_port)(struct efx_nic *efx); |