patch-2.4.25 linux-2.4.25/drivers/acpi/pci_root.c
Next file: linux-2.4.25/drivers/acpi/power.c
Previous file: linux-2.4.25/drivers/acpi/pci_irq.c
Back to the patch index
Back to the overall index
- Lines: 118
- Date:
2004-02-18 05:36:31.000000000 -0800
- Orig file:
linux-2.4.24/drivers/acpi/pci_root.c
- Orig date:
2003-11-28 10:26:19.000000000 -0800
diff -urN linux-2.4.24/drivers/acpi/pci_root.c linux-2.4.25/drivers/acpi/pci_root.c
@@ -61,8 +61,6 @@
acpi_handle handle;
struct acpi_pci_id id;
struct pci_bus *bus;
- u64 mem_tra;
- u64 io_tra;
};
static LIST_HEAD(acpi_pci_roots);
@@ -114,97 +112,6 @@
}
}
-void
-acpi_pci_get_translations (
- struct acpi_pci_id *id,
- u64 *mem_tra,
- u64 *io_tra)
-{
- struct list_head *node = NULL;
- struct acpi_pci_root *entry;
-
- /* TBD: Locking */
- list_for_each(node, &acpi_pci_roots) {
- entry = list_entry(node, struct acpi_pci_root, node);
- if ((id->segment == entry->id.segment)
- && (id->bus == entry->id.bus)) {
- *mem_tra = entry->mem_tra;
- *io_tra = entry->io_tra;
- return;
- }
- }
-
- *mem_tra = 0;
- *io_tra = 0;
-}
-
-
-static u64
-acpi_pci_root_bus_tra (
- struct acpi_resource *resource,
- int type)
-{
- struct acpi_resource_address16 *address16;
- struct acpi_resource_address32 *address32;
- struct acpi_resource_address64 *address64;
-
- while (1) {
- switch (resource->id) {
- case ACPI_RSTYPE_END_TAG:
- return 0;
-
- case ACPI_RSTYPE_ADDRESS16:
- address16 = (struct acpi_resource_address16 *) &resource->data;
- if (type == address16->resource_type) {
- return address16->address_translation_offset;
- }
- break;
-
- case ACPI_RSTYPE_ADDRESS32:
- address32 = (struct acpi_resource_address32 *) &resource->data;
- if (type == address32->resource_type) {
- return address32->address_translation_offset;
- }
- break;
-
- case ACPI_RSTYPE_ADDRESS64:
- address64 = (struct acpi_resource_address64 *) &resource->data;
- if (type == address64->resource_type) {
- return address64->address_translation_offset;
- }
- break;
- }
- resource = ACPI_PTR_ADD (struct acpi_resource,
- resource, resource->length);
- }
-
- return 0;
-}
-
-
-static int
-acpi_pci_evaluate_crs (
- struct acpi_pci_root *root)
-{
- acpi_status status;
- struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-
- ACPI_FUNCTION_TRACE("acpi_pci_evaluate_crs");
-
- status = acpi_get_current_resources (root->handle, &buffer);
- if (ACPI_FAILURE(status))
- return_VALUE(-ENODEV);
-
- root->io_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
- buffer.pointer, ACPI_IO_RANGE);
- root->mem_tra = acpi_pci_root_bus_tra ((struct acpi_resource *)
- buffer.pointer, ACPI_MEMORY_RANGE);
-
- acpi_os_free(buffer.pointer);
- return_VALUE(0);
-}
-
-
static int
acpi_pci_root_add (
struct acpi_device *device)
@@ -289,10 +196,8 @@
root->id.function = device->pnp.bus_address & 0xFFFF;
/*
- * Evaluate _CRS to get root bridge resources
* TBD: Need PCI interface for enumeration/configuration of roots.
*/
- acpi_pci_evaluate_crs(root);
/* TBD: Locking */
list_add_tail(&root->node, &acpi_pci_roots);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)