[ACPI]
authorCameron Gutman <aicommander@gmail.com>
Sat, 11 Feb 2012 06:25:16 +0000 (06:25 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sat, 11 Feb 2012 06:25:16 +0000 (06:25 +0000)
- Fix incorrect maximum bound for resource requirements
- Handle PCI buses manually
[HAL]
- Don't hang if the IRP_MN_QUERY_INTERFACE is received
[INF]
- Misc fixes

svn path=/branches/usb-bringup-trunk/; revision=55541

drivers/bus/acpi/buspdo.c
hal/halx86/acpi/halpnpdd.c
hal/halx86/legacy/halpnpdd.c
media/inf/keyboard.inf
media/inf/msmouse.inf

index 0e149b8..c807f1a 100644 (file)
@@ -1136,6 +1136,12 @@ Bus_PDO_QueryResourceRequirements(
         return Irp->IoStatus.Status;
     }
 
+    /* Handle the PCI root manually */
+    if (wcsstr(DeviceData->HardwareIDs, L"PNP0A03") != 0)
+    {
+        return Irp->IoStatus.Status;
+    }
+
     /* Get current resources */
     while (TRUE)
     {
@@ -1315,7 +1321,7 @@ Bus_PDO_QueryResourceRequirements(
                                RequirementDescriptor->ShareDisposition = CmResourceShareDriverExclusive;
                                RequirementDescriptor->u.Port.Alignment = io_data->Alignment;
                                RequirementDescriptor->u.Port.MinimumAddress.QuadPart = io_data->Minimum;
-                               RequirementDescriptor->u.Port.MaximumAddress.QuadPart = io_data->Maximum;
+                               RequirementDescriptor->u.Port.MaximumAddress.QuadPart = io_data->Maximum + io_data->AddressLength - 1;
 
                                RequirementDescriptor++;
                                break;
@@ -1330,7 +1336,7 @@ Bus_PDO_QueryResourceRequirements(
                                        RequirementDescriptor->ShareDisposition = CmResourceShareShared;
                                        RequirementDescriptor->Flags = 0;
                                        RequirementDescriptor->u.BusNumber.MinBusNumber = addr16_data->Minimum;
-                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = addr16_data->Maximum;
+                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = addr16_data->Maximum + addr16_data->AddressLength - 1;
                                        RequirementDescriptor->u.BusNumber.Length = addr16_data->AddressLength;
                                }
                                else if (addr16_data->ResourceType == ACPI_IO_RANGE)
@@ -1341,7 +1347,7 @@ Bus_PDO_QueryResourceRequirements(
                                        if (addr16_data->Decode == ACPI_POS_DECODE)
                                                RequirementDescriptor->Flags |= CM_RESOURCE_PORT_POSITIVE_DECODE;
                                        RequirementDescriptor->u.Port.MinimumAddress.QuadPart = addr16_data->Minimum;
-                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr16_data->Maximum;
+                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr16_data->Maximum + addr16_data->AddressLength - 1;
                                        RequirementDescriptor->u.Port.Length = addr16_data->AddressLength;
                                }
                                else
@@ -1360,7 +1366,7 @@ Bus_PDO_QueryResourceRequirements(
                                                case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break;
                                        }
                                        RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = addr16_data->Minimum;
-                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr16_data->Maximum;
+                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr16_data->Maximum + addr16_data->AddressLength - 1;
                                        RequirementDescriptor->u.Memory.Length = addr16_data->AddressLength;
                                }
                                RequirementDescriptor++;
@@ -1376,7 +1382,7 @@ Bus_PDO_QueryResourceRequirements(
                                        RequirementDescriptor->ShareDisposition = CmResourceShareShared;
                                        RequirementDescriptor->Flags = 0;
                                        RequirementDescriptor->u.BusNumber.MinBusNumber = addr32_data->Minimum;
-                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = addr32_data->Maximum;
+                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = addr32_data->Maximum + addr32_data->AddressLength - 1;
                                        RequirementDescriptor->u.BusNumber.Length = addr32_data->AddressLength;
                                }
                                else if (addr32_data->ResourceType == ACPI_IO_RANGE)
@@ -1387,7 +1393,7 @@ Bus_PDO_QueryResourceRequirements(
                                        if (addr32_data->Decode == ACPI_POS_DECODE)
                                                RequirementDescriptor->Flags |= CM_RESOURCE_PORT_POSITIVE_DECODE;
                                        RequirementDescriptor->u.Port.MinimumAddress.QuadPart = addr32_data->Minimum;
-                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr32_data->Maximum;
+                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr32_data->Maximum + addr32_data->AddressLength - 1;
                                        RequirementDescriptor->u.Port.Length = addr32_data->AddressLength;
                                }
                                else
@@ -1406,7 +1412,7 @@ Bus_PDO_QueryResourceRequirements(
                                                case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break;
                                        }
                                        RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = addr32_data->Minimum;
-                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr32_data->Maximum;
+                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr32_data->Maximum + addr32_data->AddressLength - 1;
                                        RequirementDescriptor->u.Memory.Length = addr32_data->AddressLength;
                                }
                                RequirementDescriptor++;
@@ -1423,7 +1429,7 @@ Bus_PDO_QueryResourceRequirements(
                                        RequirementDescriptor->ShareDisposition = CmResourceShareShared;
                                        RequirementDescriptor->Flags = 0;
                                        RequirementDescriptor->u.BusNumber.MinBusNumber = (ULONG)addr64_data->Minimum;
-                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = (ULONG)addr64_data->Maximum;
+                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = (ULONG)addr64_data->Maximum + addr64_data->AddressLength - 1;
                                        RequirementDescriptor->u.BusNumber.Length = addr64_data->AddressLength;
                                }
                                else if (addr64_data->ResourceType == ACPI_IO_RANGE)
@@ -1434,7 +1440,7 @@ Bus_PDO_QueryResourceRequirements(
                                        if (addr64_data->Decode == ACPI_POS_DECODE)
                                                RequirementDescriptor->Flags |= CM_RESOURCE_PORT_POSITIVE_DECODE;
                                        RequirementDescriptor->u.Port.MinimumAddress.QuadPart = addr64_data->Minimum;
-                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr64_data->Maximum;
+                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr64_data->Maximum + addr64_data->AddressLength - 1;
                                        RequirementDescriptor->u.Port.Length = addr64_data->AddressLength;
                                }
                                else
@@ -1453,7 +1459,7 @@ Bus_PDO_QueryResourceRequirements(
                                                case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break;
                                        }       
                                        RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = addr64_data->Minimum;
-                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr64_data->Maximum;
+                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr64_data->Maximum + addr64_data->AddressLength - 1;
                                        RequirementDescriptor->u.Memory.Length = addr64_data->AddressLength;
                                }
                                RequirementDescriptor++;
