svn commit: r213783 - head/sys/dev/acpica/Osd
Jung-uk Kim
jkim at FreeBSD.org
Wed Oct 13 16:30:41 UTC 2010
Author: jkim
Date: Wed Oct 13 16:30:41 2010
New Revision: 213783
URL: http://svn.freebsd.org/changeset/base/213783
Log:
Remove acpi_bus_number() completely. It had to be removed in r212761.
Pointed out by: jhb
Modified:
head/sys/dev/acpica/Osd/OsdHardware.c
Modified: head/sys/dev/acpica/Osd/OsdHardware.c
==============================================================================
--- head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 14:57:13 2010 (r213782)
+++ head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 16:30:41 2010 (r213783)
@@ -122,58 +122,3 @@ AcpiOsWritePciConfiguration (ACPI_PCI_ID
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);
-}
More information about the svn-src-head
mailing list