From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 24 16:41:28 2004 Return-Path: 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 3B7FC16A4CE for ; Thu, 24 Jun 2004 16:41:28 +0000 (GMT) Received: from moutvdomng.kundenserver.de (moutvdom.kundenserver.de [212.227.126.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F85343D53 for ; Thu, 24 Jun 2004 16:41:27 +0000 (GMT) (envelope-from liamfoy@sepulcrum.org) Received: from [212.227.126.224] (helo=mrvdomng.kundenserver.de) by moutvdomng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BdXHT-0002v4-00; Thu, 24 Jun 2004 18:40:55 +0200 Received: from [217.43.76.39] (helo=liamfoy.ath.cx) by mrvdomng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BdXHT-0005Bf-00; Thu, 24 Jun 2004 18:40:55 +0200 Date: Thu, 24 Jun 2004 17:39:26 +0100 From: "Liam J. Foy" To: Message-Id: <20040624173926.47274bc3.liamfoy@sepulcrum.org> In-Reply-To: <27418837$108806874740da9c8b50d419.89444399@config8.schlund.de> References: <27418837$108806874740da9c8b50d419.89444399@config8.schlund.de> X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: acpi@FreeBSD.ORG Subject: Re: apm problem X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2004 16:41:28 -0000 On Thu, 24 Jun 2004 11:22:01 +0200 wrote: > > Nate Lawson wrote on 24.06.2004, 00:47:17: > > On Wed, 23 Jun 2004, M. Warner Losh wrote: > > > In message: > > > Nate Lawson writes: > > > : On Fri, 23 Jun 2000, Liam J. Foy wrote: > > > : > On Wed, 23 Jun 2004 12:40:40 -0700 (PDT) > > > : > We decided to go with -1. The apm.c patch currently will not apply due to > > > : > the re-structure of apm. The following patch will: > > > : > > > > : > http://liamfoy.kerneled.org/apm.diff > > > : > > > : Ok, good. That should help Warner. > > > : > > > : > After more digging, apm -l should return 255(stated in man page and acpi spec). > > > : > The following patch will make it work: > > > : > > > > : > --- /usr/src/sys/dev/acpica/acpi_cmbat.c Tue Jun 22 16:40:35 2004 > > > : > +++ /hd2/acpi_cmbat.c Tue Jun 22 17:02:18 2004 > > > : > @@ -449,7 +449,7 @@ > > > : > static int bat_units = 0; > > > : > static struct acpi_cmbat_softc **bat = NULL; > > > : > > > > : > - cap = min = -1; > > > : > + cap = min = 255; > > > : > batt_stat = ACPI_BATT_STAT_NOT_PRESENT; > > > : > error = 0; > > > : > > > > : > @@ -545,7 +545,7 @@ > > > : > > > > : > /* Battery life */ > > > : > if (valid_units == 0) { > > > : > - cap = -1; > > > : > + cap = 255; > > > : > batt_stat = ACPI_BATT_STAT_NOT_PRESENT; > > > : > } else { > > > : > cap = total_cap / valid_units; > > > : > @@ -649,7 +649,7 @@ > > > : > } > > > : > > > > : > if (!sc->present) { > > > : > - battinfo->cap = -1; > > > : > + battinfo->cap = 255; > > > : > battinfo->min = -1; > > > : > battinfo->state = ACPI_BATT_STAT_NOT_PRESENT; > > > : > } else { > > > : > > > : I disagree with this. Capacity and time remaining are both quantities > > > : represented by ints that we calculate. The man page should be updated if > > > : it's incorrect. > > > > > > That's why I've been reluctant to make these changes... > > > > Let's just update the man page. The use of -1 is the actual behavior and > > programs have been written that count on this. > > Right ok. I just gathered that's what needed returning. Anyway > I will patch it when I get home and mail the acpi@ list the patch > for one of you guys to commit. Here is the man page patch. Can one of you guys commit it? http://liamfoy.kerneled.org/freebsd/apm.8.diff Thanks, > > > > > -Nate > -- > Best Regards, > Liam Foy > "FreeBSD, the power to serve!" -- -Liam J. Foy http://liamfoy.kerneled.org "Now I wish it would rain down on me"