Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jun 2004 23:33:45 +0100
From:      "Liam J. Foy" <liamfoy@sepulcrum.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        acpi@FreeBSD.ORG
Subject:   Re: apm problem
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 16 Jun 2004 16:25:42 -0600 (MDT)
"M. Warner Losh" <imp@bsdimp.com> wrote:

> In message: <20040616231428.2b531dba.liamfoy@sepulcrum.org>
>             "Liam J. Foy" <liamfoy@sepulcrum.org> 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?



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