mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
Only enable S4BIOS by default if the FACS says it is available. The
user can override this with a sysctl. Be sure to return the acpi_SetSleepState return value to userland.
This commit is contained in:
parent
82f9defeaf
commit
2d610c4638
1 changed files with 9 additions and 4 deletions
|
|
@ -431,7 +431,6 @@ acpi_attach(device_t dev)
|
|||
*/
|
||||
sc->acpi_sleep_delay = 5;
|
||||
sc->acpi_disable_on_poweroff = 1;
|
||||
sc->acpi_s4bios = 1;
|
||||
if (bootverbose)
|
||||
sc->acpi_verbose = 1;
|
||||
if ((env = getenv("hw.acpi.verbose")) && strcmp(env, "0")) {
|
||||
|
|
@ -439,6 +438,10 @@ acpi_attach(device_t dev)
|
|||
freeenv(env);
|
||||
}
|
||||
|
||||
/* Only enable S4BIOS by default if the FACS says it is available. */
|
||||
if (AcpiGbl_FACS->S4Bios_f != 0)
|
||||
sc->acpi_s4bios = 1;
|
||||
|
||||
/*
|
||||
* Dispatch the default sleep state to devices.
|
||||
* TBD: should be configured from userland policy manager.
|
||||
|
|
@ -1980,10 +1983,12 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
|
|||
break;
|
||||
}
|
||||
state = *(int *)addr;
|
||||
if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX)
|
||||
acpi_SetSleepState(sc, state);
|
||||
else
|
||||
if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) {
|
||||
if (ACPI_FAILURE(acpi_SetSleepState(sc, state)))
|
||||
error = EINVAL;
|
||||
} else {
|
||||
error = EINVAL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (error == 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue