[USBPORT] Add initial support for transaction translators in USBPORT_AddDevice().

This commit is contained in:
Vadim Galyant 2017-11-27 17:41:08 +09:00 committed by Amine Khaldi
parent 0b78ad8eb2
commit faa792987b
2 changed files with 24 additions and 2 deletions

View file

@ -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;

View file

@ -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