summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi.c
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2001-11-15 11:59:25 +0000
committeriwasaki <iwasaki@FreeBSD.org>2001-11-15 11:59:25 +0000
commit62ec3c0b4b396023f14362c8f7f91d5392fd1118 (patch)
treef87251b6de0cece12383a3513bd374d806b763f1 /sys/dev/acpica/acpi.c
parent246c6c7de10ca0651784ac96c83a75bd5b5e3853 (diff)
downloadFreeBSD-src-62ec3c0b4b396023f14362c8f7f91d5392fd1118.zip
FreeBSD-src-62ec3c0b4b396023f14362c8f7f91d5392fd1118.tar.gz
Remove "S4B" from sleep_state_names and add "NONE" instead.
Now you can say; # sysctl hw.acpi.lid_switch_state=NONE instead of specifying unsupported _Sx object in the system. Actually, S4B is going to disappear in ACPICA and we already have hw.acpi.s4bios to distinguish BIOS hibernation or OS hibernation.
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r--sys/dev/acpica/acpi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index cddb898..9041e1b 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -91,7 +91,7 @@ static struct cdevsw acpi_cdevsw = {
};
static const char* sleep_state_names[] = {
- "S0", "S1", "S2", "S3", "S4", "S5", "S4B" };
+ "S0", "S1", "S2", "S3", "S4", "S5", "NONE"};
/* this has to be static, as the softc is gone when we need it */
static int acpi_off_state = ACPI_STATE_S5;
@@ -1728,20 +1728,21 @@ acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS)
u_int new_state, old_state;
old_state = *(u_int *)oidp->oid_arg1;
- if (old_state > ACPI_S_STATES_MAX) {
+ if (old_state > ACPI_S_STATES_MAX+1) {
strcpy(sleep_state, "unknown");
} else {
+ bzero(sleep_state, sizeof(sleep_state));
strncpy(sleep_state, sleep_state_names[old_state],
sizeof(sleep_state_names[old_state]));
}
error = sysctl_handle_string(oidp, sleep_state, sizeof(sleep_state), req);
if (error == 0 && req->newptr != NULL) {
- for (new_state = ACPI_STATE_S0; new_state <= ACPI_S_STATES_MAX; new_state++) {
+ for (new_state = ACPI_STATE_S0; new_state <= ACPI_S_STATES_MAX+1; new_state++) {
if (strncmp(sleep_state, sleep_state_names[new_state],
sizeof(sleep_state)) == 0)
break;
}
- if ((new_state != old_state) && (new_state <= ACPI_S_STATES_MAX)) {
+ if ((new_state != old_state) && (new_state <= ACPI_S_STATES_MAX+1)) {
*(u_int *)oidp->oid_arg1 = new_state;
} else {
error = EINVAL;
OpenPOWER on IntegriCloud