diff options
author | Nate Lawson <njl@FreeBSD.org> | 2004-06-30 16:08:03 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2004-06-30 16:08:03 +0000 |
commit | d4b9ff9179ea365cb8a8891d5935ed27ce638695 (patch) | |
tree | 80d3f628b9b2fa8818b9783ce1b105fab138596d /sys/dev/acpica/acpi_pci.c | |
parent | d3b9d3d1d70b3623452ba4b461dff9b13bfcb8a6 (diff) | |
download | src-d4b9ff9179ea365cb8a8891d5935ed27ce638695.tar.gz src-d4b9ff9179ea365cb8a8891d5935ed27ce638695.zip |
Move flags into a private ivar so it can't collide with device flags.
Unify the code to disable GPEs with the enable code. Shutdown is handled
the same way. ACPI now does all wake/sleep prep for child devices so
now they no longer need to call external functions in the suspend/resume
path. Add the flags to non-ACPI busses (i.e., pci).
Notes
Notes:
svn path=/head/; revision=131341
Diffstat (limited to 'sys/dev/acpica/acpi_pci.c')
-rw-r--r-- | sys/dev/acpica/acpi_pci.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c index ccb64c39057b..822b5810ac67 100644 --- a/sys/dev/acpica/acpi_pci.c +++ b/sys/dev/acpica/acpi_pci.c @@ -54,6 +54,7 @@ ACPI_MODULE_NAME("PCI") struct acpi_pci_devinfo { struct pci_devinfo ap_dinfo; ACPI_HANDLE ap_handle; + int ap_flags; }; static int acpi_pci_attach(device_t dev); @@ -62,6 +63,8 @@ static int acpi_pci_child_location_str_method(device_t cbdev, static int acpi_pci_probe(device_t dev); static int acpi_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); +static int acpi_pci_write_ivar(device_t dev, device_t child, int which, + uintptr_t value); static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, void *context, void **status); static int acpi_pci_set_powerstate_method(device_t dev, device_t child, @@ -80,7 +83,7 @@ static device_method_t acpi_pci_methods[] = { DEVMETHOD(bus_print_child, pci_print_child), DEVMETHOD(bus_probe_nomatch, pci_probe_nomatch), DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar), - DEVMETHOD(bus_write_ivar, pci_write_ivar), + DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), DEVMETHOD(bus_driver_added, pci_driver_added), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -126,16 +129,36 @@ acpi_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct acpi_pci_devinfo *dinfo; + dinfo = device_get_ivars(child); switch (which) { case ACPI_IVAR_HANDLE: - dinfo = device_get_ivars(child); *result = (uintptr_t)dinfo->ap_handle; return (0); + case ACPI_IVAR_FLAGS: + *result = (uintptr_t)dinfo->ap_flags; + return (0); } return (pci_read_ivar(dev, child, which, result)); } static int +acpi_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct acpi_pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + switch (which) { + case ACPI_IVAR_HANDLE: + dinfo->ap_handle = (ACPI_HANDLE)value; + return (0); + case ACPI_IVAR_FLAGS: + dinfo->ap_flags = (int)value; + return (0); + } + return (pci_write_ivar(dev, child, which, value)); +} + +static int acpi_pci_child_location_str_method(device_t cbdev, device_t child, char *buf, size_t buflen) { |