mwifiex: replace num_cmd_timeout with is_cmd_timedout
authorAmitkumar Karwar <akarwar@marvell.com>
Fri, 28 Feb 2014 03:35:17 +0000 (19:35 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Feb 2014 19:33:47 +0000 (14:33 -0500)
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>
drivers/net/wireless/mwifiex/README
drivers/net/wireless/mwifiex/cmdevt.c
drivers/net/wireless/mwifiex/debugfs.c
drivers/net/wireless/mwifiex/ioctl.h
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/sta_event.c
drivers/net/wireless/mwifiex/util.c

index 3d64613ebb2979426d9fd1652b9fc17325cf8676..b9242c3dca435ee9a4d5123fd57ad0733a96a24d 100644 (file)
@@ -131,7 +131,7 @@ info
        hs_configured = <0/1, host sleep not configured/configured>
        hs_activated = <0/1, extended host sleep not activated/activated>
        num_tx_timeout = <number of Tx timeout>
-       num_cmd_timeout = <number of timeout commands>
+       is_cmd_timedout = <0/1 command timeout not occurred/occurred>
        timeout_cmd_id = <command id of the last timeout command>
        timeout_cmd_act = <command action of the last timeout command>
        last_cmd_id = <command id of the last several commands sent to device>
index 686943c52d18541aa5c7e001f54af191cf8c023b..b4d28edaf8aa8ed45b741b02c3fd344245f2b1a8 100644 (file)
@@ -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);
 
index a5f9875cfd6e311f7e87b40890538ee312b37f4b..61b467a7ebdd20d5afe75d97fbff95bcae9b6814 100644 (file)
@@ -85,8 +85,8 @@ static struct mwifiex_debug_data items[] = {
         item_addr(hs_activated), 1},
        {"num_tx_timeout", item_size(num_tx_timeout),
         item_addr(num_tx_timeout), 1},
-       {"num_cmd_timeout", item_size(num_cmd_timeout),
-        item_addr(num_cmd_timeout), 1},
+       {"is_cmd_timedout", item_size(is_cmd_timedout),
+        item_addr(is_cmd_timedout), 1},
        {"timeout_cmd_id", item_size(timeout_cmd_id),
         item_addr(timeout_cmd_id), 1},
        {"timeout_cmd_act", item_size(timeout_cmd_act),
index 5974642f38b1915db2277c2bc6f1fe4885a958f1..1fb2212079aebac25cde7dd78bf9792ccf74de39 100644 (file)
@@ -209,7 +209,7 @@ struct mwifiex_debug_info {
        u32 num_cmd_assoc_success;
        u32 num_cmd_assoc_failure;
        u32 num_tx_timeout;
-       u32 num_cmd_timeout;
+       u8 is_cmd_timedout;
        u16 timeout_cmd_id;
        u16 timeout_cmd_act;
        u16 last_cmd_id[DBG_CMD_NUM];
index df09ddb64eec1019e623b2afaae93170b6323996..51ac9e3355a236d1cd31de9daa374accf50318b8 100644 (file)
@@ -719,7 +719,7 @@ struct mwifiex_adapter {
        struct cmd_ctrl_node *curr_cmd;
        /* spin lock for command */
        spinlock_t mwifiex_cmd_lock;
-       u32 num_cmd_timeout;
+       u8 is_cmd_timedout;
        u16 last_init_cmd;
        struct timer_list cmd_timer;
        struct list_head cmd_free_q;
index fd2a7165cfa5be83a2702a4c3899a013a99ec308..368450cc56c7d9e19b8c2a74c47d43a9c5c91b1f 100644 (file)
@@ -116,7 +116,7 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code)
        adapter->tx_lock_flag = false;
        adapter->pps_uapsd_mode = false;
 
-       if (adapter->num_cmd_timeout && adapter->curr_cmd)
+       if (adapter->is_cmd_timedout && adapter->curr_cmd)
                return;
        priv->media_connected = false;
        dev_dbg(adapter->dev,
index 7022c69f0a29c38c9466f634396095f2fcb6029d..c3824e37f3f24a30d951510a75cd4640346620d8 100644 (file)
@@ -104,7 +104,7 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv,
                info->pm_wakeup_fw_try = adapter->pm_wakeup_fw_try;
                info->is_hs_configured = adapter->is_hs_configured;
                info->hs_activated = adapter->hs_activated;
-               info->num_cmd_timeout = adapter->num_cmd_timeout;
+               info->is_cmd_timedout = adapter->is_cmd_timedout;
                info->num_cmd_host_to_card_failure
                                = adapter->dbg.num_cmd_host_to_card_failure;
                info->num_cmd_sleep_cfm_host_to_card_failure