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

Commit 81e95430 authored by Shanyu Zhao's avatar Shanyu Zhao Committed by John W. Linville
Browse files

iwlwifi: do not call ieee80211_frequency_to_channel



A few cases in iwlwifi driver function ieee80211_frequency_to_channel()
is called to get channel number from center frequency. This is not needed
since the channel number is already saved in hw_value field of struct
ieee80211_channel in function iwlcore_init_geos(). So replace those function
calls with hw_value field of struct ieee80211_channel.

Signed-off-by: default avatarShanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 7469701e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1470,7 +1470,7 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv,

	cmd.band = band;
	cmd.expect_beacon = 0;
	ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq);
	ch = ch_switch->channel->hw_value;
	cmd.channel = cpu_to_le16(ch);
	cmd.rxon_flags = priv->staging_rxon.flags;
	cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
	};

	cmd.band = priv->band == IEEE80211_BAND_2GHZ;
	ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq);
	ch = ch_switch->channel->hw_value;
	IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
		priv->active_rxon.channel, ch);
	cmd.channel = cpu_to_le16(ch);
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
	};

	cmd.band = priv->band == IEEE80211_BAND_2GHZ;
	ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq);
	ch = ch_switch->channel->hw_value;
	IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
		      priv->active_rxon.channel, ch);
	cmd.channel = cpu_to_le16(ch);
+1 −1
Original line number Diff line number Diff line
@@ -1098,7 +1098,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
		if (chan->band != band)
			continue;

		channel = ieee80211_frequency_to_channel(chan->center_freq);
		channel = chan->hw_value;
		scan_ch->channel = cpu_to_le16(channel);

		ch_info = iwl_get_channel_info(priv, band, channel);
+1 −2
Original line number Diff line number Diff line
@@ -3655,8 +3655,7 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw,
	mutex_lock(&priv->mutex);
	if (priv->cfg->ops->lib->set_channel_switch) {

		ch = ieee80211_frequency_to_channel(
			ch_switch->channel->center_freq);
		ch = ch_switch->channel->hw_value;
		if (le16_to_cpu(priv->active_rxon.channel) != ch) {
			ch_info = iwl_get_channel_info(priv,
						       conf->channel->band,
Loading