]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
iwlwifi: correct frequency settings
authorStanislaw Gruszka <sgruszka@redhat.com>
Mon, 31 Jan 2011 12:01:35 +0000 (13:01 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 31 Jan 2011 20:06:25 +0000 (15:06 -0500)
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>
drivers/net/wireless/iwlwifi/iwl-core.c

index 92724cbf18ca24da438abb82c6dbca3f23dd1bf2..4ad89389a0a974f5cfb50bd77ce51c3dd10bdb24 100644 (file)
@@ -219,16 +219,12 @@ int iwlcore_init_geos(struct iwl_priv *priv)
                if (!is_channel_valid(ch))
                        continue;
 
-               if (is_channel_a_band(ch))
-                       sband =  &priv->bands[IEEE80211_BAND_5GHZ];
-               else
-                       sband =  &priv->bands[IEEE80211_BAND_2GHZ];
+               sband =  &priv->bands[ch->band];
 
                geo_ch = &sband->channels[sband->n_channels++];
 
                geo_ch->center_freq =
-                               ieee80211_channel_to_frequency(ch->channel,
-                                                              sband->band);
+                       ieee80211_channel_to_frequency(ch->channel, ch->band);
                geo_ch->max_power = ch->max_power_avg;
                geo_ch->max_antenna_gain = 0xff;
                geo_ch->hw_value = ch->channel;