diff options
author | msmith <msmith@FreeBSD.org> | 2001-10-04 23:21:09 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 2001-10-04 23:21:09 +0000 |
commit | dd61fc83a8fa795fbde75480309025c81d0c9996 (patch) | |
tree | 85be3d6fbcf38c8e26282b7e510c007dc779e400 /sys/dev/acpica/acpi.c | |
parent | 06d963bb08c512a0712a3f80ccac98bc31a9bc22 (diff) | |
download | FreeBSD-src-dd61fc83a8fa795fbde75480309025c81d0c9996.zip FreeBSD-src-dd61fc83a8fa795fbde75480309025c81d0c9996.tar.gz |
Update usage of AcpiEnableEvent to reflect a new argument.
Fix acpi_DeviceIsPresent to check for valid _STA data and to check
the "present" and "functioning" bits.
Use acpi_DeviceIsPresent in acpi_pcib rather than rolling our own
(also broken) version.
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r-- | sys/dev/acpica/acpi.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 92e1056..3522f23 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -857,7 +857,7 @@ acpi_enable_fixed_events(struct acpi_softc *sc) /* Enable and clear fixed events and install handlers. */ if ((AcpiGbl_FADT != NULL) && (AcpiGbl_FADT->PwrButton == 0)) { - AcpiEnableEvent(ACPI_EVENT_POWER_BUTTON, ACPI_EVENT_FIXED); + AcpiEnableEvent(ACPI_EVENT_POWER_BUTTON, ACPI_EVENT_FIXED, 0); AcpiClearEvent(ACPI_EVENT_POWER_BUTTON, ACPI_EVENT_FIXED); AcpiInstallFixedEventHandler(ACPI_EVENT_POWER_BUTTON, acpi_eventhandler_power_button_for_sleep, sc); @@ -866,7 +866,7 @@ acpi_enable_fixed_events(struct acpi_softc *sc) } } if ((AcpiGbl_FADT != NULL) && (AcpiGbl_FADT->SleepButton == 0)) { - AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, ACPI_EVENT_FIXED); + AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, ACPI_EVENT_FIXED, 0); AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON, ACPI_EVENT_FIXED); AcpiInstallFixedEventHandler(ACPI_EVENT_SLEEP_BUTTON, acpi_eventhandler_sleep_button_for_sleep, sc); @@ -896,8 +896,11 @@ acpi_DeviceIsPresent(device_t dev) return(FALSE); if ((error = AcpiGetObjectInfo(h, &devinfo)) != AE_OK) return(FALSE); - /* XXX 0xf is probably not appropriate */ - if ((devinfo.Valid & ACPI_VALID_HID) && (devinfo.CurrentStatus & 0xf)) + /* if no _STA method, must be present */ + if (!(devinfo.Valid & ACPI_VALID_STA)) + return(TRUE); + /* return true for 'present' and 'functioning' */ + if ((devinfo.CurrentStatus & 0x9) == 0x9) return(TRUE); return(FALSE); } |