Date: Wed, 24 Jun 2009 08:53:15 +0200 From: "Paul B. Mahol" <onemda@gmail.com> To: Michael <freebsdusb@bindone.de> Cc: freebsd-acpi@freebsd.org Subject: Re: Two new acpi modules, acpi_wmi and acpi_hp Message-ID: <3a142e750906232353g37b5f001p89948a2fe6a3e66e@mail.gmail.com> In-Reply-To: <4A41C2CF.4020205@bindone.de> References: <4A3E1784.2050406@bindone.de> <3a142e750906232257y4b1e255en9374c05079f04520@mail.gmail.com> <4A41C2CF.4020205@bindone.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/24/09, Michael <freebsdusb@bindone.de> wrote: > Paul B. Mahol wrote: >> On 6/21/09, Michael <freebsdusb@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. >> > What does cat /dev/hpcmi show on your system? > Did you try modifying dev.acpi_hp.0.cmi_detail (see man acpi_hp(4))? > What is in /var/log/messages when loading the driver? > 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} 41 NO NO NO NO BC {988D08E3-68F4-4C35-AF3E-6A1B8106F83C} 14 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 > cat /dev/hpcmi Serial Port Infrared Port Parallel Port Flash Media Reader USB Ports 1394 Port Cardbus Slot Express Card Slot F9, F10 and F12 Delay(Sec) Multiboot Express Boot Popup Delay(Sec) CD-ROM Boot Floppy Boot Internal Network Adapter Boot Internal Network Adapter Boot Mode Swap Fn/Ctrl Key HDD Translation Mode Virtualization Technology USB Legacy Support Parallel Port Mode BIOS DMA Data Transfers Fan Always on while on AC Power Data Execution Prevention LAN Power Saving SATA Native Mode Dual Core CPU Secondary Battery Fast Charge Embedded WLAN Device Radio Embedded WWAN Device Radio Ambient Light Sensor Embedded Bluetooth Device Radio LAN/WLAN Switching Wake on LAN acpi_wmi0: <ACPI-WMI mapping> on acpi0 acpi_hp0: <HP ACPI-WMI Mapping> on acpi0 acpi_hp0: HP event GUID detected, installing event handler acpi_hp0: HP CMI GUID detected acpi_wmi0: Wireless status is c0a0f2b acpi_wmi0: WLAN on air changed to 1 (new_wlan_status is 256) acpi_wmi0: Wireless status is c02062b acpi_wmi0: WLAN on air changed to 0 (new_wlan_status is 0) acpi_wmi0: Wireless status is c0a0f2b acpi_wmi0: WLAN on air changed to 1 (new_wlan_status is 256) ACPI Error: Field [C2CA] at 336 exceeds Buffer [C281] size 328 (bits) 20090521 dsopcode-697 ACPI Error (psparse-0633): Method parse/execution failed [\\_SB_.C241.WQBC] (Node 0xc3dceb20), AE_AML_BUFFER_LIMIT -- Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a142e750906232353g37b5f001p89948a2fe6a3e66e>