]> bbs.cooldavid.org Git - net-next-2.6.git/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)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:29:46 +0000 (16:29 -0400)
"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>
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43/rfkill.c

index df6b26a0c05ed47d356a4a38e58891ba08acff02..86f35827f0085a19d01d94624c4f2aee3603df3f 100644 (file)
@@ -4501,7 +4501,6 @@ static void b43_op_stop(struct ieee80211_hw *hw)
 
        cancel_work_sync(&(wl->beacon_update_trigger));
 
-       wiphy_rfkill_stop_polling(hw->wiphy);
        mutex_lock(&wl->mutex);
        if (b43_status(dev) >= B43_STAT_STARTED) {
                dev = b43_wireless_core_stop(dev);
index 7a3218c5ba7dd69085afbddd65d38d6d40a08b08..ffdce6f3c90922179e4d21df0acab33f9e9ded0e 100644 (file)
@@ -33,7 +33,8 @@ 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;
        }