[RFT] hp-wmi: improved rfkill support for wifi

From: Alan Jenkins
Date: Sat Jul 18 2009 - 12:55:41 EST


I borrowed a HP G7000 last week. The hp-wmi driver seemed a bit
confused about hard v.s. soft blocks on the wifi, so I fixed it based on
acpidump output [1]. I hope this will work on other HP model numbers,
but it would benefit from testing. Any volunteers?

The wireless is toggled by a hardware button. If your laptop is the
same, you should see a "2" in the output of "cat
/sys/class/rfkill/rfkill*/state" when the wireless is disabled. "1"
means enabled, and "0" means "disabled by software". Without this
patch, the driver would wrongly show "0" when the wireless was disabled
by the hardware button.

There are some other side-effects which the patch should fix. I think
it should improve behaviour when you disable the wireless and reboot
into Windows, or vice versa. Without the patch, it seemed that hp-wmi
would leave a "soft block" without being asked to. After disabling the
wireless and rebooting into Windows, pressing the wireless button failed
to re-enable it. Instead, the HP Wireless Assistant popup toggled
between "wireless disabled" and "wireless off".

[1] HP G7000 acpidump.out
<http://bugzilla.kernel.org/show_bug.cgi?id=13745#c1>

Thanks
Alan

----->