From owner-freebsd-current@FreeBSD.ORG Fri Jul 22 19:25:20 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0CFB16A41F; Fri, 22 Jul 2005 19:25:20 +0000 (GMT) (envelope-from nate@root.org) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E48C43D49; Fri, 22 Jul 2005 19:25:20 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.33] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id j6MJPJo5016415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 22 Jul 2005 12:25:20 -0700 Message-ID: <42E1481F.5040306@root.org> Date: Fri, 22 Jul 2005 12:25:19 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050416) X-Accept-Language: en-us, en MIME-Version: 1.0 To: acpi@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Current Subject: acpi battery rework patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2005 19:25:21 -0000 I have completed a rework of the battery subsystem and would like testing of the patch. I'd like this to go into 6.0. It should have no effect for people with working batteries and fixes some bugs for those who don't. It also makes it possible to import support for smart batteries (not in this patch). API changes: apm compatibility device: no change sysctl: no change kernel function call: API reduced. ioctl: API reduced. kernel function access: Access individual batteries via devclass_find("battery"). Methods are ACPI_BATT_GET_STATUS (for _BST-formatted data) and ACPI_BATT_GET_INFO (for _BIF-formatted data). The helper function acpi_battery_get_battinfo() has been changed to take a device_t instead of unit # argument. If dev is NULL, this signifies all batteries. ioctl access: The ACPIIO_BATT_GET_TYPE and ACPIIO_BATT_GET_BATTDESC ioctls have been removed. Since there is no mapping between "virtual" unit and actual unit, just specify the unit directly and skip the old translation steps. For instance, in the future if you have two smart batteries and two control-method batteries, they'll be battery0-3. Patch can be found here: http://root.org/~nate/freebsd/batt-rework.diff.gz Please test to be sure your battery status works as usual, along with any apps. Since most apps (xbatt, gnome, etc.) use the apm compat layer, they should work as before with no recompilation needed. -- Nate