aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-14 20:45:59 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-14 20:45:59 -0500
commitf6f223039c0d0683bdea1eabd35b309e10311a60 (patch)
tree890e07acf8c18ddc2994ebc0a0bdcdda38b0dcc6 /drivers/net/wireless/libertas
parentb3b3f04fb587ecb61b5baa6c1c5f0e666fd12d73 (diff)
parent42c4568a4ace0adc27a9d6f02936e2047ba6fc7e (diff)
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c5
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/if_spi.c1
-rw-r--r--drivers/net/wireless/libertas/main.c31
4 files changed, 8 insertions, 30 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 0334a58820e..e7470442f76 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 c348aff8f30..6977ee82021 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/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index bf4bfbae622..3ea03f259ee 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -23,6 +23,7 @@
23#include <linux/kthread.h> 23#include <linux/kthread.h>
24#include <linux/list.h> 24#include <linux/list.h>
25#include <linux/netdevice.h> 25#include <linux/netdevice.h>
26#include <linux/semaphore.h>
26#include <linux/spi/libertas_spi.h> 27#include <linux/spi/libertas_spi.h>
27#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
28 29
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 60bde1233a3..cd8ed7fdafa 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -536,31 +536,14 @@ static int lbs_thread(void *data)
536 if (priv->cmd_timed_out && priv->cur_cmd) { 536 if (priv->cmd_timed_out && priv->cur_cmd) {
537 struct cmd_ctrl_node *cmdnode = priv->cur_cmd; 537 struct cmd_ctrl_node *cmdnode = priv->cur_cmd;
538 538
539 if (++priv->nr_retries > 3) { 539 lbs_pr_info("Timeout submitting command 0x%04x\n",
540 lbs_pr_info("Excessive timeouts submitting " 540 le16_to_cpu(cmdnode->cmdbuf->command));
541 "command 0x%04x\n", 541 lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
542 le16_to_cpu(cmdnode->cmdbuf->command)); 542 if (priv->reset_card)
543 lbs_complete_command(priv, cmdnode, -ETIMEDOUT); 543 priv->reset_card(priv);
544 priv->nr_retries = 0;
545 if (priv->reset_card)
546 priv->reset_card(priv);
547 } else {
548 priv->cur_cmd = NULL;
549 priv->dnld_sent = DNLD_RES_RECEIVED;
550 lbs_pr_info("requeueing command 0x%04x due "
551 "to timeout (#%d)\n",
552 le16_to_cpu(cmdnode->cmdbuf->command),
553 priv->nr_retries);
554
555 /* Stick it back at the _top_ of the pending queue
556 for immediate resubmission */
557 list_add(&cmdnode->list, &priv->cmdpendingq);
558 }
559 } 544 }
560 priv->cmd_timed_out = 0; 545 priv->cmd_timed_out = 0;
561 546
562
563
564 if (!priv->fw_ready) 547 if (!priv->fw_ready)
565 continue; 548 continue;
566 549
@@ -732,7 +715,7 @@ done:
732 * This function handles the timeout of command sending. 715 * This function handles the timeout of command sending.
733 * It will re-send the same command again. 716 * It will re-send the same command again.
734 */ 717 */
735static void command_timer_fn(unsigned long data) 718static void lbs_cmd_timeout_handler(unsigned long data)
736{ 719{
737 struct lbs_private *priv = (struct lbs_private *)data; 720 struct lbs_private *priv = (struct lbs_private *)data;
738 unsigned long flags; 721 unsigned long flags;
@@ -851,7 +834,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
851 834
852 mutex_init(&priv->lock); 835 mutex_init(&priv->lock);
853 836
854 setup_timer(&priv->command_timer, command_timer_fn, 837 setup_timer(&priv->command_timer, lbs_cmd_timeout_handler,
855 (unsigned long)priv); 838 (unsigned long)priv);
856 setup_timer(&priv->auto_deepsleep_timer, auto_deepsleep_timer_fn, 839 setup_timer(&priv->auto_deepsleep_timer, auto_deepsleep_timer_fn,
857 (unsigned long)priv); 840 (unsigned long)priv);