]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/b43/main.c
Merge branch 'isdn-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / b43 / main.c
index 1aa0f727174b719cc5e6552e077afe6b706c6f75..943cc851c5043152d8ff521e18cc5a792da5fcad 100644 (file)
@@ -2343,6 +2343,13 @@ static void b43_mac_suspend(struct b43_wldev *dev)
                            & ~B43_MACCTL_ENABLED);
                /* force pci to flush the write */
                b43_read32(dev, B43_MMIO_MACCTL);
+               for (i = 35; i; i--) {
+                       tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON);
+                       if (tmp & B43_IRQ_MAC_SUSPENDED)
+                               goto out;
+                       udelay(10);
+               }
+               /* Hm, it seems this will take some time. Use msleep(). */
                for (i = 40; i; i--) {
                        tmp = b43_read32(dev, B43_MMIO_GEN_IRQ_REASON);
                        if (tmp & B43_IRQ_MAC_SUSPENDED)
@@ -2797,10 +2804,10 @@ static int b43_rng_read(struct hwrng *rng, u32 * data)
        return (sizeof(u16));
 }
 
-static void b43_rng_exit(struct b43_wl *wl, bool suspended)
+static void b43_rng_exit(struct b43_wl *wl)
 {
        if (wl->rng_initialized)
-               __hwrng_unregister(&wl->rng, suspended);
+               hwrng_unregister(&wl->rng);
 }
 
 static int b43_rng_init(struct b43_wl *wl)
@@ -3771,7 +3778,7 @@ static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle)
                pu_delay = 3700;
        else
                pu_delay = 1050;
-       if ((dev->wl->if_type == IEEE80211_IF_TYPE_IBSS) || idle)
+       if (b43_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS) || idle)
                pu_delay = 500;
        if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8))
                pu_delay = max(pu_delay, (u16)2400);
@@ -3785,7 +3792,7 @@ static void b43_set_pretbtt(struct b43_wldev *dev)
        u16 pretbtt;
 
        /* The time value is in microseconds. */
-       if (dev->wl->if_type == IEEE80211_IF_TYPE_IBSS) {
+       if (b43_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) {
                pretbtt = 2;
        } else {
                if (dev->phy.type == B43_PHYTYPE_A)
@@ -3817,7 +3824,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
 
        if (!dev->suspend_in_progress) {
                b43_leds_exit(dev);
-               b43_rng_exit(dev->wl, false);
+               b43_rng_exit(dev->wl);
        }
        b43_dma_free(dev);
        b43_pio_free(dev);
@@ -4582,7 +4589,7 @@ static int b43_resume(struct ssb_device *dev)
                err = b43_wireless_core_start(wldev);
                if (err) {
                        b43_leds_exit(wldev);
-                       b43_rng_exit(wldev->wl, true);
+                       b43_rng_exit(wldev->wl);
                        b43_wireless_core_exit(wldev);
                        b43err(wl, "Resume failed at core start\n");
                        goto out;