From owner-freebsd-acpi@FreeBSD.ORG Thu Dec 8 11:37:41 2005 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1FDC16A41F for ; Thu, 8 Dec 2005 11:37:41 +0000 (GMT) (envelope-from skripachov@mail.ru) Received: from mx2.mail.ru (mx2.mail.ru [194.67.23.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE6A143D88 for ; Thu, 8 Dec 2005 11:37:40 +0000 (GMT) (envelope-from skripachov@mail.ru) Received: from [213.183.242.226] (port=49972 helo=satellite.osatec-msk.ru) by mx2.mail.ru with esmtp id 1EkK5i-0009r2-00 for freebsd-acpi@freebsd.org; Thu, 08 Dec 2005 14:37:38 +0300 From: Yuri Skripachov To: freebsd-acpi@freebsd.org Date: Thu, 8 Dec 2005 14:37:35 +0300 User-Agent: KMail/1.8.3 References: <200512071659.58560.skripachov@mail.ru> In-Reply-To: <200512071659.58560.skripachov@mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512081437.36332.skripachov@mail.ru> Subject: Re: Toshiba Satellite P10 + wrong battery state reported by ACPIIO_BATT_GET_BATTINFO. 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: Thu, 08 Dec 2005 11:37:41 -0000 > Which way is right? It seems to me that right way is to define ACPI_BATT_STAT_NOT_PRESENT as (ACPI_BATT_STAT_CHARGING | ACPI_BATT_STAT_DISCHARG) because these bits are mutually exclusive and must not both be set at the same time. Even in critical state. And then change the acpi_battery_bst_valid() in dev/acpica/acpi_battery.c. -- cut /* Check _BST results for validity. */ int acpi_battery_bst_valid(struct acpi_bst *bst) { if ((bst->state & ACPI_BATT_STAT_NOT_PRESENT) == ACPI_BATT_STAT_NOT_PRESENT || bst->cap == 0xffffffff || bst->volt == 0xffffffff) return (FALSE); else return (TRUE); } -- cut -- Best regards, Yuri Skripachov mailto:skripachov@mail.ru "The faster I go, the behinder I get." -- Lewis Carroll --