USB 2.5.0 -> 2.6.14.3 upgrade: Store actual bus number by querying upper-laying driver.
Modified: trunk/reactos/drivers/usb/miniport/common/fdo.c

Modified: trunk/reactos/drivers/usb/miniport/common/fdo.c
--- trunk/reactos/drivers/usb/miniport/common/fdo.c	2005-12-27 21:00:19 UTC (rev 20377)
+++ trunk/reactos/drivers/usb/miniport/common/fdo.c	2005-12-27 21:01:58 UTC (rev 20378)
@@ -58,6 +58,8 @@
 	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 @@
 		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);
 }