@@ -1470,7 +1476,7 @@ Bus_PDO_QueryResourceRequirements(
                                        RequirementDescriptor->ShareDisposition = CmResourceShareShared;
                                        RequirementDescriptor->Flags = 0;
                                        RequirementDescriptor->u.BusNumber.MinBusNumber = (ULONG)addr64_data->Minimum;
-                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = (ULONG)addr64_data->Maximum;
+                                       RequirementDescriptor->u.BusNumber.MaxBusNumber = (ULONG)addr64_data->Maximum + addr64_data->AddressLength - 1;
                                        RequirementDescriptor->u.BusNumber.Length = addr64_data->AddressLength;
                                }
                                else if (addr64_data->ResourceType == ACPI_IO_RANGE)
@@ -1481,7 +1487,7 @@ Bus_PDO_QueryResourceRequirements(
                                        if (addr64_data->Decode == ACPI_POS_DECODE)
                                                RequirementDescriptor->Flags |= CM_RESOURCE_PORT_POSITIVE_DECODE;
                                        RequirementDescriptor->u.Port.MinimumAddress.QuadPart = addr64_data->Minimum;
-                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr64_data->Maximum;
+                                       RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr64_data->Maximum + addr64_data->AddressLength - 1;
                                        RequirementDescriptor->u.Port.Length = addr64_data->AddressLength;
                                }
                                else
@@ -1500,7 +1506,7 @@ Bus_PDO_QueryResourceRequirements(
                                                case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_PREFETCHABLE; break;
                                        }       
                                        RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = addr64_data->Minimum;
-                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr64_data->Maximum;
+                                       RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = addr64_data->Maximum + addr64_data->AddressLength - 1;
                                        RequirementDescriptor->u.Memory.Length = addr64_data->AddressLength;
                                }
                                RequirementDescriptor++;
@@ -1518,7 +1524,7 @@ Bus_PDO_QueryResourceRequirements(
                                else
                                        RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
                                RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = mem24_data->Minimum;
-                               RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = mem24_data->Maximum;
+                               RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = mem24_data->Maximum + mem24_data->AddressLength - 1;
                                RequirementDescriptor->u.Memory.Length = mem24_data->AddressLength;
 
                                RequirementDescriptor++;
@@ -1536,7 +1542,7 @@ Bus_PDO_QueryResourceRequirements(
                                else
                                        RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
                                RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = mem32_data->Minimum;
-                               RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = mem32_data->Maximum;
+                               RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = mem32_data->Maximum + mem32_data->AddressLength - 1;
                                RequirementDescriptor->u.Memory.Length = mem32_data->AddressLength;
 
                                RequirementDescriptor++;
@@ -1554,7 +1560,7 @@ Bus_PDO_QueryResourceRequirements(
                                else
                                        RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
                                RequirementDescriptor->u.Memory.MinimumAddress.QuadPart = fixedmem32_data->Address;
-                               RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = fixedmem32_data->Address;
+                               RequirementDescriptor->u.Memory.MaximumAddress.QuadPart = fixedmem32_data->Address + fixedmem32_data->AddressLength - 1;
                                RequirementDescriptor->u.Memory.Length = fixedmem32_data->AddressLength;
                 
                                RequirementDescriptor++;
index 8499ce3..771e19c 100644 (file)
@@ -172,8 +172,7 @@ HalpQueryInterface(IN PDEVICE_OBJECT DeviceObject,
                    OUT PULONG Length)
 {
     UNIMPLEMENTED;
-    while (TRUE);
-    return STATUS_NO_SUCH_DEVICE;
+    return STATUS_NOT_SUPPORTED;
 }
 
 NTSTATUS
index c8648a4..d3a935f 100644 (file)
@@ -164,8 +164,7 @@ HalpQueryInterface(IN PDEVICE_OBJECT DeviceObject,
                    OUT PULONG Length)
 {
     UNIMPLEMENTED;
-    while (TRUE);
-    return STATUS_NO_SUCH_DEVICE;
+    return STATUS_NOT_SUPPORTED;
 }
 
 NTSTATUS
index 2aa2057..41f79d3 100644 (file)
Binary files a/media/inf/keyboard.inf and b/media/inf/keyboard.inf differ
index dae16ed..e33232c 100644 (file)
Binary files a/media/inf/msmouse.inf and b/media/inf/msmouse.inf differ