b43: set TMS to work with current band width for N-PHY
authorRafał Miłecki <zajec5@gmail.com>
Tue, 7 Dec 2010 20:55:58 +0000 (21:55 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 8 Dec 2010 20:38:45 +0000 (15:38 -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.c
drivers/net/wireless/b43/phy_common.h
drivers/net/wireless/b43/phy_n.c

index fa4880366586a554bef9757b8677fded2477cd7f..670fd7b782e2360a8c0fa79299a8badb37454708 100644 (file)
@@ -1150,6 +1150,12 @@ void b43_wireless_core_reset(struct b43_wldev *dev, u32 flags)
 
        flags |= B43_TMSLOW_PHYCLKEN;
        flags |= B43_TMSLOW_PHYRESET;
+       if (dev->phy.type == B43_PHYTYPE_N) {
+               if (b43_channel_type_is_40mhz(dev->phy.channel_type))
+                       flags |= B43_TMSLOW_PHYCLKSPEED_160MHZ;
+               else
+                       flags |= B43_TMSLOW_PHYCLKSPEED_80MHZ;
+       }
        ssb_device_enable(dev->dev, flags);
        msleep(2);              /* Wait for the PLL to turn on. */
 
index 0a91fc3a2e03a8a4ac524cd11df3e84151bf4a25..412f1b64cc8230821f8de0405392e259410cdff7 100644 (file)
@@ -429,6 +429,13 @@ void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on)
        b43_write16(dev, B43_MMIO_PHY0, on ? 0 : 0xF4);
 }
 
+
+bool b43_channel_type_is_40mhz(enum nl80211_channel_type channel_type)
+{
+       return (channel_type == NL80211_CHAN_HT40MINUS ||
+               channel_type == NL80211_CHAN_HT40PLUS);
+}
+
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/Cordic */
 struct b43_c32 b43_cordic(int theta)
 {
index 2ed60e5484b6d514ee5d4c609d8dc6e9ca0609d6..2401bee8b0819476717ad567ea627f8cdc082af3 100644 (file)
@@ -436,6 +436,8 @@ int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 shm_offset);
  */
 void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on);
 
+bool b43_channel_type_is_40mhz(enum nl80211_channel_type channel_type);
+
 struct b43_c32 b43_cordic(int theta);
 
 #endif /* LINUX_B43_PHY_COMMON_H_ */
index d41da7f5584a4a132b5f0d74893cb683969df068..35173419d139719f0d69a47cf77c63dfcc2d550c 100644 (file)
@@ -88,13 +88,6 @@ static void b43_nphy_rf_control_override(struct b43_wldev *dev, u16 field,
 static void b43_nphy_rf_control_intc_override(struct b43_wldev *dev, u8 field,
                                                u16 value, u8 core);
 
-static inline bool b43_channel_type_is_40mhz(
-                                       enum nl80211_channel_type channel_type)
-{
-       return (channel_type == NL80211_CHAN_HT40MINUS ||
-               channel_type == NL80211_CHAN_HT40PLUS);
-}
-
 void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
 {//TODO
 }