From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 16 22:33:56 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 59CFB16A4CE for ; Wed, 16 Jun 2004 22:33:56 +0000 (GMT) Received: from moutvdomng.kundenserver.de (moutvdom.kundenserver.de [212.227.126.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBFE743D4C for ; Wed, 16 Jun 2004 22:33:55 +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 1Baiyf-0003ya-00; Thu, 17 Jun 2004 00:33:53 +0200 Received: from [81.154.134.17] (helo=Anarion) by mrvdomng.kundenserver.de with smtp (Exim 3.35 #1) id 1Baiye-0004MO-00; Thu, 17 Jun 2004 00:33:52 +0200 Date: Wed, 16 Jun 2004 23:33:45 +0100 From: "Liam J. Foy" To: "M. Warner Losh" Message-Id: <20040616233345.01cdd6de.liamfoy@sepulcrum.org> In-Reply-To: <20040616.162542.130625474.imp@bsdimp.com> References: <20040616221656.5e0febc0.liamfoy@sepulcrum.org> <20040616.153757.104034074.imp@bsdimp.com> <20040616231428.2b531dba.liamfoy@sepulcrum.org> <20040616.162542.130625474.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 22:33:56 -0000 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?