aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-01-31 07:01:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-31 15:06:25 -0500
commit5a3a0352f39c81dfa5c30a190ad04d115616c3e6 (patch)
tree9992f869f56493fa17ed2cbb22143cb9aa246028 /drivers/net/wireless/iwlwifi/iwl-core.c
parent0439f5367c8d8bb2ebaca8d7329f51f3148b2fb2 (diff)
iwlwifi: correct frequency settings
After commit 59eb21a6504731fc16db4cf9463065dd61093e08 "cfg80211: Extend channel to frequency mapping for 802.11j" we use uninitialized sband->band when assign channel frequencies, what results that 5GHz channels have erroneous (zero) center_freq value. Patch fixes problem and simplifies code a bit. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 92724cbf18c..4ad89389a0a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -219,16 +219,12 @@ int iwlcore_init_geos(struct iwl_priv *priv)
219 if (!is_channel_valid(ch)) 219 if (!is_channel_valid(ch))
220 continue; 220 continue;
221 221
222 if (is_channel_a_band(ch)) 222 sband = &priv->bands[ch->band];
223 sband = &priv->bands[IEEE80211_BAND_5GHZ];
224 else
225 sband = &priv->bands[IEEE80211_BAND_2GHZ];
226 223
227 geo_ch = &sband->channels[sband->n_channels++]; 224 geo_ch = &sband->channels[sband->n_channels++];
228 225
229 geo_ch->center_freq = 226 geo_ch->center_freq =
230 ieee80211_channel_to_frequency(ch->channel, 227 ieee80211_channel_to_frequency(ch->channel, ch->band);
231 sband->band);
232 geo_ch->max_power = ch->max_power_avg; 228 geo_ch->max_power = ch->max_power_avg;
233 geo_ch->max_antenna_gain = 0xff; 229 geo_ch->max_antenna_gain = 0xff;
234 geo_ch->hw_value = ch->channel; 230 geo_ch->hw_value = ch->channel;