https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3031695100f018ffb6f64…
commit 3031695100f018ffb6f648fc0fda0a85bf5e42d1
Author: Vadim Galyant <vgal(a)rambler.ru>
AuthorDate: Mon Dec 11 18:01:07 2017 +0900
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Jan 21 19:35:52 2018 +0100
[USBPORT] Add USB2_CommonFrames().
---
drivers/usb/usbport/usb2.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c
index ade65b4357..0e305b4d11 100644
--- a/drivers/usb/usbport/usb2.c
+++ b/drivers/usb/usbport/usb2.c
@@ -711,6 +711,33 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
return TRUE;
}
+BOOLEAN
+NTAPI
+USB2_CommonFrames(IN PUSB2_TT_ENDPOINT NextTtEndpoint,
+ IN PUSB2_TT_ENDPOINT TtEndpoint)
+{
+ UCHAR Frame;
+
+ DPRINT("USB2_CommonFrames: \n");
+
+ if (NextTtEndpoint->ActualPeriod == ENDPOINT_INTERRUPT_1ms ||
+ TtEndpoint->ActualPeriod == ENDPOINT_INTERRUPT_1ms)
+ {
+ return TRUE;
+ }
+
+ if (NextTtEndpoint->ActualPeriod < TtEndpoint->ActualPeriod)
+ {
+ Frame = TtEndpoint->StartFrame % TtEndpoint->ActualPeriod;
+ }
+ else
+ {
+ Frame = NextTtEndpoint->StartFrame % TtEndpoint->ActualPeriod;
+ }
+
+ return (Frame == TtEndpoint->StartFrame);
+}
+
VOID
NTAPI
USB2_ConvertFrame(IN UCHAR Frame,