diff options
Diffstat (limited to 'drivers/net/wireless/b43/rfkill.c')
-rw-r--r-- | drivers/net/wireless/b43/rfkill.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index 78016ae21c50..a617efe38289 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
@@ -28,23 +28,8 @@ | |||
28 | /* Returns TRUE, if the radio is enabled in hardware. */ | 28 | /* Returns TRUE, if the radio is enabled in hardware. */ |
29 | bool b43_is_hw_radio_enabled(struct b43_wldev *dev) | 29 | bool b43_is_hw_radio_enabled(struct b43_wldev *dev) |
30 | { | 30 | { |
31 | if (dev->phy.rev >= 3 || dev->phy.type == B43_PHYTYPE_LP) { | 31 | return !(b43_read32(dev, B43_MMIO_RADIO_HWENABLED_HI) |
32 | if (!(b43_read32(dev, B43_MMIO_RADIO_HWENABLED_HI) | 32 | & B43_MMIO_RADIO_HWENABLED_HI_MASK); |
33 | & B43_MMIO_RADIO_HWENABLED_HI_MASK)) | ||
34 | return 1; | ||
35 | } else { | ||
36 | /* To prevent CPU fault on PPC, do not read a register | ||
37 | * unless the interface is started; however, on resume | ||
38 | * for hibernation, this routine is entered early. When | ||
39 | * that happens, unconditionally return TRUE. | ||
40 | */ | ||
41 | if (b43_status(dev) < B43_STAT_STARTED) | ||
42 | return 1; | ||
43 | if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO) | ||
44 | & B43_MMIO_RADIO_HWENABLED_LO_MASK) | ||
45 | return 1; | ||
46 | } | ||
47 | return 0; | ||
48 | } | 33 | } |
49 | 34 | ||
50 | /* The poll callback for the hardware button. */ | 35 | /* The poll callback for the hardware button. */ |
@@ -52,7 +37,7 @@ void b43_rfkill_poll(struct ieee80211_hw *hw) | |||
52 | { | 37 | { |
53 | struct b43_wl *wl = hw_to_b43_wl(hw); | 38 | struct b43_wl *wl = hw_to_b43_wl(hw); |
54 | struct b43_wldev *dev = wl->current_dev; | 39 | struct b43_wldev *dev = wl->current_dev; |
55 | struct ssb_bus *bus = dev->dev->bus; | 40 | struct ssb_bus *bus = dev->sdev->bus; |
56 | bool enabled; | 41 | bool enabled; |
57 | bool brought_up = false; | 42 | bool brought_up = false; |
58 | 43 | ||
@@ -62,7 +47,7 @@ void b43_rfkill_poll(struct ieee80211_hw *hw) | |||
62 | mutex_unlock(&wl->mutex); | 47 | mutex_unlock(&wl->mutex); |
63 | return; | 48 | return; |
64 | } | 49 | } |
65 | ssb_device_enable(dev->dev, 0); | 50 | ssb_device_enable(dev->sdev, 0); |
66 | brought_up = true; | 51 | brought_up = true; |
67 | } | 52 | } |
68 | 53 | ||
@@ -78,7 +63,7 @@ void b43_rfkill_poll(struct ieee80211_hw *hw) | |||
78 | } | 63 | } |
79 | 64 | ||
80 | if (brought_up) { | 65 | if (brought_up) { |
81 | ssb_device_disable(dev->dev, 0); | 66 | ssb_device_disable(dev->sdev, 0); |
82 | ssb_bus_may_powerdown(bus); | 67 | ssb_bus_may_powerdown(bus); |
83 | } | 68 | } |
84 | 69 | ||