Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a3a0352 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

iwlwifi: correct frequency settings



After commit 59eb21a6
"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: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Acked-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0439f536
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -219,16 +219,12 @@ int iwlcore_init_geos(struct iwl_priv *priv)
		if (!is_channel_valid(ch))
		if (!is_channel_valid(ch))
			continue;
			continue;


		if (is_channel_a_band(ch))
		sband =  &priv->bands[ch->band];
			sband =  &priv->bands[IEEE80211_BAND_5GHZ];
		else
			sband =  &priv->bands[IEEE80211_BAND_2GHZ];


		geo_ch = &sband->channels[sband->n_channels++];
		geo_ch = &sband->channels[sband->n_channels++];


		geo_ch->center_freq =
		geo_ch->center_freq =
				ieee80211_channel_to_frequency(ch->channel,
			ieee80211_channel_to_frequency(ch->channel, ch->band);
							       sband->band);
		geo_ch->max_power = ch->max_power_avg;
		geo_ch->max_power = ch->max_power_avg;
		geo_ch->max_antenna_gain = 0xff;
		geo_ch->max_antenna_gain = 0xff;
		geo_ch->hw_value = ch->channel;
		geo_ch->hw_value = ch->channel;