aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-23 04:31:29 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-24 07:27:08 -0400
commit7d4cdb5af0d079d095501ad4164b4985a1661098 (patch)
tree6e234a1094efd6e05f7280a2f26d173a41059372 /drivers/net/sfc
parent63f1988419ccaa544d1d31aadc1dd309f6471ffe (diff)
sfc: Merge struct efx_blinker into struct efx_board
Signed-off-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/falcon_boards.c29
-rw-r--r--drivers/net/sfc/net_driver.h21
2 files changed, 21 insertions, 29 deletions
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index 3078c005811f..f65738bb5536 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -35,30 +35,31 @@
35static void blink_led_timer(unsigned long context) 35static void blink_led_timer(unsigned long context)
36{ 36{
37 struct efx_nic *efx = (struct efx_nic *)context; 37 struct efx_nic *efx = (struct efx_nic *)context;
38 struct efx_blinker *bl = &efx->board_info.blinker; 38 struct efx_board *board = &efx->board_info;
39 efx->board_info.set_id_led(efx, bl->state); 39
40 bl->state = !bl->state; 40 board->set_id_led(efx, board->blink_state);
41 if (bl->resubmit) 41 board->blink_state = !board->blink_state;
42 mod_timer(&bl->timer, jiffies + BLINK_INTERVAL); 42 if (board->blink_resubmit)
43 mod_timer(&board->blink_timer, jiffies + BLINK_INTERVAL);
43} 44}
44 45
45static void board_blink(struct efx_nic *efx, bool blink) 46static void board_blink(struct efx_nic *efx, bool blink)
46{ 47{
47 struct efx_blinker *blinker = &efx->board_info.blinker; 48 struct efx_board *board = &efx->board_info;
48 49
49 /* The rtnl mutex serialises all ethtool ioctls, so 50 /* The rtnl mutex serialises all ethtool ioctls, so
50 * nothing special needs doing here. */ 51 * nothing special needs doing here. */
51 if (blink) { 52 if (blink) {
52 blinker->resubmit = true; 53 board->blink_resubmit = true;
53 blinker->state = false; 54 board->blink_state = false;
54 setup_timer(&blinker->timer, blink_led_timer, 55 setup_timer(&board->blink_timer, blink_led_timer,
55 (unsigned long)efx); 56 (unsigned long)efx);
56 mod_timer(&blinker->timer, jiffies + BLINK_INTERVAL); 57 mod_timer(&board->blink_timer, jiffies + BLINK_INTERVAL);
57 } else { 58 } else {
58 blinker->resubmit = false; 59 board->blink_resubmit = false;
59 if (blinker->timer.function) 60 if (board->blink_timer.function)
60 del_timer_sync(&blinker->timer); 61 del_timer_sync(&board->blink_timer);
61 efx->board_info.init_leds(efx); 62 board->init_leds(efx);
62 } 63 }
63} 64}
64 65
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 91d8952e7884..8e7b854c11aa 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -389,19 +389,6 @@ struct efx_channel {
389}; 389};
390 390
391/** 391/**
392 * struct efx_blinker - S/W LED blinking context
393 * @state: Current state - on or off
394 * @resubmit: Timer resubmission flag
395 * @timer: Control timer for blinking
396 */
397struct efx_blinker {
398 bool state;
399 bool resubmit;
400 struct timer_list timer;
401};
402
403
404/**
405 * struct efx_board - board information 392 * struct efx_board - board information
406 * @type: Board model type 393 * @type: Board model type
407 * @major: Major rev. ('A', 'B' ...) 394 * @major: Major rev. ('A', 'B' ...)
@@ -412,7 +399,9 @@ struct efx_blinker {
412 * @blink: Starts/stops blinking 399 * @blink: Starts/stops blinking
413 * @monitor: Board-specific health check function 400 * @monitor: Board-specific health check function
414 * @fini: Cleanup function 401 * @fini: Cleanup function
415 * @blinker: used to blink LEDs in software 402 * @blink_state: Current blink state
403 * @blink_resubmit: Blink timer resubmission flag
404 * @blink_timer: Blink timer
416 * @hwmon_client: I2C client for hardware monitor 405 * @hwmon_client: I2C client for hardware monitor
417 * @ioexp_client: I2C client for power/port control 406 * @ioexp_client: I2C client for power/port control
418 */ 407 */
@@ -429,7 +418,9 @@ struct efx_board {
429 int (*monitor) (struct efx_nic *nic); 418 int (*monitor) (struct efx_nic *nic);
430 void (*blink) (struct efx_nic *efx, bool start); 419 void (*blink) (struct efx_nic *efx, bool start);
431 void (*fini) (struct efx_nic *nic); 420 void (*fini) (struct efx_nic *nic);
432 struct efx_blinker blinker; 421 bool blink_state;
422 bool blink_resubmit;
423 struct timer_list blink_timer;
433 struct i2c_client *hwmon_client, *ioexp_client; 424 struct i2c_client *hwmon_client, *ioexp_client;
434}; 425};
435 426