diff options
author | Shanyu Zhao <shanyu.zhao@intel.com> | 2010-07-28 16:40:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-24 16:32:01 -0400 |
commit | 81e95430aaa898799421617c2db2882386bab69a (patch) | |
tree | ba5aa860c8e6c63b9ae6257b8fbf71271ad39f2f | |
parent | 7469701e10adb6bcc3d66544bd9f6d553fc678c9 (diff) |
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: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 6 |
7 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index d6da356608fa..9415b71fa12d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -1470,7 +1470,7 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, | |||
1470 | 1470 | ||
1471 | cmd.band = band; | 1471 | cmd.band = band; |
1472 | cmd.expect_beacon = 0; | 1472 | cmd.expect_beacon = 0; |
1473 | ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq); | 1473 | ch = ch_switch->channel->hw_value; |
1474 | cmd.channel = cpu_to_le16(ch); | 1474 | cmd.channel = cpu_to_le16(ch); |
1475 | cmd.rxon_flags = priv->staging_rxon.flags; | 1475 | cmd.rxon_flags = priv->staging_rxon.flags; |
1476 | cmd.rxon_filter_flags = priv->staging_rxon.filter_flags; | 1476 | cmd.rxon_filter_flags = priv->staging_rxon.filter_flags; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 54083a39c724..0c2ea136cfd5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -291,7 +291,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, | |||
291 | }; | 291 | }; |
292 | 292 | ||
293 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; | 293 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; |
294 | ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq); | 294 | ch = ch_switch->channel->hw_value; |
295 | IWL_DEBUG_11H(priv, "channel switch from %d to %d\n", | 295 | IWL_DEBUG_11H(priv, "channel switch from %d to %d\n", |
296 | priv->active_rxon.channel, ch); | 296 | priv->active_rxon.channel, ch); |
297 | cmd.channel = cpu_to_le16(ch); | 297 | cmd.channel = cpu_to_le16(ch); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 7902de172a38..e0c6c3afba27 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -214,7 +214,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, | |||
214 | }; | 214 | }; |
215 | 215 | ||
216 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; | 216 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; |
217 | ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq); | 217 | ch = ch_switch->channel->hw_value; |
218 | IWL_DEBUG_11H(priv, "channel switch from %u to %u\n", | 218 | IWL_DEBUG_11H(priv, "channel switch from %u to %u\n", |
219 | priv->active_rxon.channel, ch); | 219 | priv->active_rxon.channel, ch); |
220 | cmd.channel = cpu_to_le16(ch); | 220 | cmd.channel = cpu_to_le16(ch); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 9dd9e64c2b0b..eedd71f5506b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -1098,7 +1098,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, | |||
1098 | if (chan->band != band) | 1098 | if (chan->band != band) |
1099 | continue; | 1099 | continue; |
1100 | 1100 | ||
1101 | channel = ieee80211_frequency_to_channel(chan->center_freq); | 1101 | channel = chan->hw_value; |
1102 | scan_ch->channel = cpu_to_le16(channel); | 1102 | scan_ch->channel = cpu_to_le16(channel); |
1103 | 1103 | ||
1104 | ch_info = iwl_get_channel_info(priv, band, channel); | 1104 | ch_info = iwl_get_channel_info(priv, band, channel); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index bce77eeb31c0..eecfec7c4063 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3655,8 +3655,7 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw, | |||
3655 | mutex_lock(&priv->mutex); | 3655 | mutex_lock(&priv->mutex); |
3656 | if (priv->cfg->ops->lib->set_channel_switch) { | 3656 | if (priv->cfg->ops->lib->set_channel_switch) { |
3657 | 3657 | ||
3658 | ch = ieee80211_frequency_to_channel( | 3658 | ch = ch_switch->channel->hw_value; |
3659 | ch_switch->channel->center_freq); | ||
3660 | if (le16_to_cpu(priv->active_rxon.channel) != ch) { | 3659 | if (le16_to_cpu(priv->active_rxon.channel) != ch) { |
3661 | ch_info = iwl_get_channel_info(priv, | 3660 | ch_info = iwl_get_channel_info(priv, |
3662 | conf->channel->band, | 3661 | conf->channel->band, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index b5045c62de7e..dc29844cce1f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -916,7 +916,7 @@ EXPORT_SYMBOL(iwl_get_single_channel_number); | |||
916 | int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch) | 916 | int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch) |
917 | { | 917 | { |
918 | enum ieee80211_band band = ch->band; | 918 | enum ieee80211_band band = ch->band; |
919 | u16 channel = ieee80211_frequency_to_channel(ch->center_freq); | 919 | u16 channel = ch->hw_value; |
920 | 920 | ||
921 | if (!iwl_get_channel_info(priv, band, channel)) { | 921 | if (!iwl_get_channel_info(priv, band, channel)) { |
922 | IWL_DEBUG_INFO(priv, "Could not set channel to %d [%d]\n", | 922 | IWL_DEBUG_INFO(priv, "Could not set channel to %d [%d]\n", |
@@ -2032,7 +2032,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
2032 | if (scan_active) | 2032 | if (scan_active) |
2033 | goto set_ch_out; | 2033 | goto set_ch_out; |
2034 | 2034 | ||
2035 | ch = ieee80211_frequency_to_channel(conf->channel->center_freq); | 2035 | ch = conf->channel->hw_value; |
2036 | ch_info = iwl_get_channel_info(priv, conf->channel->band, ch); | 2036 | ch_info = iwl_get_channel_info(priv, conf->channel->band, ch); |
2037 | if (!is_channel_valid(ch_info)) { | 2037 | if (!is_channel_valid(ch_info)) { |
2038 | IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n"); | 2038 | IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index e96a1bb12783..d3acdae72381 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -467,8 +467,7 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
467 | for (i = 0; i < supp_band->n_channels; i++) | 467 | for (i = 0; i < supp_band->n_channels; i++) |
468 | pos += scnprintf(buf + pos, bufsz - pos, | 468 | pos += scnprintf(buf + pos, bufsz - pos, |
469 | "%d: %ddBm: BSS%s%s, %s.\n", | 469 | "%d: %ddBm: BSS%s%s, %s.\n", |
470 | ieee80211_frequency_to_channel( | 470 | channels[i].hw_value, |
471 | channels[i].center_freq), | ||
472 | channels[i].max_power, | 471 | channels[i].max_power, |
473 | channels[i].flags & IEEE80211_CHAN_RADAR ? | 472 | channels[i].flags & IEEE80211_CHAN_RADAR ? |
474 | " (IEEE 802.11h required)" : "", | 473 | " (IEEE 802.11h required)" : "", |
@@ -491,8 +490,7 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf, | |||
491 | for (i = 0; i < supp_band->n_channels; i++) | 490 | for (i = 0; i < supp_band->n_channels; i++) |
492 | pos += scnprintf(buf + pos, bufsz - pos, | 491 | pos += scnprintf(buf + pos, bufsz - pos, |
493 | "%d: %ddBm: BSS%s%s, %s.\n", | 492 | "%d: %ddBm: BSS%s%s, %s.\n", |
494 | ieee80211_frequency_to_channel( | 493 | channels[i].hw_value, |
495 | channels[i].center_freq), | ||
496 | channels[i].max_power, | 494 | channels[i].max_power, |
497 | channels[i].flags & IEEE80211_CHAN_RADAR ? | 495 | channels[i].flags & IEEE80211_CHAN_RADAR ? |
498 | " (IEEE 802.11h required)" : "", | 496 | " (IEEE 802.11h required)" : "", |