mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs for root USB hubs.
The vendor and device IDs are not filled in Cromwell code, so ask directly the PCI device to retrieve the information svn path=/trunk/; revision=17981
This commit is contained in:
parent
752fed43fb
commit
4a4df71398
1 changed files with 43 additions and 6 deletions
|
@ -104,18 +104,55 @@ UsbMpPdoQueryId(
|
||||||
{
|
{
|
||||||
CHAR Buffer[2][40];
|
CHAR Buffer[2][40];
|
||||||
PCHAR RootHubName;
|
PCHAR RootHubName;
|
||||||
USHORT Vendor, Product, Revision;
|
PCI_COMMON_CONFIG PciData;
|
||||||
|
ULONG BusNumber, SlotNumber;
|
||||||
|
ULONG ret;
|
||||||
|
PDEVICE_OBJECT Pdo;
|
||||||
|
|
||||||
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
|
DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
|
||||||
|
|
||||||
Vendor = DeviceExtension->pdev->vendor;
|
Pdo = DeviceExtension->PhysicalDeviceObject;
|
||||||
Product = DeviceExtension->pdev->device;
|
Status = IoGetDeviceProperty(
|
||||||
Revision = 0; /* FIXME */
|
Pdo,
|
||||||
|
DevicePropertyBusNumber,
|
||||||
|
sizeof(ULONG),
|
||||||
|
&BusNumber,
|
||||||
|
&ret);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("USBMP: IoGetDeviceProperty() failed with status 0x%08lx\n", Status);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = IoGetDeviceProperty(
|
||||||
|
Pdo,
|
||||||
|
DevicePropertyAddress,
|
||||||
|
sizeof(ULONG),
|
||||||
|
&SlotNumber,
|
||||||
|
&ret);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT("USBMP: IoGetDeviceProperty() failed with status 0x%08lx\n", Status);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = HalGetBusDataByOffset(PCIConfiguration,
|
||||||
|
BusNumber,
|
||||||
|
SlotNumber,
|
||||||
|
&PciData,
|
||||||
|
0,
|
||||||
|
PCI_COMMON_HDR_LENGTH);
|
||||||
|
if (ret != PCI_COMMON_HDR_LENGTH)
|
||||||
|
{
|
||||||
|
DPRINT("USBMP: HalGetBusDataByOffset() failed (ret = %ld)\n", ret);
|
||||||
|
Status = STATUS_IO_DEVICE_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(Buffer[0], "USB\\VID%04X&PID%04X&REV%04X",
|
sprintf(Buffer[0], "USB\\VID%04X&PID%04X&REV%04X",
|
||||||
Vendor, Product, Revision);
|
PciData.VendorID, PciData.DeviceID, PciData.RevisionID);
|
||||||
sprintf(Buffer[1], "USB\\VID%04X&PID%04X",
|
sprintf(Buffer[1], "USB\\VID%04X&PID%04X",
|
||||||
Vendor, Product);
|
PciData.VendorID, PciData.DeviceID);
|
||||||
if (roothub->speed == USB_SPEED_LOW || roothub->speed == USB_SPEED_FULL)
|
if (roothub->speed == USB_SPEED_LOW || roothub->speed == USB_SPEED_FULL)
|
||||||
RootHubName = "USB\\ROOT_HUB"; /* USB 1.1 */
|
RootHubName = "USB\\ROOT_HUB"; /* USB 1.1 */
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue