summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/Osd
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-04-28 22:25:27 +0000
committerjkim <jkim@FreeBSD.org>2010-04-28 22:25:27 +0000
commit4c851553838a2dd95a2de9b439d36e29fb5db240 (patch)
treee511715a703db6625626ee660200d7e96f82d8d2 /sys/dev/acpica/Osd
parentc28c8b4fa8609196c4f255f1331dbe009fba337c (diff)
parent4bf52321c35e1ae073f65020f92e80d53bdf79d8 (diff)
downloadFreeBSD-src-4c851553838a2dd95a2de9b439d36e29fb5db240.zip
FreeBSD-src-4c851553838a2dd95a2de9b439d36e29fb5db240.tar.gz
Merge ACPICA 20100428.
Diffstat (limited to 'sys/dev/acpica/Osd')
-rw-r--r--sys/dev/acpica/Osd/OsdHardware.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/dev/acpica/Osd/OsdHardware.c b/sys/dev/acpica/Osd/OsdHardware.c
index 822bf78..0638802 100644
--- a/sys/dev/acpica/Osd/OsdHardware.c
+++ b/sys/dev/acpica/Osd/OsdHardware.c
@@ -216,12 +216,12 @@ acpi_bus_number(ACPI_HANDLE root, ACPI_HANDLE curr, ACPI_PCI_ID *PciId)
/*
* Find the bus number for a device
*
- * rhandle: handle for the root bus
- * chandle: handle for the device
+ * Device: handle for the PCI root bridge device
+ * Region: handle for the PCI configuration space operation region
* PciId: pointer to device slot and function, we fill out bus
*/
void
-AcpiOsDerivePciId(ACPI_HANDLE rhandle, ACPI_HANDLE chandle, ACPI_PCI_ID **PciId)
+AcpiOsDerivePciId(ACPI_HANDLE Device, ACPI_HANDLE Region, ACPI_PCI_ID **PciId)
{
ACPI_HANDLE parent;
ACPI_STATUS status;
@@ -230,26 +230,21 @@ AcpiOsDerivePciId(ACPI_HANDLE rhandle, ACPI_HANDLE chandle, ACPI_PCI_ID **PciId)
if (pci_cfgregopen() == 0)
panic("AcpiOsDerivePciId unable to initialize pci bus");
- /* Try to read _BBN for bus number if we're at the root */
+ /* Try to read _BBN for bus number if we're at the root. */
bus = 0;
- if (rhandle == chandle) {
- status = acpi_GetInteger(rhandle, "_BBN", &bus);
+ if (Device == Region) {
+ status = acpi_GetInteger(Device, "_BBN", &bus);
if (ACPI_FAILURE(status) && bootverbose)
printf("AcpiOsDerivePciId: root bus has no _BBN, assuming 0\n");
}
- /*
- * Get the parent handle and call the recursive case. It is not
- * clear why we seem to be getting a chandle that points to a child
- * of the desired slot/function but passing in the parent handle
- * here works.
- */
- if (ACPI_SUCCESS(AcpiGetParent(chandle, &parent)))
- bus = acpi_bus_number(rhandle, parent, *PciId);
+ /* Get the parent handle and call the recursive case. */
+ if (ACPI_SUCCESS(AcpiGetParent(Region, &parent)))
+ bus = acpi_bus_number(Device, parent, *PciId);
(*PciId)->Bus = bus;
if (bootverbose) {
printf("AcpiOsDerivePciId: %s -> bus %d dev %d func %d\n",
- acpi_name(chandle), (*PciId)->Bus, (*PciId)->Device,
+ acpi_name(Region), (*PciId)->Bus, (*PciId)->Device,
(*PciId)->Function);
}
}
OpenPOWER on IntegriCloud