Module Name: src Committed By: jruoho Date: Mon Jun 7 14:12:20 UTC 2010
Modified Files: src/sys/dev/acpi: acpi_wakedev.c Log Message: Fix a bug: the last elements in the _PRW package are direct references to power resources, not devices. Thus, we can not use the function that sets the power state of a device. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/acpi/acpi_wakedev.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/acpi_wakedev.c diff -u src/sys/dev/acpi/acpi_wakedev.c:1.16 src/sys/dev/acpi/acpi_wakedev.c:1.17 --- src/sys/dev/acpi/acpi_wakedev.c:1.16 Mon Jun 7 04:08:26 2010 +++ src/sys/dev/acpi/acpi_wakedev.c Mon Jun 7 14:12:20 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_wakedev.c,v 1.16 2010/06/07 04:08:26 jruoho Exp $ */ +/* $NetBSD: acpi_wakedev.c,v 1.17 2010/06/07 14:12:20 jruoho Exp $ */ /*- * Copyright (c) 2009, 2010 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.16 2010/06/07 04:08:26 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.17 2010/06/07 14:12:20 jruoho Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -54,7 +54,7 @@ static void acpi_wakedev_method(struct acpi_devnode *, int, int); static void acpi_wakedev_gpe(struct acpi_devnode *, int, int); -static void acpi_wakedev_power(ACPI_OBJECT *); +static void acpi_wakedev_power(struct acpi_devnode *, ACPI_OBJECT *); SYSCTL_SETUP(sysctl_acpi_wakedev_setup, "sysctl hw.acpi.wake subtree setup") { @@ -266,7 +266,7 @@ * Turn on power resources. */ if (enable != 0) - acpi_wakedev_power(obj); + acpi_wakedev_power(ad, obj); /* * Set both runtime and wake GPEs, but unset only wake GPEs. @@ -284,7 +284,7 @@ } static void -acpi_wakedev_power(ACPI_OBJECT *obj) +acpi_wakedev_power(struct acpi_devnode *ad, ACPI_OBJECT *obj) { ACPI_OBJECT *elm; ACPI_HANDLE hdl; @@ -304,6 +304,6 @@ if (ACPI_FAILURE(rv)) continue; - (void)acpi_power_set_from_handle(hdl, ACPI_STATE_D0); + (void)acpi_power_res(hdl, ad->ad_handle, true); } }