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

commit a3dd5620d3758a45e3afd29c9b4a45a9633330d6
Author:     Vadim Galyant <[email protected]>
AuthorDate: Mon Nov 27 16:27:49 2017 +0900
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sun Jan 21 19:35:35 2018 +0100

    [USBPORT] Use constants in USBPORT_CalculateUsbBandwidth().
---
 drivers/usb/usbport/endpoint.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c
index 7cf250e76c..d2005a87d2 100644
--- a/drivers/usb/usbport/endpoint.c
+++ b/drivers/usb/usbport/endpoint.c
@@ -20,7 +20,7 @@ USBPORT_CalculateUsbBandwidth(IN PDEVICE_OBJECT FdoDevice,
 {
     PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties;
     ULONG Bandwidth;
-    ULONG Additional;
+    ULONG Overhead;
 
     DPRINT("USBPORT_CalculateUsbBandwidth ... \n");
 
@@ -29,25 +29,25 @@ USBPORT_CalculateUsbBandwidth(IN PDEVICE_OBJECT FdoDevice,
     switch (EndpointProperties->TransferType)
     {
         case USBPORT_TRANSFER_TYPE_ISOCHRONOUS:
-            Additional = 9;
+            Overhead = USB2_FS_ISOCHRONOUS_OVERHEAD;
             break;
 
         case USBPORT_TRANSFER_TYPE_INTERRUPT:
-            Additional = 13;
+            Overhead = USB2_FS_INTERRUPT_OVERHEAD;
             break;
 
         default: //USBPORT_TRANSFER_TYPE_CONTROL or USBPORT_TRANSFER_TYPE_BULK
-            Additional = 0;
+            Overhead = 0;
             break;
     }
 
-    if (Additional == 0)
+    if (Overhead == 0)
     {
         Bandwidth = 0;
     }
     else
     {
-        Bandwidth = (EndpointProperties->TotalMaxPacketSize + Additional) * 8 
* 7 / 6;
+        Bandwidth = (EndpointProperties->TotalMaxPacketSize + Overhead) * 8 * 
7 / 6;
     }
 
     if (EndpointProperties->DeviceSpeed == UsbLowSpeed)

Reply via email to