summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2010-07-27 16:20:17 +0000
committermlarkin <mlarkin@openbsd.org>2010-07-27 16:20:17 +0000
commit1887d54eedeb151eb2321410a9034c10b93ef5d8 (patch)
treecc5fc0b42288245eff20c7b4c2b763e061bb0c94
parentproperly escape some "!"; reported by kristaps (diff)
downloadwireguard-openbsd-1887d54eedeb151eb2321410a9034c10b93ef5d8.tar.xz
wireguard-openbsd-1887d54eedeb151eb2321410a9034c10b93ef5d8.zip
Set the sleeping indicator light on machines that support it, in case SMI
doesn't do it for us. Shows the 'moon' LED on older Thinkpads when sleeping. Tested on T43p, W500, T510 by me and on X61s by deraadt@. ok deraadt@
-rw-r--r--sys/dev/acpi/acpi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index bdad3679554..ded80a073d4 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.190 2010/07/27 05:17:36 jordan Exp $ */
+/* $OpenBSD: acpi.c,v 1.191 2010/07/27 16:20:17 mlarkin Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -1898,6 +1898,13 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state)
goto fail;
}
+ /* Reset the indicator lights to "sleeping" */
+ if (sc->sc_sst) {
+ env.v_integer = ACPI_SST_SLEEPING;
+ aml_evalnode(sc, sc->sc_sst, 1, &env, NULL);
+ }
+ env.v_integer = state;
+
sc->sc_state = state;
/* _GTS(state) */
if (sc->sc_gts)