]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/libertas/cmd.c
Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap...
[linux-2.6] / drivers / net / wireless / libertas / cmd.c
index 49267ed7cea30899be850fde711b0b08baf513f8..8124fd9b1353523c603e679914d2fd839ac6f97b 100644 (file)
@@ -296,6 +296,7 @@ int lbs_cmd_802_11_set_wep(struct lbs_private *priv, uint16_t cmd_action,
 
        lbs_deb_enter(LBS_DEB_CMD);
 
+       memset(&cmd, 0, sizeof(cmd));
        cmd.hdr.command = cpu_to_le16(CMD_802_11_SET_WEP);
        cmd.hdr.size = cpu_to_le16(sizeof(cmd));
 
@@ -359,7 +360,9 @@ int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action,
        cmd.hdr.size = cpu_to_le16(sizeof(cmd));
        cmd.action = cpu_to_le16(cmd_action);
 
-       if (cmd_action == CMD_ACT_SET) {
+       if (cmd_action == CMD_ACT_GET)
+               cmd.enable = 0;
+       else {
                if (*enable)
                        cmd.enable = cpu_to_le16(CMD_ENABLE_RSN);
                else
@@ -811,6 +814,7 @@ int lbs_get_channel(struct lbs_private *priv)
 
        lbs_deb_enter(LBS_DEB_CMD);
 
+       memset(&cmd, 0, sizeof(cmd));
        cmd.hdr.size = cpu_to_le16(sizeof(cmd));
        cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET);
 
@@ -858,6 +862,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
 
        lbs_deb_enter(LBS_DEB_CMD);
 
+       memset(&cmd, 0, sizeof(cmd));
        cmd.hdr.size = cpu_to_le16(sizeof(cmd));
        cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET);
        cmd.channel = cpu_to_le16(channel);
@@ -1837,6 +1842,9 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
 
        spin_lock_irqsave(&priv->driver_lock, flags);
 
+       /* We don't get a response on the sleep-confirmation */
+       priv->dnld_sent = DNLD_RES_RECEIVED;
+
        /* If nothing to do, go back to sleep (?) */
        if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx])
                priv->psstate = PS_STATE_SLEEP;
@@ -1899,12 +1907,12 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
 
        lbs_deb_enter(LBS_DEB_HOST);
 
+       spin_lock_irqsave(&priv->driver_lock, flags);
        if (priv->dnld_sent) {
                allowed = 0;
                lbs_deb_host("dnld_sent was set\n");
        }
 
-       spin_lock_irqsave(&priv->driver_lock, flags);
        /* In-progress command? */
        if (priv->cur_cmd) {
                allowed = 0;