b43: check band width
authorRafał Miłecki <zajec5@gmail.com>
Fri, 22 Jan 2010 00:53:12 +0000 (01:53 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 22 Jan 2010 21:11:34 +0000 (16:11 -0500)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/phy_common.h
drivers/net/wireless/b43/phy_n.c

index c699e46534dcd672c00c725f5dfc89334ebac75d..6d7cf3c2f7bf17b1fb6d30b8d05a01c620ff2dfc 100644 (file)
@@ -3576,6 +3576,12 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
        dev = wl->current_dev;
        phy = &dev->phy;
 
+       if (conf_is_ht(conf))
+               phy->is_40mhz =
+                       (conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf));
+       else
+               phy->is_40mhz = false;
+
        b43_mac_suspend(dev);
 
        if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
index 9edd4e8e0c857658a04dd6068375fe956e75874d..f635f9e4f83d60d950a2eceacb1cb3bc0c81a1b3 100644 (file)
@@ -212,6 +212,9 @@ struct b43_phy {
        bool supports_2ghz;
        bool supports_5ghz;
 
+       /* HT info */
+       bool is_40mhz;
+
        /* GMODE bit enabled? */
        bool gmode;
 
index e77f1f24d101a3db2122195c54b18bee58ea3372..2cdf32e5fd9b2797a22f9bedf3389a223abeaeae 100644 (file)
@@ -1787,7 +1787,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
 
        b43_phy_write(dev, B43_NPHY_IQLOCAL_CMDGCTL, 0x8AA9);
 
-       if (1 /* FIXME: the band width is 20 MHz */)
+       if (!dev->phy.is_40mhz)
                freq = 2500;
        else
                freq = 5000;