- Provide a fallback when _BBN isn't implemented for a PCI root bus
- Fixes PCI on QEMU with ACPI enabled

svn path=/trunk/; revision=53463
This commit is contained in:
Cameron Gutman 2011-08-27 01:10:29 +00:00
parent b0c146ed0c
commit 7f089310e7

View file

@ -655,6 +655,7 @@ Bus_PDO_QueryResources(
ULONG ResourceListSize;
ULONG i;
ULONGLONG BusNumber;
struct acpi_device *device;
if (!DeviceData->AcpiHandle)
{
@ -664,9 +665,30 @@ Bus_PDO_QueryResources(
/* A bus number resource is not included in the list of current resources
* for the root PCI bus so we manually query one here and if we find it
* we create a resource list and add a bus number descriptor to it */
AcpiStatus = acpi_evaluate_integer(DeviceData->AcpiHandle, "_BBN", NULL, &BusNumber);
if (AcpiStatus == AE_OK)
if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0)
{
acpi_bus_get_device(DeviceData->AcpiHandle, &device);
AcpiStatus = acpi_evaluate_integer(DeviceData->AcpiHandle, "_BBN", NULL, &BusNumber);
if (AcpiStatus != AE_OK)
{
#if 0
if (device->flags.unique_id)
{
/* FIXME: Try the unique ID */
}
else
#endif
{
BusNumber = 0;
DPRINT1("Failed to find a bus number\n");
}
}
else
{
DPRINT1("Using _BBN for bus number\n");
}
DPRINT1("Found PCI root hub: %d\n", BusNumber);
ResourceListSize = sizeof(CM_RESOURCE_LIST);