]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/b43/phy_common.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / net / wireless / b43 / phy_common.c
index 7b2ea67814574152009f654c60c7a60771d7d189..b5c5ce94d3fd8607c9d06b20d351cd8345a3c7b0 100644 (file)
@@ -50,7 +50,7 @@ int b43_phy_allocate(struct b43_wldev *dev)
                phy->ops = &b43_phyops_g;
                break;
        case B43_PHYTYPE_N:
-#ifdef CONFIG_B43_NPHY
+#ifdef CONFIG_B43_PHY_N
                phy->ops = &b43_phyops_n;
 #endif
                break;
@@ -231,6 +231,7 @@ void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set)
 u16 b43_phy_read(struct b43_wldev *dev, u16 reg)
 {
        assert_mac_suspended(dev);
+       dev->phy.writes_counter = 0;
        return dev->phy.ops->phy_read(dev, reg);
 }
 
@@ -238,6 +239,10 @@ void b43_phy_write(struct b43_wldev *dev, u16 reg, u16 value)
 {
        assert_mac_suspended(dev);
        dev->phy.ops->phy_write(dev, reg, value);
+       if (++dev->phy.writes_counter == B43_MAX_WRITES_IN_ROW) {
+               b43_read16(dev, B43_MMIO_PHY_VER);
+               dev->phy.writes_counter = 0;
+       }
 }
 
 void b43_phy_copy(struct b43_wldev *dev, u16 destreg, u16 srcreg)
@@ -424,12 +429,21 @@ 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)
 {
-       u32 arctg[] = { 2949120, 1740967, 919879, 466945, 234379, 117304,
-                     58666, 29335, 14668, 7334, 3667, 1833, 917, 458,
-                     229, 115, 57, 29, };
+       static const u32 arctg[] = {
+               2949120, 1740967, 919879, 466945, 234379, 117304,
+                 58666,   29335,  14668,   7334,   3667,   1833,
+                   917,     458,    229,    115,     57,     29,
+       };
        u8 i;
        s32 tmp;
        s8 signx = 1;