Hi Matthew, 於 三,2010-04-28 於 22:43 +0100,Matthew Garrett 提到: > On Thu, Apr 29, 2010 at 05:40:34AM +0800, joeyli wrote: > > > It causes userland application (e.g. OSD) need wait 5 seconds safely > > time before show up OSD when user press wifi/bluetooth function key. > > Why rfkill interface doesn't have show() hook can modify the rfkill > > state immediately, don't need wait 5 seconds? > > Because that implies that userspace has to poll the device in order to > get any updates. The intention is that the rfkill interface be event > driven. Is there no way to get an event in the driver when the switch > status is changed? See dell-laptop.c and hp-wmi.c for examples of this. > Yes, I saw the hp-wmi.c do that: } else if (eventcode == 0x5) { if (wifi_rfkill) rfkill_set_sw_state(wifi_rfkill, hp_wmi_wifi_state()); if (bluetooth_rfkill) rfkill_set_sw_state(bluetooth_rfkill, hp_wmi_bluetooth_state()); if (wwan_rfkill) rfkill_set_sw_state(wwan_rfkill, hp_wmi_wwan_state()); } else And I want do the same thing in msi-laptop driver, but MSI BIOS send keycode but not wmi event. So, I think I will reference the rfkill-input.c to add a simply input handler to msi-laptop driver. When it capture the RFKILL_TYPE_WLAN/RFKILL_TYPE_BLUETOOTH, it will query the -REAL- hardware block then update rfkill state. Do you think it's good? Thank's Joey Lee -- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html