Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2004 14:00:47 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        "Liam J. Foy" <liamfoy@sepulcrum.org>
Cc:        acpi@freebsd.org
Subject:   Re: apm problem
Message-ID:  <20040623135554.V87272@root.org>
In-Reply-To: <20000623205805.4c299e4e.liamfoy@sepulcrum.org>
References:  <20040616171408.0f88c928.liamfoy@sepulcrum.org> <20040616.135044.85075412.imp@bsdimp.com> <20040623123827.O86825@root.org> <20000623205805.4c299e4e.liamfoy@sepulcrum.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040623135554.V87272>