Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d632f9fa38203ad5bac31e46921812216693b14f
Commit:     d632f9fa38203ad5bac31e46921812216693b14f
Parent:     01a597769c7ef4db979c6a23aa97e5d2e53cbc46
Author:     Joerg Sommer <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 2 12:32:06 2007 -0600
Committer:  John W. Linville <[EMAIL PROTECTED]>
CommitDate: Wed Mar 7 22:13:50 2007 -0500

    [PATCH] bcm43xx: Fix bug in frequency to channel conversion
    
    The frequency to channel routine in bcm43xx requires that the frequency
    be in MHz, but that condition is not always met. This patch does the
    necessary conversion.
    
    Signed-off-by: Joerg Sommer <[EMAIL PROTECTED]>
    Signed-off-by: Larry Finger <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/bcm43xx/bcm43xx_wx.c |   10 ++++++++--
 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 7b665e2..d6d9413 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,
        struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
        unsigned long flags;
        u8 channel;
+       s8 expon;
        int freq;
        int err = -EINVAL;
 
        mutex_lock(&bcm->mutex);
        spin_lock_irqsave(&bcm->irq_lock, flags);
 
-       if ((data->freq.m >= 0) && (data->freq.m <= 1000)) {
+       if ((data->freq.e == 0) &&
+           (data->freq.m >= 0) && (data->freq.m <= 1000)) {
                channel = data->freq.m;
                freq = bcm43xx_channel_to_freq(bcm, channel);
        } else {
-               channel = bcm43xx_freq_to_channel(bcm, data->freq.m);
                freq = data->freq.m;
+               expon = 6 - data->freq.e;
+               while (--expon >= 0)    /* scale down the frequency to MHz */
+                       freq /= 10;
+               assert(freq > 1000);
+               channel = bcm43xx_freq_to_channel(bcm, freq);
        }
        if (!ieee80211_is_valid_channel(bcm->ieee, channel))
                goto out_unlock;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to