aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-05-06 11:54:11 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-06-06 02:16:09 -0400
commit79d07325502e73508f917475bc1617b60979dd94 (patch)
tree7493c7db482c41b4535690c3a19fb81f3a7b2580 /drivers/net/wireless/iwlwifi/iwl-core.c
parenta0ee74cf080389aee4fbf198ffa7e85b3480b661 (diff)
iwlwifi: support channel switch offload in driver
Support channel switch in driver as a separated mac80211 callback function instead of part of mac_config callback; by moving to this approach, uCode can have more control of channel switch timing. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index b05b813413fd..718ffa3d89c1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -893,9 +893,9 @@ int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch)
893} 893}
894EXPORT_SYMBOL(iwl_set_rxon_channel); 894EXPORT_SYMBOL(iwl_set_rxon_channel);
895 895
896static void iwl_set_flags_for_band(struct iwl_priv *priv, 896void iwl_set_flags_for_band(struct iwl_priv *priv,
897 enum ieee80211_band band, 897 enum ieee80211_band band,
898 struct ieee80211_vif *vif) 898 struct ieee80211_vif *vif)
899{ 899{
900 if (band == IEEE80211_BAND_5GHZ) { 900 if (band == IEEE80211_BAND_5GHZ) {
901 priv->staging_rxon.flags &= 901 priv->staging_rxon.flags &=
@@ -914,6 +914,7 @@ static void iwl_set_flags_for_band(struct iwl_priv *priv,
914 priv->staging_rxon.flags &= ~RXON_FLG_CCK_MSK; 914 priv->staging_rxon.flags &= ~RXON_FLG_CCK_MSK;
915 } 915 }
916} 916}
917EXPORT_SYMBOL(iwl_set_flags_for_band);
917 918
918/* 919/*
919 * initialize rxon structure with default values from eeprom 920 * initialize rxon structure with default values from eeprom
@@ -989,7 +990,7 @@ void iwl_connection_init_rx_config(struct iwl_priv *priv,
989} 990}
990EXPORT_SYMBOL(iwl_connection_init_rx_config); 991EXPORT_SYMBOL(iwl_connection_init_rx_config);
991 992
992static void iwl_set_rate(struct iwl_priv *priv) 993void iwl_set_rate(struct iwl_priv *priv)
993{ 994{
994 const struct ieee80211_supported_band *hw = NULL; 995 const struct ieee80211_supported_band *hw = NULL;
995 struct ieee80211_rate *rate; 996 struct ieee80211_rate *rate;
@@ -1017,6 +1018,21 @@ static void iwl_set_rate(struct iwl_priv *priv)
1017 priv->staging_rxon.ofdm_basic_rates = 1018 priv->staging_rxon.ofdm_basic_rates =
1018 (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF; 1019 (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
1019} 1020}
1021EXPORT_SYMBOL(iwl_set_rate);
1022
1023void iwl_chswitch_done(struct iwl_priv *priv, bool is_success)
1024{
1025 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
1026 return;
1027
1028 if (priv->switch_rxon.switch_in_progress) {
1029 ieee80211_chswitch_done(priv->vif, is_success);
1030 mutex_lock(&priv->mutex);
1031 priv->switch_rxon.switch_in_progress = false;
1032 mutex_unlock(&priv->mutex);
1033 }
1034}
1035EXPORT_SYMBOL(iwl_chswitch_done);
1020 1036
1021void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) 1037void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
1022{ 1038{
@@ -1031,11 +1047,12 @@ void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
1031 priv->staging_rxon.channel = csa->channel; 1047 priv->staging_rxon.channel = csa->channel;
1032 IWL_DEBUG_11H(priv, "CSA notif: channel %d\n", 1048 IWL_DEBUG_11H(priv, "CSA notif: channel %d\n",
1033 le16_to_cpu(csa->channel)); 1049 le16_to_cpu(csa->channel));
1034 } else 1050 iwl_chswitch_done(priv, true);
1051 } else {
1035 IWL_ERR(priv, "CSA notif (fail) : channel %d\n", 1052 IWL_ERR(priv, "CSA notif (fail) : channel %d\n",
1036 le16_to_cpu(csa->channel)); 1053 le16_to_cpu(csa->channel));
1037 1054 iwl_chswitch_done(priv, false);
1038 priv->switch_rxon.switch_in_progress = false; 1055 }
1039 } 1056 }
1040} 1057}
1041EXPORT_SYMBOL(iwl_rx_csa); 1058EXPORT_SYMBOL(iwl_rx_csa);
@@ -2044,22 +2061,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2044 2061
2045 iwl_set_flags_for_band(priv, conf->channel->band, priv->vif); 2062 iwl_set_flags_for_band(priv, conf->channel->band, priv->vif);
2046 spin_unlock_irqrestore(&priv->lock, flags); 2063 spin_unlock_irqrestore(&priv->lock, flags);
2047 if (iwl_is_associated(priv) && 2064
2048 (le16_to_cpu(priv->active_rxon.channel) != ch) &&
2049 priv->cfg->ops->lib->set_channel_switch) {
2050 iwl_set_rate(priv);
2051 /*
2052 * at this point, staging_rxon has the
2053 * configuration for channel switch
2054 */
2055 ret = priv->cfg->ops->lib->set_channel_switch(priv,
2056 ch);
2057 if (!ret) {
2058 iwl_print_rx_config_cmd(priv);
2059 goto out;
2060 }
2061 priv->switch_rxon.switch_in_progress = false;
2062 }
2063 set_ch_out: 2065 set_ch_out:
2064 /* The list of supported rates and rate mask can be different 2066 /* The list of supported rates and rate mask can be different
2065 * for each band; since the band may have changed, reset 2067 * for each band; since the band may have changed, reset