iwlwifi: fix for channel switch
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-4965.c
index faa4c4e2d43c9c8855485eb6e47bde347093f30a..1d22ea390c008376c80d370dad38071f312a67be 100644 (file)
@@ -1449,14 +1449,14 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
        is_ht40 = is_ht40_channel(priv->staging_rxon.flags);
 
        if (is_ht40 &&
-           (priv->active_rxon.flags & RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK))
+           (priv->staging_rxon.flags & RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK))
                ctrl_chan_high = 1;
 
        cmd.band = band;
        cmd.expect_beacon = 0;
        cmd.channel = cpu_to_le16(channel);
-       cmd.rxon_flags = priv->active_rxon.flags;
-       cmd.rxon_filter_flags = priv->active_rxon.filter_flags;
+       cmd.rxon_flags = priv->staging_rxon.flags;
+       cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
        cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
        if (ch_info)
                cmd.expect_beacon = is_channel_radar(ch_info);
@@ -1473,8 +1473,10 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
                return rc;
        }
 
-       rc = iwl_send_cmd_pdu(priv, REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd);
-       return rc;
+       priv->switch_rxon.channel = cpu_to_le16(channel);
+       priv->switch_rxon.switch_in_progress = true;
+
+       return iwl_send_cmd_pdu(priv, REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd);
 }
 
 /**
This page took 0.026884 seconds and 5 git commands to generate.