summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cmdevt.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-02-28 04:35:17 +0100
committerJohn W. Linville <linville@tuxdriver.com>2014-02-28 20:33:47 +0100
commit0c9c4a09f752e3cbe47fd5ea2d7f5f4837f95580 (patch)
treea6e1559fb34bdf53e83f6d08a3c16d07d5c9642b /drivers/net/wireless/mwifiex/cmdevt.c
parentmwifiex: get rid of extra num_cmd_timeout variable (diff)
downloadlinux-0c9c4a09f752e3cbe47fd5ea2d7f5f4837f95580.tar.xz
linux-0c9c4a09f752e3cbe47fd5ea2d7f5f4837f95580.zip
mwifiex: replace num_cmd_timeout with is_cmd_timedout
Command timeout happens when firmware goes into bad state. There is no chance that next command will be successful after this. Hence we will maintain a flag instead of count. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cmdevt.c')
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 686943c52d18..b4d28edaf8aa 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -514,7 +514,7 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
return -1;
}
- if (adapter->num_cmd_timeout) {
+ if (adapter->is_cmd_timedout) {
dev_err(adapter->dev, "PREP_CMD: FW is in bad state\n");
return -1;
}
@@ -780,7 +780,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
return -1;
}
- adapter->num_cmd_timeout = 0;
+ adapter->is_cmd_timedout = 0;
resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data;
if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) {
@@ -891,7 +891,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
struct cmd_ctrl_node *cmd_node;
struct timeval tstamp;
- adapter->num_cmd_timeout++;
+ adapter->is_cmd_timedout = 1;
if (!adapter->curr_cmd) {
dev_dbg(adapter->dev, "cmd: empty curr_cmd\n");
return;
@@ -914,8 +914,8 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
dev_err(adapter->dev, "num_cmd_h2c_failure = %d\n",
adapter->dbg.num_cmd_host_to_card_failure);
- dev_err(adapter->dev, "num_cmd_timeout = %d\n",
- adapter->num_cmd_timeout);
+ dev_err(adapter->dev, "is_cmd_timedout = %d\n",
+ adapter->is_cmd_timedout);
dev_err(adapter->dev, "num_tx_timeout = %d\n",
adapter->dbg.num_tx_timeout);