Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / mwifiex / sta_ioctl.c
index 9f33c92c90f5b8dc32bf9685bd3b708171b66acc..8c943b6ebf4512034eb17349a9bb320c8f66cb4e 100644 (file)
@@ -54,16 +54,10 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
  * This function waits on a cmd wait queue. It also cancels the pending
  * request after waking up, in case of errors.
  */
-int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
+int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
+                               struct cmd_ctrl_node *cmd_queued)
 {
        int status;
-       struct cmd_ctrl_node *cmd_queued;
-
-       if (!adapter->cmd_queued)
-               return 0;
-
-       cmd_queued = adapter->cmd_queued;
-       adapter->cmd_queued = NULL;
 
        dev_dbg(adapter->dev, "cmd pending\n");
        atomic_inc(&adapter->cmd_pending);
@@ -388,7 +382,7 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
                        break;
                }
                if (hs_cfg->is_invoke_hostcmd) {
-                       if (hs_cfg->conditions == HOST_SLEEP_CFG_CANCEL) {
+                       if (hs_cfg->conditions == HS_CFG_CANCEL) {
                                if (!adapter->is_hs_configured)
                                        /* Already cancelled */
                                        break;
@@ -403,8 +397,8 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
                                adapter->hs_cfg.gpio = (u8)hs_cfg->gpio;
                                if (hs_cfg->gap)
                                        adapter->hs_cfg.gap = (u8)hs_cfg->gap;
-                       } else if (adapter->hs_cfg.conditions
-                                  == cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) {
+                       } else if (adapter->hs_cfg.conditions ==
+                                  cpu_to_le32(HS_CFG_CANCEL)) {
                                /* Return failure if no parameters for HS
                                   enable */
                                status = -1;
@@ -420,7 +414,7 @@ static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action,
                                                HostCmd_CMD_802_11_HS_CFG_ENH,
                                                HostCmd_ACT_GEN_SET, 0,
                                                &adapter->hs_cfg);
-                       if (hs_cfg->conditions == HOST_SLEEP_CFG_CANCEL)
+                       if (hs_cfg->conditions == HS_CFG_CANCEL)
                                /* Restore previous condition */
                                adapter->hs_cfg.conditions =
                                                cpu_to_le32(prev_cond);
@@ -454,7 +448,7 @@ int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type)
 {
        struct mwifiex_ds_hs_cfg hscfg;
 
-       hscfg.conditions = HOST_SLEEP_CFG_CANCEL;
+       hscfg.conditions = HS_CFG_CANCEL;
        hscfg.is_invoke_hostcmd = true;
 
        return mwifiex_set_hs_params(priv, HostCmd_ACT_GEN_SET,