From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 24 06:21:32 2009 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D09C81065673; Wed, 24 Jun 2009 06:21:32 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-bw0-f209.google.com (mail-bw0-f209.google.com [209.85.218.209]) by mx1.freebsd.org (Postfix) with ESMTP id 24CBD8FC19; Wed, 24 Jun 2009 06:21:31 +0000 (UTC) (envelope-from onemda@gmail.com) Received: by bwz5 with SMTP id 5so488533bwz.43 for ; Tue, 23 Jun 2009 23:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=iP2PGDFdljx39Iy3RpfPwmLh1P1I30k2OcODcFf2Z6s=; b=DuOh0EwpI3zfh++iZ7dkDD3FZDg2nhzpIza17/cT03Bs5TO6zDIdLy3Qz2Q0qtN9aL hrTJJPhq6QlcfoLo2yQ6MwWNIUT6X7n0Xs3WodkhlaaPABYQHFpU7bNq9wLBGjbHFEgD cDg/+aqmQWOT1avMMUXGD8wdU6BM+S/r7mEaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Xz5QgjRsFbqp+RGDnuhImGB9LeBkjAdnmAh/7d8By7J6HsvqyK1Ze3PuFES8fA93Tj XEQQjKMTrPRHajp2CAtuHYcTv+GD5F2l7lLlun9lCtrVyy28xhGg/54RLHGqFI8K9nQ+ r/heMzNPLuWVsCRRX1YKHhaB9Md5N33KB6d3Y= MIME-Version: 1.0 Received: by 10.204.72.15 with SMTP id k15mr924312bkj.14.1245823023612; Tue, 23 Jun 2009 22:57:03 -0700 (PDT) In-Reply-To: <4A3E1784.2050406@bindone.de> References: <4A3E1784.2050406@bindone.de> Date: Wed, 24 Jun 2009 07:57:03 +0200 Message-ID: <3a142e750906232257y4b1e255en9374c05079f04520@mail.gmail.com> From: "Paul B. Mahol" To: Michael Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: c.r.n.a@wanadoo.fr, freebsd-acpi@freebsd.org Subject: Re: Two new acpi modules, acpi_wmi and acpi_hp X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 06:21:33 -0000 On 6/21/09, Michael 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