https://git.reactos.org/?p=reactos.git;a=commitdiff;h=faa792987b0cfab494154…
commit faa792987b0cfab49415498bcc066d3931266c91
Author: Vadim Galyant <vgal(a)rambler.ru>
AuthorDate: Mon Nov 27 17:41:08 2017 +0900
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Jan 21 19:35:36 2018 +0100
[USBPORT] Add initial support for transaction translators in USBPORT_AddDevice().
---
drivers/usb/usbport/usbport.c | 19 ++++++++++++++++++-
drivers/usb/usbport/usbport.h | 7 ++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/usbport/usbport.c b/drivers/usb/usbport/usbport.c
index 09286465bb..1dbe779daa 100644
--- a/drivers/usb/usbport/usbport.c
+++ b/drivers/usb/usbport/usbport.c
@@ -1845,7 +1845,8 @@ USBPORT_AddDevice(IN PDRIVER_OBJECT DriverObject,
RtlInitUnicodeString(&DeviceName, CharDeviceName);
Length = sizeof(USBPORT_DEVICE_EXTENSION) +
- MiniPortInterface->Packet.MiniPortExtensionSize;
+ MiniPortInterface->Packet.MiniPortExtensionSize +
+ sizeof(USB2_HC_EXTENSION);
/* Create device */
Status = IoCreateDevice(DriverObject,
@@ -1903,6 +1904,22 @@ USBPORT_AddDevice(IN PDRIVER_OBJECT DriverObject,
FdoExtension->MiniPortExt = (PVOID)((ULONG_PTR)FdoExtension +
sizeof(USBPORT_DEVICE_EXTENSION));
+ if (MiniPortInterface->Packet.MiniPortFlags & USB_MINIPORT_FLAGS_USB2)
+ {
+ FdoExtension->Usb2Extension =
+ (PUSB2_HC_EXTENSION)FdoExtension->MiniPortExt +
+ MiniPortInterface->Packet.MiniPortExtensionSize;
+
+ DPRINT("USBPORT_AddDevice: Usb2Extension - %p\n",
+ FdoExtension->Usb2Extension);
+
+ USB2_InitController(FdoExtension->Usb2Extension);
+ }
+ else
+ {
+ FdoExtension->Usb2Extension = NULL;
+ }
+
FdoExtension->MiniPortInterface = MiniPortInterface;
FdoExtension->FdoNameNumber = DeviceNumber;
diff --git a/drivers/usb/usbport/usbport.h b/drivers/usb/usbport/usbport.h
index b838baff0d..5145c26e92 100644
--- a/drivers/usb/usbport/usbport.h
+++ b/drivers/usb/usbport/usbport.h
@@ -153,6 +153,9 @@ typedef struct _USBPORT_COMMON_BUFFER_HEADER {
typedef struct _USBPORT_ENDPOINT *PUSBPORT_ENDPOINT;
+typedef struct _USB2_HC_EXTENSION *PUSB2_HC_EXTENSION;
+typedef struct _USB2_TT *PUSB2_TT;
+
typedef struct _USBPORT_PIPE_HANDLE {
ULONG Flags;
ULONG PipeFlags;
@@ -374,10 +377,12 @@ typedef struct _USBPORT_DEVICE_EXTENSION {
KSPIN_LOCK SetPowerD0SpinLock;
KDPC WorkerRequestDpc;
KDPC HcWakeDpc;
+ /* Usb 2.0 HC Extension */
+ PUSB2_HC_EXTENSION Usb2Extension;
/* Miniport extension should be aligned on 0x100 */
#if !defined(_M_X64)
- ULONG Padded[34];
+ ULONG Padded[33];
#else
ULONG Padded[0];
#endif