- struct b43legacy_rfkill *rfk = container_of(work,
- struct b43legacy_rfkill,
- notify_work);
- struct b43legacy_wl *wl = container_of(rfk, struct b43legacy_wl,
- rfkill);
- struct b43legacy_wldev *dev;
- enum rfkill_state state;
-
- mutex_lock(&wl->mutex);
- dev = wl->current_dev;
- if (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED) {
- mutex_unlock(&wl->mutex);
- return;
- }
- if (dev->radio_hw_enable)
- state = RFKILL_STATE_ON;
- else
- state = RFKILL_STATE_OFF;
- b43legacyinfo(wl, "Radio hardware status changed to %s\n",
- dev->radio_hw_enable ? "ENABLED" : "DISABLED");
- mutex_unlock(&wl->mutex);
-
- if (rfk->rfkill) {
- /* Be careful. This calls back into the software toggle
- * routines. So we must unlock before calling. */
- rfkill_switch_all(rfk->rfkill->type, state);
+ if (dev->phy.rev >= 3) {
+ if (!(b43legacy_read32(dev, B43legacy_MMIO_RADIO_HWENABLED_HI)
+ & B43legacy_MMIO_RADIO_HWENABLED_HI_MASK))
+ return 1;
+ } else {
+ if (b43legacy_read16(dev, B43legacy_MMIO_RADIO_HWENABLED_LO)
+ & B43legacy_MMIO_RADIO_HWENABLED_LO_MASK)
+ return 1;