Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
[sfrench/cifs-2.6.git] / drivers / net / wireless / b43 / phy_common.c
index 026b61c03fb9fb4432492bc8ddad32a617d72b6a..e176b6e0d9cf08f26dae49baa5b0d729ad13db1d 100644 (file)
@@ -131,12 +131,16 @@ void b43_radio_lock(struct b43_wldev *dev)
 {
        u32 macctl;
 
+#if B43_DEBUG
+       B43_WARN_ON(dev->phy.radio_locked);
+       dev->phy.radio_locked = 1;
+#endif
+
        macctl = b43_read32(dev, B43_MMIO_MACCTL);
-       B43_WARN_ON(macctl & B43_MACCTL_RADIOLOCK);
        macctl |= B43_MACCTL_RADIOLOCK;
        b43_write32(dev, B43_MMIO_MACCTL, macctl);
-       /* Commit the write and wait for the device
-        * to exit any radio register access. */
+       /* Commit the write and wait for the firmware
+        * to finish any radio register access. */
        b43_read32(dev, B43_MMIO_MACCTL);
        udelay(10);
 }
@@ -145,11 +149,15 @@ void b43_radio_unlock(struct b43_wldev *dev)
 {
        u32 macctl;
 
+#if B43_DEBUG
+       B43_WARN_ON(!dev->phy.radio_locked);
+       dev->phy.radio_locked = 0;
+#endif
+
        /* Commit any write */
        b43_read16(dev, B43_MMIO_PHY_VER);
        /* unlock */
        macctl = b43_read32(dev, B43_MMIO_MACCTL);
-       B43_WARN_ON(!(macctl & B43_MACCTL_RADIOLOCK));
        macctl &= ~B43_MACCTL_RADIOLOCK;
        b43_write32(dev, B43_MMIO_MACCTL, macctl);
 }