aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c54
1 files changed, 31 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index e0b5b4aef41..d09e7481532 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1316,19 +1316,24 @@ void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
1316 struct iwl_rxon_cmd *rxon = (void *)&priv->active_rxon; 1316 struct iwl_rxon_cmd *rxon = (void *)&priv->active_rxon;
1317 struct iwl_csa_notification *csa = &(pkt->u.csa_notif); 1317 struct iwl_csa_notification *csa = &(pkt->u.csa_notif);
1318 1318
1319 if (!le32_to_cpu(csa->status)) { 1319 if (priv->switch_rxon.switch_in_progress) {
1320 rxon->channel = csa->channel; 1320 if (!le32_to_cpu(csa->status) &&
1321 priv->staging_rxon.channel = csa->channel; 1321 (csa->channel == priv->switch_rxon.channel)) {
1322 IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 1322 rxon->channel = csa->channel;
1323 le16_to_cpu(csa->channel)); 1323 priv->staging_rxon.channel = csa->channel;
1324 } else 1324 IWL_DEBUG_11H(priv, "CSA notif: channel %d\n",
1325 IWL_ERR(priv, "CSA notif (fail) : channel %d\n", 1325 le16_to_cpu(csa->channel));
1326 le16_to_cpu(csa->channel)); 1326 } else
1327 IWL_ERR(priv, "CSA notif (fail) : channel %d\n",
1328 le16_to_cpu(csa->channel));
1329
1330 priv->switch_rxon.switch_in_progress = false;
1331 }
1327} 1332}
1328EXPORT_SYMBOL(iwl_rx_csa); 1333EXPORT_SYMBOL(iwl_rx_csa);
1329 1334
1330#ifdef CONFIG_IWLWIFI_DEBUG 1335#ifdef CONFIG_IWLWIFI_DEBUG
1331static void iwl_print_rx_config_cmd(struct iwl_priv *priv) 1336void iwl_print_rx_config_cmd(struct iwl_priv *priv)
1332{ 1337{
1333 struct iwl_rxon_cmd *rxon = &priv->staging_rxon; 1338 struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
1334 1339
@@ -1346,6 +1351,7 @@ static void iwl_print_rx_config_cmd(struct iwl_priv *priv)
1346 IWL_DEBUG_RADIO(priv, "u8[6] bssid_addr: %pM\n", rxon->bssid_addr); 1351 IWL_DEBUG_RADIO(priv, "u8[6] bssid_addr: %pM\n", rxon->bssid_addr);
1347 IWL_DEBUG_RADIO(priv, "u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id)); 1352 IWL_DEBUG_RADIO(priv, "u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
1348} 1353}
1354EXPORT_SYMBOL(iwl_print_rx_config_cmd);
1349#endif 1355#endif
1350/** 1356/**
1351 * iwl_irq_handle_error - called for HW or SW error interrupt from card 1357 * iwl_irq_handle_error - called for HW or SW error interrupt from card
@@ -2310,12 +2316,6 @@ static void iwl_ht_conf(struct iwl_priv *priv,
2310 >> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT; 2316 >> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
2311 maxstreams += 1; 2317 maxstreams += 1;
2312 2318
2313 ht_conf->sm_ps =
2314 (u8)((ht_cap->cap & IEEE80211_HT_CAP_SM_PS)
2315 >> 2);
2316 IWL_DEBUG_MAC80211(priv, "sm_ps: 0x%x\n",
2317 ht_conf->sm_ps);
2318
2319 if ((ht_cap->mcs.rx_mask[1] == 0) && 2319 if ((ht_cap->mcs.rx_mask[1] == 0) &&
2320 (ht_cap->mcs.rx_mask[2] == 0)) 2320 (ht_cap->mcs.rx_mask[2] == 0))
2321 ht_conf->single_chain_sufficient = true; 2321 ht_conf->single_chain_sufficient = true;
@@ -2689,14 +2689,6 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2689 goto set_ch_out; 2689 goto set_ch_out;
2690 } 2690 }
2691 2691
2692 if (iwl_is_associated(priv) &&
2693 (le16_to_cpu(priv->active_rxon.channel) != ch) &&
2694 priv->cfg->ops->lib->set_channel_switch) {
2695 ret = priv->cfg->ops->lib->set_channel_switch(priv,
2696 ch);
2697 goto out;
2698 }
2699
2700 spin_lock_irqsave(&priv->lock, flags); 2692 spin_lock_irqsave(&priv->lock, flags);
2701 2693
2702 /* Configure HT40 channels */ 2694 /* Configure HT40 channels */
@@ -2731,6 +2723,22 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2731 2723
2732 iwl_set_flags_for_band(priv, conf->channel->band); 2724 iwl_set_flags_for_band(priv, conf->channel->band);
2733 spin_unlock_irqrestore(&priv->lock, flags); 2725 spin_unlock_irqrestore(&priv->lock, flags);
2726 if (iwl_is_associated(priv) &&
2727 (le16_to_cpu(priv->active_rxon.channel) != ch) &&
2728 priv->cfg->ops->lib->set_channel_switch) {
2729 iwl_set_rate(priv);
2730 /*
2731 * at this point, staging_rxon has the
2732 * configuration for channel switch
2733 */
2734 ret = priv->cfg->ops->lib->set_channel_switch(priv,
2735 ch);
2736 if (!ret) {
2737 iwl_print_rx_config_cmd(priv);
2738 goto out;
2739 }
2740 priv->switch_rxon.switch_in_progress = false;
2741 }
2734 set_ch_out: 2742 set_ch_out:
2735 /* The list of supported rates and rate mask can be different 2743 /* The list of supported rates and rate mask can be different
2736 * for each band; since the band may have changed, reset 2744 * for each band; since the band may have changed, reset