diff options
author | Holger Schurig <holgerschurig@gmail.com> | 2010-02-04 08:37:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-08 16:50:56 -0500 |
commit | 40e6fa829a2544c9f8fd5a94844fe502334d6afc (patch) | |
tree | a6278d89caa2c3c104369d5be400c4c64092bb05 /drivers/net/wireless/libertas | |
parent | 85359499eec796e784e2f1e3d7bbb31d84dd4c2b (diff) |
libertas: don't retry commands
Retrying commands seldomly works, most often the firmware is in a
weird state anyway and needs the device to reset. So it's better
to report the broken state back to user-space.
Also rename command_timer_fn() into lbs_cmd_timeout_handler(),
which better reflect it's usage.
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 31 |
3 files changed, 7 insertions, 30 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index 0334a58820ee..e7470442f76b 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -240,11 +240,6 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) | |||
240 | /* Now we got response from FW, cancel the command timer */ | 240 | /* Now we got response from FW, cancel the command timer */ |
241 | del_timer(&priv->command_timer); | 241 | del_timer(&priv->command_timer); |
242 | priv->cmd_timed_out = 0; | 242 | priv->cmd_timed_out = 0; |
243 | if (priv->nr_retries) { | ||
244 | lbs_pr_info("Received result %x to command %x after %d retries\n", | ||
245 | result, curcmd, priv->nr_retries); | ||
246 | priv->nr_retries = 0; | ||
247 | } | ||
248 | 243 | ||
249 | /* Store the response code to cur_cmd_retcode. */ | 244 | /* Store the response code to cur_cmd_retcode. */ |
250 | priv->cur_cmd_retcode = result; | 245 | priv->cur_cmd_retcode = result; |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index d5a9dcae4059..efb2519d9d74 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -109,7 +109,6 @@ struct lbs_private { | |||
109 | struct list_head cmdpendingq; /* pending command buffers */ | 109 | struct list_head cmdpendingq; /* pending command buffers */ |
110 | wait_queue_head_t cmd_pending; | 110 | wait_queue_head_t cmd_pending; |
111 | struct timer_list command_timer; | 111 | struct timer_list command_timer; |
112 | int nr_retries; | ||
113 | int cmd_timed_out; | 112 | int cmd_timed_out; |
114 | 113 | ||
115 | /* Command responses sent from the hardware to the driver */ | 114 | /* Command responses sent from the hardware to the driver */ |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index f9f195f7b17c..f5d641efd50a 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -533,31 +533,14 @@ static int lbs_thread(void *data) | |||
533 | if (priv->cmd_timed_out && priv->cur_cmd) { | 533 | if (priv->cmd_timed_out && priv->cur_cmd) { |
534 | struct cmd_ctrl_node *cmdnode = priv->cur_cmd; | 534 | struct cmd_ctrl_node *cmdnode = priv->cur_cmd; |
535 | 535 | ||
536 | if (++priv->nr_retries > 3) { | 536 | lbs_pr_info("Timeout submitting command 0x%04x\n", |
537 | lbs_pr_info("Excessive timeouts submitting " | 537 | le16_to_cpu(cmdnode->cmdbuf->command)); |
538 | "command 0x%04x\n", | 538 | lbs_complete_command(priv, cmdnode, -ETIMEDOUT); |
539 | le16_to_cpu(cmdnode->cmdbuf->command)); | 539 | if (priv->reset_card) |
540 | lbs_complete_command(priv, cmdnode, -ETIMEDOUT); | 540 | priv->reset_card(priv); |
541 | priv->nr_retries = 0; | ||
542 | if (priv->reset_card) | ||
543 | priv->reset_card(priv); | ||
544 | } else { | ||
545 | priv->cur_cmd = NULL; | ||
546 | priv->dnld_sent = DNLD_RES_RECEIVED; | ||
547 | lbs_pr_info("requeueing command 0x%04x due " | ||
548 | "to timeout (#%d)\n", | ||
549 | le16_to_cpu(cmdnode->cmdbuf->command), | ||
550 | priv->nr_retries); | ||
551 | |||
552 | /* Stick it back at the _top_ of the pending queue | ||
553 | for immediate resubmission */ | ||
554 | list_add(&cmdnode->list, &priv->cmdpendingq); | ||
555 | } | ||
556 | } | 541 | } |
557 | priv->cmd_timed_out = 0; | 542 | priv->cmd_timed_out = 0; |
558 | 543 | ||
559 | |||
560 | |||
561 | if (!priv->fw_ready) | 544 | if (!priv->fw_ready) |
562 | continue; | 545 | continue; |
563 | 546 | ||
@@ -729,7 +712,7 @@ done: | |||
729 | * This function handles the timeout of command sending. | 712 | * This function handles the timeout of command sending. |
730 | * It will re-send the same command again. | 713 | * It will re-send the same command again. |
731 | */ | 714 | */ |
732 | static void command_timer_fn(unsigned long data) | 715 | static void lbs_cmd_timeout_handler(unsigned long data) |
733 | { | 716 | { |
734 | struct lbs_private *priv = (struct lbs_private *)data; | 717 | struct lbs_private *priv = (struct lbs_private *)data; |
735 | unsigned long flags; | 718 | unsigned long flags; |
@@ -848,7 +831,7 @@ static int lbs_init_adapter(struct lbs_private *priv) | |||
848 | 831 | ||
849 | mutex_init(&priv->lock); | 832 | mutex_init(&priv->lock); |
850 | 833 | ||
851 | setup_timer(&priv->command_timer, command_timer_fn, | 834 | setup_timer(&priv->command_timer, lbs_cmd_timeout_handler, |
852 | (unsigned long)priv); | 835 | (unsigned long)priv); |
853 | setup_timer(&priv->auto_deepsleep_timer, auto_deepsleep_timer_fn, | 836 | setup_timer(&priv->auto_deepsleep_timer, auto_deepsleep_timer_fn, |
854 | (unsigned long)priv); | 837 | (unsigned long)priv); |