USB 2.5.0 -> 2.6.14.3 upgrade: Store actual bus number by querying upper-laying driver.
authorAleksey Bragin <aleksey@reactos.org>
Tue, 27 Dec 2005 21:01:58 +0000 (21:01 +0000)
committerAleksey Bragin <aleksey@reactos.org>
Tue, 27 Dec 2005 21:01:58 +0000 (21:01 +0000)
svn path=/trunk/; revision=20378

reactos/drivers/usb/miniport/common/fdo.c

index 1eb165f..0a6c3f6 100644 (file)
@@ -58,6 +58,8 @@ UsbMpFdoStartDevice(
        PUSBMP_DRIVER_EXTENSION DriverExtension;
        PUSBMP_DEVICE_EXTENSION DeviceExtension;
        PCM_RESOURCE_LIST AllocatedResources;
+       ULONG Size;
+       NTSTATUS Status;
 
        if (DeviceObject == KeyboardFdo || DeviceObject == MouseFdo)
                return STATUS_SUCCESS;
@@ -142,6 +144,23 @@ UsbMpFdoStartDevice(
                DeviceExtension->BaseAddress,
                DeviceExtension->BaseAddrLength);
 
+       /* Get bus number from the upper level bus driver. */
+       Size = sizeof(ULONG);
+       Status = IoGetDeviceProperty(
+               DeviceExtension->PhysicalDeviceObject,
+               DevicePropertyBusNumber,
+               Size,
+               &DeviceExtension->SystemIoBusNumber,
+               &Size);
+
+       if (!NT_SUCCESS(Status))
+       {
+               DPRINT1("USBMP: IoGetDeviceProperty DevicePropertyBusNumber failed\n");
+               DeviceExtension->SystemIoBusNumber = 0;
+       }
+
+       DPRINT("USBMP: Busnumber %d\n", DeviceExtension->SystemIoBusNumber);
+
        /* Init wrapper with this object */
        return InitLinuxWrapper(DeviceObject);
 }