Remove acpi_bus_number() completely. It had to be removed in r212761.

Pointed out by:	jhb
This commit is contained in:
Jung-uk Kim 2010-10-13 16:30:41 +00:00
parent 62e9a33814
commit e41724b279
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213783

View File

@ -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);
}