https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cbba6e80fce48aaf1163603738d1b09a8eef88f5

commit cbba6e80fce48aaf1163603738d1b09a8eef88f5
Author:     Vadim Galyant <[email protected]>
AuthorDate: Tue Nov 28 15:19:46 2017 +0900
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sun Jan 21 19:35:41 2018 +0100

    [USBPORT] Correcting USBPORT_InitializeDevice() and USBPORT_RestoreDevice() 
(DEVICE_HANDLE_FLAG_USB2HUB).
---
 drivers/usb/usbport/device.c  | 12 +++++++++++-
 drivers/usb/usbport/usbport.h |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/usbport/device.c b/drivers/usb/usbport/device.c
index f1cb04eb47..7ba54f594e 100644
--- a/drivers/usb/usbport/device.c
+++ b/drivers/usb/usbport/device.c
@@ -1377,6 +1377,12 @@ USBPORT_InitializeDevice(IN PUSBPORT_DEVICE_HANDLE 
DeviceHandle,
                (MaxPacketSize == 16) ||
                (MaxPacketSize == 32) ||
                (MaxPacketSize == 64));
+
+        if (DeviceHandle->DeviceSpeed == UsbHighSpeed &&
+            DeviceHandle->DeviceDescriptor.bDeviceClass == 
USB_DEVICE_CLASS_HUB)
+        {
+            DeviceHandle->Flags |= DEVICE_HANDLE_FLAG_USB2HUB;
+        }
     }
     else
     {
@@ -1761,10 +1767,14 @@ USBPORT_RestoreDevice(IN PDEVICE_OBJECT FdoDevice,
             }
         }
 
-        if (NewDeviceHandle->Flags & DEVICE_HANDLE_FLAG_INITIALIZED)
+        if (NewDeviceHandle->Flags & DEVICE_HANDLE_FLAG_USB2HUB)
         {
             DPRINT1("USBPORT_RestoreDevice: FIXME Transaction Translator\n");
             NewDeviceHandle->TtCount = OldDeviceHandle->TtCount;
+
+#ifndef NDEBUG
+            DbgBreakPoint();
+#endif
         }
 
         while (!IsListEmpty(&OldDeviceHandle->PipeHandleList))
diff --git a/drivers/usb/usbport/usbport.h b/drivers/usb/usbport/usbport.h
index 3bba591f06..940c944c48 100644
--- a/drivers/usb/usbport/usbport.h
+++ b/drivers/usb/usbport/usbport.h
@@ -104,7 +104,7 @@
 /* Device handle Flags (USBPORT_DEVICE_HANDLE) */
 #define DEVICE_HANDLE_FLAG_ROOTHUB     0x00000002
 #define DEVICE_HANDLE_FLAG_REMOVED     0x00000008
-#define DEVICE_HANDLE_FLAG_INITIALIZED 0x00000010
+#define DEVICE_HANDLE_FLAG_USB2HUB     0x00000010
 
 /* Endpoint Flags (USBPORT_ENDPOINT) */
 #define ENDPOINT_FLAG_DMA_TYPE      0x00000001

Reply via email to