Re: [RFC] b43: A patch for control of the radio LED using rfkill
From: Ivo van Doorn <hidden>
Date: 2008-09-18 13:19:17
Hi,
quoted hunk ↗ jump to hunk
@@ -60,18 +58,40 @@ static void b43_rfkill_poll(struct input enabled = b43_is_hw_radio_enabled(dev); if (unlikely(enabled != dev->radio_hw_enable)) { dev->radio_hw_enable = enabled; - report_change = 1; b43info(wl, "Radio hardware status changed to %s\n", enabled ? "ENABLED" : "DISABLED"); + if (!enabled) + rfkill_force_state(rfk->rfkill, + RFKILL_STATE_HARD_BLOCKED); + else { + if (!dev->phy.radio_on) + rfkill_force_state(rfk->rfkill, + RFKILL_STATE_SOFT_BLOCKED); + else + rfkill_force_state(rfk->rfkill, + RFKILL_STATE_UNBLOCKED); + }
Is dev->phy.radio_on set when mac80211 has send an instruction to the driver to enable the radio (start() or config() callback) or does it represent the key state in the hardware? If it is something coming from mac80211, then you do not want to send a SOFT_BLOCKED event since that will cause all other radios to be switched off simply because the b43 interface has not been enabled. Off course when it represents the key state in the hardware then the code would be fine... Ivo