diff options
-rw-r--r-- | sys/dev/acpica/Osd/OsdHardware.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/sys/dev/acpica/Osd/OsdHardware.c b/sys/dev/acpica/Osd/OsdHardware.c index c8cc76e..e645196 100644 --- a/sys/dev/acpica/Osd/OsdHardware.c +++ b/sys/dev/acpica/Osd/OsdHardware.c @@ -122,58 +122,3 @@ AcpiOsWritePciConfiguration (ACPI_PCI_ID *PciId, UINT32 Register, return (AE_OK); } - -/* - * Depth-first recursive case for finding the bus, given the slot/function. - */ -static int __unused -acpi_bus_number(ACPI_HANDLE root, ACPI_HANDLE curr, ACPI_PCI_ID *PciId) -{ - ACPI_HANDLE parent; - ACPI_STATUS status; - ACPI_OBJECT_TYPE type; - UINT32 adr; - int bus, slot, func, class, subclass, header; - - /* Try to get the _BBN object of the root, otherwise assume it is 0. */ - bus = 0; - if (root == curr) { - status = acpi_GetInteger(root, "_BBN", &bus); - if (ACPI_FAILURE(status) && bootverbose) - printf("acpi_bus_number: root bus has no _BBN, assuming 0\n"); - return (bus); - } - status = AcpiGetParent(curr, &parent); - if (ACPI_FAILURE(status)) - return (bus); - - /* First, recurse up the tree until we find the host bus. */ - bus = acpi_bus_number(root, parent, PciId); - - /* Validate parent bus device type. */ - if (ACPI_FAILURE(AcpiGetType(parent, &type)) || type != ACPI_TYPE_DEVICE) { - printf("acpi_bus_number: not a device, type %d\n", type); - return (bus); - } - - /* Get the parent's slot and function. */ - status = acpi_GetInteger(parent, "_ADR", &adr); - if (ACPI_FAILURE(status)) - return (bus); - slot = ACPI_HIWORD(adr); - func = ACPI_LOWORD(adr); - - /* Is this a PCI-PCI or Cardbus-PCI bridge? */ - class = pci_cfgregread(bus, slot, func, PCIR_CLASS, 1); - if (class != PCIC_BRIDGE) - return (bus); - subclass = pci_cfgregread(bus, slot, func, PCIR_SUBCLASS, 1); - - /* Find the header type, masking off the multifunction bit. */ - header = pci_cfgregread(bus, slot, func, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE; - if (header == PCIM_HDRTYPE_BRIDGE && subclass == PCIS_BRIDGE_PCI) - bus = pci_cfgregread(bus, slot, func, PCIR_SECBUS_1, 1); - else if (header == PCIM_HDRTYPE_CARDBUS && subclass == PCIS_BRIDGE_CARDBUS) - bus = pci_cfgregread(bus, slot, func, PCIR_SECBUS_2, 1); - return (bus); -} |