aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_wx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
index 7b665e2386a8..d6d9413d7f23 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c
@@ -105,18 +105,24 @@ static int bcm43xx_wx_set_channelfreq(struct net_device *net_dev,
105 struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); 105 struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
106 unsigned long flags; 106 unsigned long flags;
107 u8 channel; 107 u8 channel;
108 s8 expon;
108 int freq; 109 int freq;
109 int err = -EINVAL; 110 int err = -EINVAL;
110 111
111 mutex_lock(&bcm->mutex); 112 mutex_lock(&bcm->mutex);
112 spin_lock_irqsave(&bcm->irq_lock, flags); 113 spin_lock_irqsave(&bcm->irq_lock, flags);
113 114
114 if ((data->freq.m >= 0) && (data->freq.m <= 1000)) { 115 if ((data->freq.e == 0) &&
116 (data->freq.m >= 0) && (data->freq.m <= 1000)) {
115 channel = data->freq.m; 117 channel = data->freq.m;
116 freq = bcm43xx_channel_to_freq(bcm, channel); 118 freq = bcm43xx_channel_to_freq(bcm, channel);
117 } else { 119 } else {
118 channel = bcm43xx_freq_to_channel(bcm, data->freq.m);
119 freq = data->freq.m; 120 freq = data->freq.m;
121 expon = 6 - data->freq.e;
122 while (--expon >= 0) /* scale down the frequency to MHz */
123 freq /= 10;
124 assert(freq > 1000);
125 channel = bcm43xx_freq_to_channel(bcm, freq);
120 } 126 }
121 if (!ieee80211_is_valid_channel(bcm->ieee, channel)) 127 if (!ieee80211_is_valid_channel(bcm->ieee, channel))
122 goto out_unlock; 128 goto out_unlock;