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 3d64613..b9242c3 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 686943c..b4d28ed 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 a5f9875..61b467a 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 5974642..1fb2212 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 df09ddb..51ac9e3 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 fd2a716..368450c 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 7022c69..c3824e3 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