]> git.hungrycats.org Git - linux/commitdiff
b43: Fix Bugzilla #14181 and the bug from the previous 'fix'
authorLarry Finger <Larry.Finger@lwfinger.net>
Fri, 16 Oct 2009 15:18:09 +0000 (10:18 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:51:53 +0000 (16:51 -0800)
commit d50bae33d1358b909ade05ae121d83d3a60ab63f upstream.

"b43: Fix PPC crash in rfkill polling on unload" fixed the bug reported
in Bugzilla No. 14181; however, it introduced a new bug. Whenever the
radio switch was turned off, it was necessary to unload and reload
the driver for it to recognize the switch again.

This patch fixes both the original bug in #14181 and the bug introduced by
the previous patch. It must be stated, however, that if there is a BCM4306/3
with an rfkill switch (not yet proven), then the driver will need an
unload/reload cycle to turn the device back on.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/b43/rfkill.c

index 34ae125d5384dadf769b0134aa0a878af471fc17..f9c355ec65d0d9bbc619914c367d083355c9da55 100644 (file)
@@ -36,7 +36,8 @@ static bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
                      & B43_MMIO_RADIO_HWENABLED_HI_MASK))
                        return 1;
        } else {
-               if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
+               if (b43_status(dev) >= B43_STAT_STARTED &&
+                   b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
                    & B43_MMIO_RADIO_HWENABLED_LO_MASK)
                        return 1;
        }