[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

apm problem



In message: <20040616231428_(_dot_)_2b531dba_(_dot_)_liamfoy_(_at_)_sepulcrum_(_dot_)_org>
            "Liam J. Foy" <liamfoy_(_at_)_sepulcrum_(_dot_)_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 */
 

Visit your host, monkey.org