https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f8079df3a98336576dadc06d2d7fd99a13499b7

commit 0f8079df3a98336576dadc06d2d7fd99a13499b7
Author:     Vadim Galyant <[email protected]>
AuthorDate: Thu Jan 11 14:23:49 2018 +0900
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sun Jan 21 19:35:59 2018 +0100

    [USBPORT] Add USB2_PREV_MICROFRAME constant.
---
 drivers/usb/usbport/usb2.c    | 14 +++++++-------
 drivers/usb/usbport/usbport.h |  1 +
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c
index cc833e308f..6c1e23ddbb 100644
--- a/drivers/usb/usbport/usb2.c
+++ b/drivers/usb/usbport/usb2.c
@@ -377,7 +377,7 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
     frame = TtEndpoint->StartFrame + Frame;
     uframe = TtEndpoint->StartMicroframe;
 
-    if (TtEndpoint->StartMicroframe == 0xFF)
+    if (TtEndpoint->StartMicroframe == USB2_PREV_MICROFRAME)
         USB2_GetPrevMicroFrame(&frame, &uframe);
 
     for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++)
@@ -426,7 +426,7 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
         frame = TtEndpoint->StartFrame + Frame;
         uframe = TtEndpoint->StartMicroframe;
 
-        if (uframe == 0xFF)
+        if (uframe == USB2_PREV_MICROFRAME)
             USB2_GetPrevMicroFrame(&frame, &uframe);
 
         DataTime = 0;
@@ -535,7 +535,7 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
     frame = TtEndpoint->StartFrame + Frame;
     uframe = TtEndpoint->StartMicroframe;
 
-    if (TtEndpoint->StartMicroframe == 0xFF)
+    if (TtEndpoint->StartMicroframe == USB2_PREV_MICROFRAME)
         USB2_GetPrevMicroFrame(&frame, &uframe);
 
     for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++)
@@ -563,7 +563,7 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
         frame = TtEndpoint->StartFrame + Frame;
         uframe = TtEndpoint->StartMicroframe;
 
-        if (TtEndpoint->StartMicroframe == 0xFF)
+        if (TtEndpoint->StartMicroframe == USB2_PREV_MICROFRAME)
             USB2_GetPrevMicroFrame(&frame, &uframe);
 
         DataTime = 0;
@@ -733,7 +733,7 @@ USB2_ConvertFrame(IN UCHAR Frame,
            Frame,
            Microframe);
 
-    if (Microframe == 0xFF)
+    if (Microframe == USB2_PREV_MICROFRAME)
     {
         *HcFrame = Frame;
         *HcMicroframe = 0;
@@ -2202,7 +2202,7 @@ USB2_InitTT(IN PUSB2_HC_EXTENSION HcExtension,
         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->IsoEndpoint[ix].StartMicroframe = USB2_PREV_MICROFRAME;
 
         Tt->FrameBudget[ix].IntEndpoint = &Tt->IntEndpoint[ix];
 
@@ -2217,7 +2217,7 @@ USB2_InitTT(IN PUSB2_HC_EXTENSION HcExtension,
         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;
+        Tt->IntEndpoint[ix].StartMicroframe = USB2_PREV_MICROFRAME;
     }
 }
 
diff --git a/drivers/usb/usbport/usbport.h b/drivers/usb/usbport/usbport.h
index 682e4e1f74..55c97e5330 100644
--- a/drivers/usb/usbport/usbport.h
+++ b/drivers/usb/usbport/usbport.h
@@ -451,6 +451,7 @@ typedef struct _TIMER_WORK_QUEUE_ITEM {
 #define USB2_FRAMES           32
 #define USB2_MICROFRAMES      8
 #define USB2_MAX_MICROFRAMES  (USB2_FRAMES * USB2_MICROFRAMES)
+#define USB2_PREV_MICROFRAME  0xFF
 
 #define USB2_MAX_MICROFRAME_ALLOCATION         7000 // bytes
 #define USB2_CONTROLLER_DELAY                  100

Reply via email to