Two new acpi modules, acpi_wmi and acpi_hp
Paul B. Mahol
onemda at gmail.com
Wed Jun 24 06:21:33 UTC 2009
On 6/21/09, Michael <freebsdusb at bindone.de> wrote:
> Hello,
>
> I wrote two new acpi modules last year and finally found the time to fix
> them, add some missing features and write man pages.
>
> This is the first time I'm writing kernel code for FreeBSD, so please
> excuse me if I failed to apply to all style conventions (I tried to
> follow style(9) as closely as possible).
>
> acpi_wmi is an ACPI to WMI mapping driver (this is used by HP and Acer
> notebooks and potentially others), so this could also be used to
> implement additional drivers on (see for more details on WMI and ACPI:
> http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx).
> It provides /dev/wmistat, example output:
> cat /dev/wmistat
> GUID INST EXPE METH STR EVENT OID
> {5FB7F034-2C63-45E9-BE91-3D44E2C707E4} 1 NO WMAA NO NO AA
> {95F24279-4D7B-4334-9387-ACCDC67EF61C} 1 NO NO NO 0x80+ -
> {2B814318-4BE8-4707-9D84-A190A859B5D0} 1 NO NO NO 0xA0 -
> {05901221-D566-11D1-B2F0-00A0C9062910} 1 NO NO NO NO AB
> {1F4C91EB-DC5C-460B-951D-C7CB9B4B8D5E} 1 NO WMBA NO NO BA
> {2D114B49-2DFB-4130-B8FE-4A3C09E75133} 57 NO NO NO NO BC
> {988D08E3-68F4-4C35-AF3E-6A1B8106F83C} 20 NO NO NO NO BD
> {14EA9746-CE1F-4098-A0E0-7045CB4DA745} 1 NO NO NO NO BE
> {322F2028-0F84-4901-988E-015176049E2D} 2 NO NO NO NO BF
> {8232DE3D-663D-4327-A8F4-E293ADB9BF05} 0 NO NO NO NO BG
> {8F1F6436-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BH
> {8F1F6435-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BI
>
> acpi_hp is a driver that uses acpi_wmi to provide HP specific features.
> These include:
> - Activate/deactivate WLAN
> - Activate/deactivate WWAN
> - Activate/deactivate Bluetooth
> - Auto activate/deactiavte based on hw radio status
> - Devd notifications
> - On air status for different
> - Controls ambient light sensor
> - Get docking status
> - Read BIOS settings through /dev/hpcmi, example output:
> Flash Media Reader Disable
> USB Ports including Express Card slot Enable
> 1394 Port Enable
> Cardbus Slot Disable
> Express Card Slot Disable
> F9, F10 and F12 Delay(Sec) 0
> USB Device Detection Delay (Sec) 0
> Multiboot Enable
> Express Boot Popup Delay(Sec) 0
> CD-ROM Boot Enable
> Floppy Boot Disable
> Internal Network Adapter Boot Disable
> Internal Network Adapter Boot Mode PXE
> Swap Fn/Ctrl Key Disable
> USB Legacy Support Disable
> Parallel Port Mode ECP
> ...
>
> The man pages included in the patch (man acpi_hp / man acpi_wmi) give
> you detailed information about all sysctls and devices.
>
> The patch attached (acpi_wmi_and_acpi_hp.patch) has been tested against
> 7.2-RELEASE and everything compiles cleanly, although my tests have been
> on 8-CURRENT (but the snapshot is older than 7.2), so I expect this to
> work ok on 7.2. The patch might fail against CURRENT though, this is why
> I also attached patches.tgz, which contains individual patches per file.
> I only tested this on i386 and the patch only changes i386 specific
> things (I have no idea if this could possibly work on amd64, especially
> because all the other acpi_support modules seem to be i386 only). Also
> note, that I could only test this on my own machine (HP Compaq 8510p),
> which features WLAN/BT/WLAN, so I don't know if the readings will be
> sane if your machine doesn't feature a WWAN chip. In theory this should
> work for many different HP models.
>
> Installation instructions (replace MYKERNEL with your kernel name):
>
> mkdir /usr/src/sys/modules/acpi/acpi_wmi
> mkdir /usr/src/sys/modules/acpi/acpi_hp
> patch -d /usr/src < acpi_wmi_and_acpi_hp.patch
> cd /usr/src/share/man/man4/man4.i386
> make all && make install
> cd /usr/src/sys/i386/conf
> config MYKERNEL
> cd ../compile/MYKERNEL
> make cleandepend && make depend
> make all
> make install
> reboot
> .
> .
> .
> kldload acpi_hp
> cat /dev/wmistat
> sysctl -a | grep acpi_hp.0
> sysctl dev.acpi_hp.0.als = 0
> cat /dev/hpcmi
> sysctl dev.acpi_hp.0.cmi_detail=7
> cat /dev/hpcmi
>
> It would be nice to get some feedback on this and maybe someone else can
> implement vendor specific ACPI modules for other WMI based laptops now.
I tested committed version on 8.0.
What about making following verbose device_printfs optional:
Wireless status is 0xXXXX , (new_wlan_status is 0xXXXX),
(new_wwan_status is 0xXXXX)
# cat /dev/hpcmi
doesn't show Enabled/Disabled/Values.
--
Paul
More information about the freebsd-acpi
mailing list