acpi_status acpi_ex_pci_config_space_handler ( u32 function, ACPI_PHYSICAL_ADDRESS address, u32 bit_width, u32 *value, void *handler_context, void *region_context) { acpi_status status = AE_OK; acpi_pci_id *pci_id; u16 pci_register; FUNCTION_TRACE ("Ex_pci_config_space_handler"); /* * The arguments to Acpi_os(Read|Write)Pci_cfg(Byte|Word|Dword) are: * * Pci_segment is the PCI bus segment range 0-31 * Pci_bus is the PCI bus number range 0-255 * Pci_device is the PCI device number range 0-31 * Pci_function is the PCI device function number * Pci_register is the Config space register range 0-255 bytes * * Value - input value for write, output address for read * */ pci_id = (acpi_pci_id *) region_context; pci_register = (u16) address; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", function, bit_width, pci_id->segment, pci_id->bus, pci_id->device, pci_id->function, pci_register)); switch (function) { case ACPI_READ_ADR_SPACE: *value = 0; status = acpi_os_read_pci_configuration (pci_id, pci_register, value, bit_width); break; case ACPI_WRITE_ADR_SPACE: status = acpi_os_write_pci_configuration (pci_id, pci_register, *value, bit_width); break; default: status = AE_BAD_PARAMETER; break; } return_ACPI_STATUS (status); }
acpi_status acpi_ex_pci_config_space_handler ( u32 function, acpi_physical_address address, u32 bit_width, acpi_integer *value, void *handler_context, void *region_context) { acpi_status status = AE_OK; struct acpi_pci_id *pci_id; u16 pci_register; ACPI_FUNCTION_TRACE ("ex_pci_config_space_handler"); /* * The arguments to acpi_os(Read|Write)pci_configuration are: * * pci_segment is the PCI bus segment range 0-31 * pci_bus is the PCI bus number range 0-255 * pci_device is the PCI device number range 0-31 * pci_function is the PCI device function number * pci_register is the Config space register range 0-255 bytes * * Value - input value for write, output address for read * */ pci_id = (struct acpi_pci_id *) region_context; pci_register = (u16) (u32) address; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", function, bit_width, pci_id->segment, pci_id->bus, pci_id->device, pci_id->function, pci_register)); switch (function) { case ACPI_READ: *value = 0; status = acpi_os_read_pci_configuration (pci_id, pci_register, value, bit_width); break; case ACPI_WRITE: status = acpi_os_write_pci_configuration (pci_id, pci_register, *value, bit_width); break; default: status = AE_BAD_PARAMETER; break; } return_ACPI_STATUS (status); }