mirror of
https://github.com/opnsense/src.git
synced 2026-04-25 16:18:54 -04:00
Add a "quirks" value to disable quirks handling for a given boot.
Also, disable quirks if booting with a custom DSDT. Add a quirk to disable loading ACPI so known bad systems can be completely blacklisted.
This commit is contained in:
parent
c203da27d5
commit
4e376d58dc
2 changed files with 20 additions and 5 deletions
|
|
@ -266,6 +266,11 @@ typically as a child of a PCI bus.
|
|||
.Pq Vt device
|
||||
Supports an ACPI laptop lid switch, which typically puts a
|
||||
system to sleep.
|
||||
.It Li quirks
|
||||
.Pq Vt feature
|
||||
Don't honor quirks.
|
||||
Quirks automatically disable ACPI functionality based on the XSDT table's
|
||||
OEM vendor name and revision date.
|
||||
.It Li pci
|
||||
.Pq Vt device
|
||||
Supports Host to PCI bridges.
|
||||
|
|
|
|||
|
|
@ -262,6 +262,8 @@ acpi_Startup(void)
|
|||
|
||||
/* Set up any quirks we have for this XSDT. */
|
||||
acpi_quirks_set();
|
||||
if (acpi_disabled("acpi"))
|
||||
return_VALUE (AE_ERROR);
|
||||
|
||||
return_VALUE (AE_OK);
|
||||
}
|
||||
|
|
@ -283,9 +285,6 @@ acpi_identify(driver_t *driver, device_t parent)
|
|||
if (resource_disabled("acpi", 0))
|
||||
return_VOID;
|
||||
|
||||
snprintf(acpi_ca_version, sizeof(acpi_ca_version), "0x%x",
|
||||
ACPI_CA_VERSION);
|
||||
|
||||
/* Make sure we're not being doubly invoked. */
|
||||
if (device_find_child(parent, "acpi", 0) != NULL)
|
||||
return_VOID;
|
||||
|
|
@ -294,6 +293,8 @@ acpi_identify(driver_t *driver, device_t parent)
|
|||
if (ACPI_FAILURE(acpi_Startup()))
|
||||
return_VOID;
|
||||
|
||||
snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%#x", ACPI_CA_VERSION);
|
||||
|
||||
/* Attach the actual ACPI device. */
|
||||
if ((child = BUS_ADD_CHILD(parent, 0, "acpi", 0)) == NULL) {
|
||||
device_printf(parent, "ACPI: could not attach\n");
|
||||
|
|
@ -583,10 +584,19 @@ acpi_quirks_set()
|
|||
char *env, *tmp;
|
||||
int len;
|
||||
|
||||
/* If the user specifies "noquirks", leave the settings alone. */
|
||||
/*
|
||||
* If the user loaded a custom table or disabled "quirks", leave
|
||||
* the settings alone.
|
||||
*/
|
||||
len = 0;
|
||||
if ((env = getenv("acpi_dsdt_load")) != NULL) {
|
||||
/* XXX No strcasecmp but this is good enough. */
|
||||
if (*env == 'Y' || *env == 'y')
|
||||
goto out;
|
||||
freeenv(env);
|
||||
}
|
||||
if ((env = getenv("debug.acpi.disabled")) != NULL) {
|
||||
if (strstr("noquirks", env) != NULL)
|
||||
if (strstr("quirks", env) != NULL)
|
||||
goto out;
|
||||
len = strlen(env);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue