diff mbox

[6/7] orinoco: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}

Message ID be3f8f8f679b4665e3306869a35f830a94e727df.1392728354.git.gamerh2o@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gang ZHAO Feb. 18, 2014, 1:36 p.m. UTC
Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more
generic ieee80211_{channel_to_frequency, frequency_to_channel}.

File <net/cfg80211.h> has already been included. It's safe to use
IEEE80211_BAND_2GHZ here.

This change is a preparation for the removal of function
ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
---
 drivers/net/wireless/orinoco/cfg.c  | 4 ++--
 drivers/net/wireless/orinoco/hw.c   | 2 +-
 drivers/net/wireless/orinoco/scan.c | 5 +++--
 drivers/net/wireless/orinoco/wext.c | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

Comments

Dave Feb. 19, 2014, 8:33 a.m. UTC | #1
On 18/02/2014 13:36, Zhao, Gang wrote:
> Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more
> generic ieee80211_{channel_to_frequency, frequency_to_channel}.
>
> File <net/cfg80211.h> has already been included. It's safe to use
> IEEE80211_BAND_2GHZ here.
>
> This change is a preparation for the removal of function
> ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.
>
> Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
> ---
>   drivers/net/wireless/orinoco/cfg.c  | 4 ++--
>   drivers/net/wireless/orinoco/hw.c   | 2 +-
>   drivers/net/wireless/orinoco/scan.c | 5 +++--
>   drivers/net/wireless/orinoco/wext.c | 2 +-
>   4 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c
> index d01edd2..c5ef3ab 100644
> --- a/drivers/net/wireless/orinoco/cfg.c
> +++ b/drivers/net/wireless/orinoco/cfg.c
> @@ -59,7 +59,7 @@ int orinoco_wiphy_register(struct wiphy *wiphy)
>   	for (i = 0; i < NUM_CHANNELS; i++) {
>   		if (priv->channel_mask & (1 << i)) {
>   			priv->channels[i].center_freq =
> -				ieee80211_dsss_chan_to_freq(i + 1);
> +		     ieee80211_channel_to_frequency(i + 1, IEEE80211_BAND_2GHZ);
>   			channels++;
>   		}
Can you tweak that indentation so that it doesn't unindent here. If it 
has to be on one line I'd prefer to exceed 80 chars than back indent.


Thanks,

Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c
index d01edd2..c5ef3ab 100644
--- a/drivers/net/wireless/orinoco/cfg.c
+++ b/drivers/net/wireless/orinoco/cfg.c
@@ -59,7 +59,7 @@  int orinoco_wiphy_register(struct wiphy *wiphy)
 	for (i = 0; i < NUM_CHANNELS; i++) {
 		if (priv->channel_mask & (1 << i)) {
 			priv->channels[i].center_freq =
-				ieee80211_dsss_chan_to_freq(i + 1);
+		     ieee80211_channel_to_frequency(i + 1, IEEE80211_BAND_2GHZ);
 			channels++;
 		}
 	}
@@ -177,7 +177,7 @@  static int orinoco_set_monitor_channel(struct wiphy *wiphy,
 	if (chandef->chan->band != IEEE80211_BAND_2GHZ)
 		return -EINVAL;
 
-	channel = ieee80211_freq_to_dsss_chan(chandef->chan->center_freq);
+	channel = ieee80211_frequency_to_channel(chandef->chan->center_freq);
 
 	if ((channel < 1) || (channel > NUM_CHANNELS) ||
 	     !(priv->channel_mask & (1 << (channel - 1))))
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c
index c09c843..49300d0 100644
--- a/drivers/net/wireless/orinoco/hw.c
+++ b/drivers/net/wireless/orinoco/hw.c
@@ -1193,7 +1193,7 @@  int orinoco_hw_get_freq(struct orinoco_private *priv)
 		goto out;
 
 	}
-	freq = ieee80211_dsss_chan_to_freq(channel);
+	freq = ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ);
 
  out:
 	orinoco_unlock(priv, &flags);
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c
index e8c5714..e175b9b 100644
--- a/drivers/net/wireless/orinoco/scan.c
+++ b/drivers/net/wireless/orinoco/scan.c
@@ -110,7 +110,8 @@  static void orinoco_add_hostscan_result(struct orinoco_private *priv,
 		break;
 	}
 
-	freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel));
+	freq = ieee80211_channel_to_frequency(
+		le16_to_cpu(bss->a.channel), IEEE80211_BAND_2GHZ);
 	channel = ieee80211_get_channel(wiphy, freq);
 	if (!channel) {
 		printk(KERN_DEBUG "Invalid channel designation %04X(%04X)",
@@ -146,7 +147,7 @@  void orinoco_add_extscan_result(struct orinoco_private *priv,
 	ie_len = len - sizeof(*bss);
 	ie = cfg80211_find_ie(WLAN_EID_DS_PARAMS, bss->data, ie_len);
 	chan = ie ? ie[2] : 0;
-	freq = ieee80211_dsss_chan_to_freq(chan);
+	freq = ieee80211_channel_to_frequency(chan, IEEE80211_BAND_2GHZ);
 	channel = ieee80211_get_channel(wiphy, freq);
 
 	timestamp = le64_to_cpu(bss->timestamp);
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c
index 3b5508f..b7a867b 100644
--- a/drivers/net/wireless/orinoco/wext.c
+++ b/drivers/net/wireless/orinoco/wext.c
@@ -444,7 +444,7 @@  static int orinoco_ioctl_setfreq(struct net_device *dev,
 		for (i = 0; i < (6 - frq->e); i++)
 			denom *= 10;
 
-		chan = ieee80211_freq_to_dsss_chan(frq->m / denom);
+		chan = ieee80211_frequency_to_channel(frq->m / denom);
 	}
 
 	if ((chan < 1) || (chan > NUM_CHANNELS) ||