aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-02-27 22:35:17 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-28 14:33:47 -0500
commit0c9c4a09f752e3cbe47fd5ea2d7f5f4837f95580 (patch)
treea6e1559fb34bdf53e83f6d08a3c16d07d5c9642b /drivers/net/wireless/mwifiex
parente50e06fd0418d5994fad8ca8d3ce049403059112 (diff)
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')
-rw-r--r--drivers/net/wireless/mwifiex/README2
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c10
-rw-r--r--drivers/net/wireless/mwifiex/debugfs.c4
-rw-r--r--drivers/net/wireless/mwifiex/ioctl.h2
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c2
-rw-r--r--drivers/net/wireless/mwifiex/util.c2
7 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 3d64613ebb29..b9242c3dca43 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -131,7 +131,7 @@ info
131 hs_configured = <0/1, host sleep not configured/configured> 131 hs_configured = <0/1, host sleep not configured/configured>
132 hs_activated = <0/1, extended host sleep not activated/activated> 132 hs_activated = <0/1, extended host sleep not activated/activated>
133 num_tx_timeout = <number of Tx timeout> 133 num_tx_timeout = <number of Tx timeout>
134 num_cmd_timeout = <number of timeout commands> 134 is_cmd_timedout = <0/1 command timeout not occurred/occurred>
135 timeout_cmd_id = <command id of the last timeout command> 135 timeout_cmd_id = <command id of the last timeout command>
136 timeout_cmd_act = <command action of the last timeout command> 136 timeout_cmd_act = <command action of the last timeout command>
137 last_cmd_id = <command id of the last several commands sent to device> 137 last_cmd_id = <command id of the last several commands sent to device>
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,
514 return -1; 514 return -1;
515 } 515 }
516 516
517 if (adapter->num_cmd_timeout) { 517 if (adapter->is_cmd_timedout) {
518 dev_err(adapter->dev, "PREP_CMD: FW is in bad state\n"); 518 dev_err(adapter->dev, "PREP_CMD: FW is in bad state\n");
519 return -1; 519 return -1;
520 } 520 }
@@ -780,7 +780,7 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
780 return -1; 780 return -1;
781 } 781 }
782 782
783 adapter->num_cmd_timeout = 0; 783 adapter->is_cmd_timedout = 0;
784 784
785 resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data; 785 resp = (struct host_cmd_ds_command *) adapter->curr_cmd->resp_skb->data;
786 if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) { 786 if (adapter->curr_cmd->cmd_flag & CMD_F_CANCELED) {
@@ -891,7 +891,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
891 struct cmd_ctrl_node *cmd_node; 891 struct cmd_ctrl_node *cmd_node;
892 struct timeval tstamp; 892 struct timeval tstamp;
893 893
894 adapter->num_cmd_timeout++; 894 adapter->is_cmd_timedout = 1;
895 if (!adapter->curr_cmd) { 895 if (!adapter->curr_cmd) {
896 dev_dbg(adapter->dev, "cmd: empty curr_cmd\n"); 896 dev_dbg(adapter->dev, "cmd: empty curr_cmd\n");
897 return; 897 return;
@@ -914,8 +914,8 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
914 dev_err(adapter->dev, "num_cmd_h2c_failure = %d\n", 914 dev_err(adapter->dev, "num_cmd_h2c_failure = %d\n",
915 adapter->dbg.num_cmd_host_to_card_failure); 915 adapter->dbg.num_cmd_host_to_card_failure);
916 916
917 dev_err(adapter->dev, "num_cmd_timeout = %d\n", 917 dev_err(adapter->dev, "is_cmd_timedout = %d\n",
918 adapter->num_cmd_timeout); 918 adapter->is_cmd_timedout);
919 dev_err(adapter->dev, "num_tx_timeout = %d\n", 919 dev_err(adapter->dev, "num_tx_timeout = %d\n",
920 adapter->dbg.num_tx_timeout); 920 adapter->dbg.num_tx_timeout);
921 921
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index a5f9875cfd6e..61b467a7ebdd 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -85,8 +85,8 @@ static struct mwifiex_debug_data items[] = {
85 item_addr(hs_activated), 1}, 85 item_addr(hs_activated), 1},
86 {"num_tx_timeout", item_size(num_tx_timeout), 86 {"num_tx_timeout", item_size(num_tx_timeout),
87 item_addr(num_tx_timeout), 1}, 87 item_addr(num_tx_timeout), 1},
88 {"num_cmd_timeout", item_size(num_cmd_timeout), 88 {"is_cmd_timedout", item_size(is_cmd_timedout),
89 item_addr(num_cmd_timeout), 1}, 89 item_addr(is_cmd_timedout), 1},
90 {"timeout_cmd_id", item_size(timeout_cmd_id), 90 {"timeout_cmd_id", item_size(timeout_cmd_id),
91 item_addr(timeout_cmd_id), 1}, 91 item_addr(timeout_cmd_id), 1},
92 {"timeout_cmd_act", item_size(timeout_cmd_act), 92 {"timeout_cmd_act", item_size(timeout_cmd_act),
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h
index 5974642f38b1..1fb2212079ae 100644
--- a/drivers/net/wireless/mwifiex/ioctl.h
+++ b/drivers/net/wireless/mwifiex/ioctl.h
@@ -209,7 +209,7 @@ struct mwifiex_debug_info {
209 u32 num_cmd_assoc_success; 209 u32 num_cmd_assoc_success;
210 u32 num_cmd_assoc_failure; 210 u32 num_cmd_assoc_failure;
211 u32 num_tx_timeout; 211 u32 num_tx_timeout;
212 u32 num_cmd_timeout; 212 u8 is_cmd_timedout;
213 u16 timeout_cmd_id; 213 u16 timeout_cmd_id;
214 u16 timeout_cmd_act; 214 u16 timeout_cmd_act;
215 u16 last_cmd_id[DBG_CMD_NUM]; 215 u16 last_cmd_id[DBG_CMD_NUM];
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index df09ddb64eec..51ac9e3355a2 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -719,7 +719,7 @@ struct mwifiex_adapter {
719 struct cmd_ctrl_node *curr_cmd; 719 struct cmd_ctrl_node *curr_cmd;
720 /* spin lock for command */ 720 /* spin lock for command */
721 spinlock_t mwifiex_cmd_lock; 721 spinlock_t mwifiex_cmd_lock;
722 u32 num_cmd_timeout; 722 u8 is_cmd_timedout;
723 u16 last_init_cmd; 723 u16 last_init_cmd;
724 struct timer_list cmd_timer; 724 struct timer_list cmd_timer;
725 struct list_head cmd_free_q; 725 struct list_head cmd_free_q;
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index fd2a7165cfa5..368450cc56c7 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -116,7 +116,7 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
116 adapter->tx_lock_flag = false; 116 adapter->tx_lock_flag = false;
117 adapter->pps_uapsd_mode = false; 117 adapter->pps_uapsd_mode = false;
118 118
119 if (adapter->num_cmd_timeout && adapter->curr_cmd) 119 if (adapter->is_cmd_timedout && adapter->curr_cmd)
120 return; 120 return;
121 priv->media_connected = false; 121 priv->media_connected = false;
122 dev_dbg(adapter->dev, 122 dev_dbg(adapter->dev,
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index 7022c69f0a29..c3824e37f3f2 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -104,7 +104,7 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv,
104 info->pm_wakeup_fw_try = adapter->pm_wakeup_fw_try; 104 info->pm_wakeup_fw_try = adapter->pm_wakeup_fw_try;
105 info->is_hs_configured = adapter->is_hs_configured; 105 info->is_hs_configured = adapter->is_hs_configured;
106 info->hs_activated = adapter->hs_activated; 106 info->hs_activated = adapter->hs_activated;
107 info->num_cmd_timeout = adapter->num_cmd_timeout; 107 info->is_cmd_timedout = adapter->is_cmd_timedout;
108 info->num_cmd_host_to_card_failure 108 info->num_cmd_host_to_card_failure
109 = adapter->dbg.num_cmd_host_to_card_failure; 109 = adapter->dbg.num_cmd_host_to_card_failure;
110 info->num_cmd_sleep_cfm_host_to_card_failure 110 info->num_cmd_sleep_cfm_host_to_card_failure