diff options
Diffstat (limited to 'drivers/net/wimax/i2400m/i2400m.h')
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index da218b98e27f..ad8e6a3be1e3 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -177,6 +177,11 @@ enum { | |||
177 | I2400M_BM_ACK_BUF_SIZE = 256, | 177 | I2400M_BM_ACK_BUF_SIZE = 256, |
178 | }; | 178 | }; |
179 | 179 | ||
180 | enum { | ||
181 | /* Maximum number of bus reset can be retried */ | ||
182 | I2400M_BUS_RESET_RETRIES = 3, | ||
183 | }; | ||
184 | |||
180 | /** | 185 | /** |
181 | * struct i2400m_poke_table - Hardware poke table for the Intel 2400m | 186 | * struct i2400m_poke_table - Hardware poke table for the Intel 2400m |
182 | * | 187 | * |
@@ -517,6 +522,29 @@ struct i2400m_barker_db; | |||
517 | * same. | 522 | * same. |
518 | * | 523 | * |
519 | * @pm_notifier: used to register for PM events | 524 | * @pm_notifier: used to register for PM events |
525 | * | ||
526 | * @bus_reset_retries: counter for the number of bus resets attempted for | ||
527 | * this boot. It's not for tracking the number of bus resets during | ||
528 | * the whole driver life cycle (from insmod to rmmod) but for the | ||
529 | * number of dev_start() executed until dev_start() returns a success | ||
530 | * (ie: a good boot means a dev_stop() followed by a successful | ||
531 | * dev_start()). dev_reset_handler() increments this counter whenever | ||
532 | * it is triggering a bus reset. It checks this counter to decide if a | ||
533 | * subsequent bus reset should be retried. dev_reset_handler() retries | ||
534 | * the bus reset until dev_start() succeeds or the counter reaches | ||
535 | * I2400M_BUS_RESET_RETRIES. The counter is cleared to 0 in | ||
536 | * dev_reset_handle() when dev_start() returns a success, | ||
537 | * ie: a successul boot is completed. | ||
538 | * | ||
539 | * @alive: flag to denote if the device *should* be alive. This flag is | ||
540 | * everything like @updown (see doc for @updown) except reflecting | ||
541 | * the device state *we expect* rather than the actual state as denoted | ||
542 | * by @updown. It is set 1 whenever @updown is set 1 in dev_start(). | ||
543 | * Then the device is expected to be alive all the time | ||
544 | * (i2400m->alive remains 1) until the driver is removed. Therefore | ||
545 | * all the device reboot events detected can be still handled properly | ||
546 | * by either dev_reset_handle() or .pre_reset/.post_reset as long as | ||
547 | * the driver presents. It is set 0 along with @updown in dev_stop(). | ||
520 | */ | 548 | */ |
521 | struct i2400m { | 549 | struct i2400m { |
522 | struct wimax_dev wimax_dev; /* FIRST! See doc */ | 550 | struct wimax_dev wimax_dev; /* FIRST! See doc */ |
@@ -591,6 +619,12 @@ struct i2400m { | |||
591 | struct i2400m_barker_db *barker; | 619 | struct i2400m_barker_db *barker; |
592 | 620 | ||
593 | struct notifier_block pm_notifier; | 621 | struct notifier_block pm_notifier; |
622 | |||
623 | /* counting bus reset retries in this boot */ | ||
624 | atomic_t bus_reset_retries; | ||
625 | |||
626 | /* if the device is expected to be alive */ | ||
627 | unsigned alive; | ||
594 | }; | 628 | }; |
595 | 629 | ||
596 | 630 | ||