[USBPORT] Add USB2_ChangePeriod().
authorVadim Galyant <vgal@rambler.ru>
Sat, 16 Dec 2017 13:26:50 +0000 (22:26 +0900)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 21 Jan 2018 18:35:55 +0000 (19:35 +0100)
drivers/usb/usbport/usb2.c

index a9ba071..6422719 100644 (file)
@@ -1660,6 +1660,32 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
     return Result;
 }
 
+BOOLEAN
+NTAPI
+USB2_ChangePeriod(IN PUSB2_TT_ENDPOINT TtEndpoint,
+                  IN PUSB2_REBALANCE Rebalance,
+                  IN PULONG RebalanceListEntries)
+{
+    BOOLEAN Result;
+
+    DPRINT("USB2_ChangePeriod: RebalanceListEntries - %X\n",
+           *RebalanceListEntries);
+
+    USB2_DeallocateEndpointBudget(TtEndpoint,
+                                  Rebalance,
+                                  RebalanceListEntries,
+                                  USB2_FRAMES);
+
+    TtEndpoint->PreviosPeriod = TtEndpoint->Period;
+    TtEndpoint->Period = ENDPOINT_INTERRUPT_1ms;
+
+    Result = USB2_AllocateTimeForEndpoint(TtEndpoint,
+                                          Rebalance,
+                                          RebalanceListEntries);
+
+    return Result;
+}
+
 BOOLEAN
 NTAPI
 USB2_PromotePeriods(IN PUSB2_TT_ENDPOINT TtEndpoint,