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 | |
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.
-rw-r--r-- | sys/dev/acpica/acpi.c | 11 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_ec.c | 6 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib.c | 7 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib_acpi.c | 7 |
4 files changed, 16 insertions, 15 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); } diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index 5a870a4..54eb519 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -482,9 +482,9 @@ EcGpeQueryHandler(void *Context) } } /* I know I request Level trigger cleanup */ - if(AcpiClearEvent(sc->ec_gpebit,ACPI_EVENT_GPE) != AE_OK) + if(AcpiClearEvent(sc->ec_gpebit, ACPI_EVENT_GPE) != AE_OK) printf("EcGpeQueryHandler:ClearEvent Failed\n"); - if(AcpiEnableEvent(sc->ec_gpebit,ACPI_EVENT_GPE) != AE_OK) + if(AcpiEnableEvent(sc->ec_gpebit, ACPI_EVENT_GPE, 0) != AE_OK) printf("EcGpeQueryHandler:EnableEvent Failed\n"); return_VOID; } @@ -741,7 +741,7 @@ EcTransaction(struct acpi_ec_softc *sc, EC_REQUEST *EcRequest) if (AcpiClearEvent(sc->ec_gpebit, ACPI_EVENT_GPE) != AE_OK) device_printf(sc->ec_dev, "EcRequest: Unable to clear the EC GPE.\n"); - if (AcpiEnableEvent(sc->ec_gpebit, ACPI_EVENT_GPE) != AE_OK) + if (AcpiEnableEvent(sc->ec_gpebit, ACPI_EVENT_GPE, 0) != AE_OK) device_printf(sc->ec_dev, "EcRequest: Unable to re-enable the EC GPE.\n"); return(Status); diff --git a/sys/dev/acpica/acpi_pcib.c b/sys/dev/acpica/acpi_pcib.c index 2bf055e..c79714f 100644 --- a/sys/dev/acpica/acpi_pcib.c +++ b/sys/dev/acpica/acpi_pcib.c @@ -375,10 +375,9 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin) prt->Source, devinfo.HardwareId); goto out; } - /* should be 'present' and 'functioning' */ - if ((devinfo.CurrentStatus & 0x09) != 0x09) { - device_printf(sc->ap_dev, "PCI interrupt link device %s unavailable (CurrentStatus 0x%x)\n", - prt->Source, devinfo.CurrentStatus); + if (!acpi_DeviceIsPresent(sc->ap_dev)) { + device_printf(sc->ap_dev, "PCI interrupt link device %s not present\n", + prt->Source); goto out; } diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index 2bf055e..c79714f 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -375,10 +375,9 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin) prt->Source, devinfo.HardwareId); goto out; } - /* should be 'present' and 'functioning' */ - if ((devinfo.CurrentStatus & 0x09) != 0x09) { - device_printf(sc->ap_dev, "PCI interrupt link device %s unavailable (CurrentStatus 0x%x)\n", - prt->Source, devinfo.CurrentStatus); + if (!acpi_DeviceIsPresent(sc->ap_dev)) { + device_printf(sc->ap_dev, "PCI interrupt link device %s not present\n", + prt->Source); goto out; } |