]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/marvell/libertas/cmdresp.c
Merge remote-tracking branch 'rcu/rcu/next'
[karo-tx-linux.git] / drivers / net / wireless / marvell / libertas / cmdresp.c
index e5442e8956f7ac3b1182058864816dc700548fe5..c95bf6dc9522eae5bdd4824e4c157ddc15dbc562 100644 (file)
@@ -123,7 +123,10 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
        priv->cmd_timed_out = 0;
 
        if (respcmd == CMD_RET(CMD_802_11_PS_MODE)) {
-               struct cmd_ds_802_11_ps_mode *psmode = (void *) &resp[1];
+               /* struct cmd_ds_802_11_ps_mode also contains
+                * the header
+                */
+               struct cmd_ds_802_11_ps_mode *psmode = (void *)resp;
                u16 action = le16_to_cpu(psmode->action);
 
                lbs_deb_host(
@@ -254,6 +257,10 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
                               "EVENT: in FULL POWER mode, ignoring PS_SLEEP\n");
                        break;
                }
+               if (!list_empty(&priv->cmdpendingq)) {
+                       lbs_deb_cmd("EVENT: commands in queue, do not sleep\n");
+                       break;
+               }
                priv->psstate = PS_STATE_PRE_SLEEP;
 
                lbs_ps_confirm_sleep(priv);