aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.c12
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.c30
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-dev.h13
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c20
5 files changed, 30 insertions, 47 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.c b/drivers/net/wireless/iwlegacy/iwl-4965.c
index f9db25bb35c3..facc94e74b07 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965.c
@@ -1218,10 +1218,10 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
1218 * receive commit_rxon request 1218 * receive commit_rxon request
1219 * abort any previous channel switch if still in process 1219 * abort any previous channel switch if still in process
1220 */ 1220 */
1221 if (priv->switch_rxon.switch_in_progress && 1221 if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) &&
1222 (priv->switch_rxon.channel != ctx->staging.channel)) { 1222 (priv->switch_channel != ctx->staging.channel)) {
1223 IWL_DEBUG_11H(priv, "abort channel switch on %d\n", 1223 IWL_DEBUG_11H(priv, "abort channel switch on %d\n",
1224 le16_to_cpu(priv->switch_rxon.channel)); 1224 le16_to_cpu(priv->switch_channel));
1225 iwl_legacy_chswitch_done(priv, false); 1225 iwl_legacy_chswitch_done(priv, false);
1226 } 1226 }
1227 1227
@@ -1237,7 +1237,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
1237 1237
1238 memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); 1238 memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon));
1239 iwl_legacy_print_rx_config_cmd(priv, ctx); 1239 iwl_legacy_print_rx_config_cmd(priv, ctx);
1240 return 0; 1240 goto set_tx_power;
1241 } 1241 }
1242 1242
1243 /* If we are currently associated and the new config requires 1243 /* If we are currently associated and the new config requires
@@ -1317,6 +1317,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *c
1317 1317
1318 iwl4965_init_sensitivity(priv); 1318 iwl4965_init_sensitivity(priv);
1319 1319
1320set_tx_power:
1320 /* If we issue a new RXON command which required a tune then we must 1321 /* If we issue a new RXON command which required a tune then we must
1321 * send a new TXPOWER command or we won't be able to Tx any frames */ 1322 * send a new TXPOWER command or we won't be able to Tx any frames */
1322 ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true); 1323 ret = iwl_legacy_set_tx_power(priv, priv->tx_power_next, true);
@@ -1403,9 +1404,6 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv,
1403 return rc; 1404 return rc;
1404 } 1405 }
1405 1406
1406 priv->switch_rxon.channel = cmd.channel;
1407 priv->switch_rxon.switch_in_progress = true;
1408
1409 return iwl_legacy_send_cmd_pdu(priv, 1407 return iwl_legacy_send_cmd_pdu(priv,
1410 REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd); 1408 REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd);
1411} 1409}
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index 42df8321dae8..3be76bd5499a 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -859,12 +859,8 @@ void iwl_legacy_chswitch_done(struct iwl_priv *priv, bool is_success)
859 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 859 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
860 return; 860 return;
861 861
862 if (priv->switch_rxon.switch_in_progress) { 862 if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
863 ieee80211_chswitch_done(ctx->vif, is_success); 863 ieee80211_chswitch_done(ctx->vif, is_success);
864 mutex_lock(&priv->mutex);
865 priv->switch_rxon.switch_in_progress = false;
866 mutex_unlock(&priv->mutex);
867 }
868} 864}
869EXPORT_SYMBOL(iwl_legacy_chswitch_done); 865EXPORT_SYMBOL(iwl_legacy_chswitch_done);
870 866
@@ -876,19 +872,19 @@ void iwl_legacy_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
876 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; 872 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
877 struct iwl_legacy_rxon_cmd *rxon = (void *)&ctx->active; 873 struct iwl_legacy_rxon_cmd *rxon = (void *)&ctx->active;
878 874
879 if (priv->switch_rxon.switch_in_progress) { 875 if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
880 if (!le32_to_cpu(csa->status) && 876 return;
881 (csa->channel == priv->switch_rxon.channel)) { 877
882 rxon->channel = csa->channel; 878 if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) {
883 ctx->staging.channel = csa->channel; 879 rxon->channel = csa->channel;
884 IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 880 ctx->staging.channel = csa->channel;
885 le16_to_cpu(csa->channel)); 881 IWL_DEBUG_11H(priv, "CSA notif: channel %d\n",
886 iwl_legacy_chswitch_done(priv, true);
887 } else {
888 IWL_ERR(priv, "CSA notif (fail) : channel %d\n",
889 le16_to_cpu(csa->channel)); 882 le16_to_cpu(csa->channel));
890 iwl_legacy_chswitch_done(priv, false); 883 iwl_legacy_chswitch_done(priv, true);
891 } 884 } else {
885 IWL_ERR(priv, "CSA notif (fail) : channel %d\n",
886 le16_to_cpu(csa->channel));
887 iwl_legacy_chswitch_done(priv, false);
892 } 888 }
893} 889}
894EXPORT_SYMBOL(iwl_legacy_rx_csa); 890EXPORT_SYMBOL(iwl_legacy_rx_csa);
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.h b/drivers/net/wireless/iwlegacy/iwl-core.h
index bc66c604106c..c5fbda0760de 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.h
+++ b/drivers/net/wireless/iwlegacy/iwl-core.h
@@ -560,7 +560,7 @@ void iwl_legacy_free_geos(struct iwl_priv *priv);
560#define STATUS_SCAN_HW 15 560#define STATUS_SCAN_HW 15
561#define STATUS_POWER_PMI 16 561#define STATUS_POWER_PMI 16
562#define STATUS_FW_ERROR 17 562#define STATUS_FW_ERROR 17
563 563#define STATUS_CHANNEL_SWITCH_PENDING 18
564 564
565static inline int iwl_legacy_is_ready(struct iwl_priv *priv) 565static inline int iwl_legacy_is_ready(struct iwl_priv *priv)
566{ 566{
diff --git a/drivers/net/wireless/iwlegacy/iwl-dev.h b/drivers/net/wireless/iwlegacy/iwl-dev.h
index be0106c6a2da..ea30122669ee 100644
--- a/drivers/net/wireless/iwlegacy/iwl-dev.h
+++ b/drivers/net/wireless/iwlegacy/iwl-dev.h
@@ -855,17 +855,6 @@ struct traffic_stats {
855}; 855};
856 856
857/* 857/*
858 * iwl_switch_rxon: "channel switch" structure
859 *
860 * @ switch_in_progress: channel switch in progress
861 * @ channel: new channel
862 */
863struct iwl_switch_rxon {
864 bool switch_in_progress;
865 __le16 channel;
866};
867
868/*
869 * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds 858 * schedule the timer to wake up every UCODE_TRACE_PERIOD milliseconds
870 * to perform continuous uCode event logging operation if enabled 859 * to perform continuous uCode event logging operation if enabled
871 */ 860 */
@@ -1115,7 +1104,7 @@ struct iwl_priv {
1115 1104
1116 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX]; 1105 struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
1117 1106
1118 struct iwl_switch_rxon switch_rxon; 1107 __le16 switch_channel;
1119 1108
1120 /* 1st responses from initialize and runtime uCode images. 1109 /* 1st responses from initialize and runtime uCode images.
1121 * _4965's initialize alive response contains some calibration data. */ 1110 * _4965's initialize alive response contains some calibration data. */
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index af2ae22fcfd3..7157ba529680 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -2861,16 +2861,13 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw,
2861 goto out; 2861 goto out;
2862 2862
2863 if (test_bit(STATUS_EXIT_PENDING, &priv->status) || 2863 if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
2864 test_bit(STATUS_SCANNING, &priv->status)) 2864 test_bit(STATUS_SCANNING, &priv->status) ||
2865 test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
2865 goto out; 2866 goto out;
2866 2867
2867 if (!iwl_legacy_is_associated_ctx(ctx)) 2868 if (!iwl_legacy_is_associated_ctx(ctx))
2868 goto out; 2869 goto out;
2869 2870
2870 /* channel switch in progress */
2871 if (priv->switch_rxon.switch_in_progress == true)
2872 goto out;
2873
2874 if (priv->cfg->ops->lib->set_channel_switch) { 2871 if (priv->cfg->ops->lib->set_channel_switch) {
2875 2872
2876 ch = channel->hw_value; 2873 ch = channel->hw_value;
@@ -2919,15 +2916,18 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw,
2919 * at this point, staging_rxon has the 2916 * at this point, staging_rxon has the
2920 * configuration for channel switch 2917 * configuration for channel switch
2921 */ 2918 */
2922 if (priv->cfg->ops->lib->set_channel_switch(priv, 2919 set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status);
2923 ch_switch)) 2920 priv->switch_channel = cpu_to_le16(ch);
2924 priv->switch_rxon.switch_in_progress = false; 2921 if (priv->cfg->ops->lib->set_channel_switch(priv, ch_switch)) {
2922 clear_bit(STATUS_CHANNEL_SWITCH_PENDING,
2923 &priv->status);
2924 priv->switch_channel = 0;
2925 ieee80211_chswitch_done(ctx->vif, false);
2926 }
2925 } 2927 }
2926 } 2928 }
2927out: 2929out:
2928 mutex_unlock(&priv->mutex); 2930 mutex_unlock(&priv->mutex);
2929 if (!priv->switch_rxon.switch_in_progress)
2930 ieee80211_chswitch_done(ctx->vif, false);
2931 IWL_DEBUG_MAC80211(priv, "leave\n"); 2931 IWL_DEBUG_MAC80211(priv, "leave\n");
2932} 2932}
2933 2933