https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9cdc1d64b3e2f9f26baeb…
commit 9cdc1d64b3e2f9f26baeb7632de2e4b07696bb62
Author: Vadim Galyant <vgal(a)rambler.ru>
AuthorDate: Mon Nov 27 17:50:47 2017 +0900
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Jan 21 19:35:37 2018 +0100
[USBPORT] Add USB2_InitTT().
---
drivers/usb/usbport/usb2.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c
index c274e6959b..6d71769376 100644
--- a/drivers/usb/usbport/usb2.c
+++ b/drivers/usb/usbport/usb2.c
@@ -27,6 +27,63 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice,
DPRINT1("USBPORT_FreeBandwidthUSB2: UNIMPLEMENTED. FIXME. \n");
}
+VOID
+NTAPI
+USB2_InitTT(IN PUSB2_HC_EXTENSION HcExtension,
+ IN PUSB2_TT Tt)
+{
+ ULONG ix;
+ ULONG jx;
+
+ DPRINT("USB2_InitTT: HcExtension - %p, Tt - %p\n", HcExtension, Tt);
+
+ Tt->HcExtension = HcExtension;
+ Tt->DelayTime = 1;
+ Tt->MaxTime = USB2_FS_MAX_PERIODIC_ALLOCATION;
+
+ for (ix = 0; ix < USB2_FRAMES; ix++)
+ {
+ Tt->FrameBudget[ix].TimeUsed = USB2_MAX_MICROFRAMES;
+ Tt->FrameBudget[ix].AltEndpoint = NULL;
+
+ for (jx = 0; jx < USB2_MICROFRAMES; jx++)
+ {
+ Tt->TimeCS[ix][jx] = 0;
+ Tt->NumStartSplits[ix][jx] = 0;
+ }
+
+ Tt->FrameBudget[ix].IsoEndpoint = &Tt->IsoEndpoint[ix];
+
+ USB2_InitTtEndpoint(&Tt->IsoEndpoint[ix],
+ USBPORT_TRANSFER_TYPE_ISOCHRONOUS,
+ USBPORT_TRANSFER_DIRECTION_OUT,
+ UsbFullSpeed,
+ USB2_FRAMES,
+ 0,
+ Tt);
+
+ Tt->IsoEndpoint[ix].ActualPeriod = USB2_FRAMES;
+ Tt->IsoEndpoint[ix].CalcBusTime = USB2_FS_SOF_TIME + USB2_HUB_DELAY;
+ Tt->IsoEndpoint[ix].StartFrame = ix;
+ Tt->IsoEndpoint[ix].StartMicroframe = 0xFF;
+
+ Tt->FrameBudget[ix].IntEndpoint = &Tt->IntEndpoint[ix];
+
+ USB2_InitTtEndpoint(&Tt->IntEndpoint[ix],
+ USBPORT_TRANSFER_TYPE_INTERRUPT,
+ USBPORT_TRANSFER_DIRECTION_OUT,
+ UsbFullSpeed,
+ USB2_FRAMES,
+ 0,
+ Tt);
+
+ Tt->IntEndpoint[ix].ActualPeriod = USB2_FRAMES;
+ Tt->IntEndpoint[ix].CalcBusTime = USB2_FS_SOF_TIME + USB2_HUB_DELAY;
+ Tt->IntEndpoint[ix].StartFrame = ix;
+ Tt->IntEndpoint[ix].StartMicroframe = 0xFF;
+ }
+}
+
VOID
NTAPI
USB2_InitController(IN PUSB2_HC_EXTENSION HcExtension)