From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 16 23:16:05 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 D6F1D16A4CE for ; Wed, 16 Jun 2004 23:16:05 +0000 (GMT) Received: from moutvdomng.kundenserver.de (moutvdom.kundenserver.de [212.227.126.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CC9E43D1D for ; Wed, 16 Jun 2004 23:16:05 +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 1BajcO-0006y6-00; Thu, 17 Jun 2004 01:14:56 +0200 Received: from [81.154.134.17] (helo=Anarion) by mrvdomng.kundenserver.de with smtp (Exim 3.35 #1) id 1BajcN-0004hg-00; Thu, 17 Jun 2004 01:14:55 +0200 Date: Thu, 17 Jun 2004 00:14:50 +0100 From: "Liam J. Foy" To: "M. Warner Losh" Message-Id: <20040617001450.55e2ef30.liamfoy@sepulcrum.org> In-Reply-To: <20040616.164142.91758633.imp@bsdimp.com> References: <20040616231428.2b531dba.liamfoy@sepulcrum.org> <20040616.162542.130625474.imp@bsdimp.com> <20040616233345.01cdd6de.liamfoy@sepulcrum.org> <20040616.164142.91758633.imp@bsdimp.com> Organization: None X-Mailer: Sylpheed version 0.9.9 (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: Wed, 16 Jun 2004 23:16:06 -0000 On Wed, 16 Jun 2004 16:41:42 -0600 (MDT) "M. Warner Losh" wrote: > In message: <20040616233345.01cdd6de.liamfoy@sepulcrum.org> > "Liam J. Foy" writes: > : On Wed, 16 Jun 2004 16:25:42 -0600 (MDT) > : "M. Warner Losh" wrote: > : > : > In message: <20040616231428.2b531dba.liamfoy@sepulcrum.org> > : > "Liam J. Foy" writes: > : > : You mentioned you had the driver patches, can you send these to me > : > : in order for me to test them. Also to present them fully and see what > : > : Nate and whoever think. > : > > : > Here's what I have. > : > > : > Warner > : > > : > Index: acpi_machdep.c > : > =================================================================== > : > RCS file: /home/ncvs/src/sys/i386/acpica/acpi_machdep.c,v > : > retrieving revision 1.21 > : > diff -u -r1.21 acpi_machdep.c > : > --- acpi_machdep.c 10 Jun 2004 20:43:01 -0000 1.21 > : > +++ acpi_machdep.c 16 Jun 2004 22:25:13 -0000 > : > @@ -80,7 +80,7 @@ > : > { > : > int state; > : > > : > - state = 0xff; /* XXX unknown */ > : > + state = APM_UNKNOWN; /* unknown */ > : > > : > if (battp->state & ACPI_BATT_STAT_DISCHARG) { > : > if (battp->cap >= 50) > : > @@ -94,7 +94,7 @@ > : > state = 3; /* charging */ > : > > : > /* If still unknown, determine it based on the battery capacity. */ > : > - if (state == 0xff) { > : > + if (state == APM_UNKNOWN) { > : > if (battp->cap >= 50) > : > state = 0; /* high */ > : > else > : > @@ -137,18 +137,18 @@ > : > aip->ai_major = 1; > : > aip->ai_minor = 2; > : > aip->ai_status = apm_softc.active; > : > - aip->ai_capabilities= 0xff00; /* XXX unknown */ > : > + aip->ai_capabilities= 0xff00; /* unknown */ > : > > : > if (acpi_acad_get_acline(&acline)) > : > - aip->ai_acline = 0xff; /* unknown */ > : > + aip->ai_acline = APM_UNKNOWN; /* unknown */ > : > else > : > aip->ai_acline = acline; /* on/off */ > : > > : > if (acpi_battery_get_battinfo(-1, &batt)) { > : > - aip->ai_batt_stat = 0xff; /* unknown */ > : > - aip->ai_batt_life = 0xff; /* unknown */ > : > - aip->ai_batt_time = -1; /* unknown */ > : > - aip->ai_batteries = 0; > : > + aip->ai_batt_stat = APM_UNKNOWN; /* unknown */ > : > + aip->ai_batt_life = APM_UNKNOWN; /* unknown */ > : > + aip->ai_batt_time = -1; /* unknown */ > : > + aip->ai_batteries = 0xffffffff; /* unknown */ > : > } else { > : > aip->ai_batt_stat = acpi_capm_convert_battstate(&batt); > : > aip->ai_batt_life = batt.cap; > : > @@ -184,7 +184,7 @@ > : > app->ap_batt_time = (batt.min == -1) ? -1 : batt.min * 60; > : > > : > if (acpi_acad_get_acline(&acline)) > : > - app->ap_acline = 0xff; /* unknown */ > : > + app->ap_acline = APM_UNKNOWN; /* unknown */ > : > else > : > app->ap_acline = acline; /* on/off */ > : > > : > : Thats great. I will change the apm code. I will then present > : this altogether. You think thats the best course of action? > > I've committed a change to the apm driver that sould make this right. > > Warner Great. You may also want to look at: http://liamfoy.kerneled.org/apm.diff -Liam