Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_pci.c
| Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
| static int acpi_pci_write_ivar(device_t dev, device_t child, int which, | static int acpi_pci_write_ivar(device_t dev, device_t child, int which, | ||||
| uintptr_t value); | uintptr_t value); | ||||
| static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, | static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, | ||||
| void *context, void **status); | void *context, void **status); | ||||
| static int acpi_pci_set_powerstate_method(device_t dev, device_t child, | static int acpi_pci_set_powerstate_method(device_t dev, device_t child, | ||||
| int state); | int state); | ||||
| static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); | static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); | ||||
| static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child); | static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child); | ||||
| static int acpi_pci_get_domain(device_t dev, device_t child, int *domain); | |||||
| static device_method_t acpi_pci_methods[] = { | static device_method_t acpi_pci_methods[] = { | ||||
| /* Device interface */ | /* Device interface */ | ||||
| DEVMETHOD(device_probe, acpi_pci_probe), | DEVMETHOD(device_probe, acpi_pci_probe), | ||||
| DEVMETHOD(device_attach, acpi_pci_attach), | DEVMETHOD(device_attach, acpi_pci_attach), | ||||
| DEVMETHOD(device_detach, acpi_pci_detach), | DEVMETHOD(device_detach, acpi_pci_detach), | ||||
| /* Bus interface */ | /* Bus interface */ | ||||
| DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar), | DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar), | ||||
| DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), | DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), | ||||
| DEVMETHOD(bus_child_deleted, acpi_pci_child_deleted), | DEVMETHOD(bus_child_deleted, acpi_pci_child_deleted), | ||||
| DEVMETHOD(bus_child_location, acpi_pci_child_location_method), | DEVMETHOD(bus_child_location, acpi_pci_child_location_method), | ||||
| DEVMETHOD(bus_get_device_path, acpi_pci_get_device_path), | DEVMETHOD(bus_get_device_path, acpi_pci_get_device_path), | ||||
| DEVMETHOD(bus_get_cpus, acpi_get_cpus), | DEVMETHOD(bus_get_cpus, acpi_get_cpus), | ||||
| DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), | DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), | ||||
| DEVMETHOD(bus_get_domain, acpi_get_domain_method), | DEVMETHOD(bus_get_domain, acpi_pci_get_domain), | ||||
| /* PCI interface */ | /* PCI interface */ | ||||
| DEVMETHOD(pci_alloc_devinfo, acpi_pci_alloc_devinfo), | DEVMETHOD(pci_alloc_devinfo, acpi_pci_alloc_devinfo), | ||||
| DEVMETHOD(pci_child_added, acpi_pci_child_added), | DEVMETHOD(pci_child_added, acpi_pci_child_added), | ||||
| DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), | DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), | ||||
| DEVMETHOD_END | DEVMETHOD_END | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | |||||
| acpi_pci_get_device_path(device_t bus, device_t child, const char *locator, struct sbuf *sb) | acpi_pci_get_device_path(device_t bus, device_t child, const char *locator, struct sbuf *sb) | ||||
| { | { | ||||
| if (strcmp(locator, BUS_LOCATOR_ACPI) == 0) | if (strcmp(locator, BUS_LOCATOR_ACPI) == 0) | ||||
| return (acpi_get_acpi_device_path(bus, child, locator, sb)); | return (acpi_get_acpi_device_path(bus, child, locator, sb)); | ||||
| /* Otherwise follow base class' actions */ | /* Otherwise follow base class' actions */ | ||||
| return (pci_get_device_path_method(bus, child, locator, sb)); | return (pci_get_device_path_method(bus, child, locator, sb)); | ||||
| } | |||||
| /* | |||||
| * Fetch the NUMA domain for the given device 'dev'. | |||||
| * | |||||
| * If a device has a _PXM method, map that to a NUMA domain. | |||||
| * Otherwise, pass the request up to the parent. | |||||
| * If there's no matching domain or the domain cannot be | |||||
| * determined, return ENOENT. | |||||
| */ | |||||
| static int | |||||
| acpi_pci_get_domain(device_t dev, device_t child, int *domain) | |||||
| { | |||||
| int d; | |||||
| d = acpi_pxm_parse(child); | |||||
| if (d >= 0) { | |||||
| *domain = d; | |||||
| return (0); | |||||
| } | |||||
| if (d == -1) | |||||
| return (ENOENT); | |||||
| /* No _PXM node; go up a level */ | |||||
| return (bus_generic_get_domain(dev, child, domain)); | |||||
| } | } | ||||
| /* | /* | ||||
| * PCI power manangement | * PCI power manangement | ||||
| */ | */ | ||||
| static int | static int | ||||
| acpi_pci_set_powerstate_method(device_t dev, device_t child, int state) | acpi_pci_set_powerstate_method(device_t dev, device_t child, int state) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines | |||||