[USBPORT] Add USB2_BIT_STUFFING_OVERHEAD constant.
authorVadim Galyant <vgal@rambler.ru>
Mon, 22 Jan 2018 05:15:57 +0000 (14:15 +0900)
committerVadim Galyant <vgal@rambler.ru>
Mon, 22 Jan 2018 05:15:57 +0000 (14:15 +0900)
drivers/usb/usbport/endpoint.c
drivers/usb/usbport/usbport.h

index 2e9881b..56ad341 100644 (file)
@@ -47,7 +47,7 @@ USBPORT_CalculateUsbBandwidth(IN PDEVICE_OBJECT FdoDevice,
     }
     else
     {
-        Bandwidth = (EndpointProperties->TotalMaxPacketSize + Overhead) * 8 * 7 / 6;
+        Bandwidth = (EndpointProperties->TotalMaxPacketSize + Overhead) * USB2_BIT_STUFFING_OVERHEAD;
     }
 
     if (EndpointProperties->DeviceSpeed == UsbLowSpeed)
index 55c97e5..20386f4 100644 (file)
@@ -479,6 +479,8 @@ typedef struct _TIMER_WORK_QUEUE_ITEM {
 #define USB2_HS_SS_ISOCHRONOUS_IN_OVERHEAD     39
 #define USB2_HS_CS_ISOCHRONOUS_IN_OVERHEAD     38
 
+#define USB2_BIT_STUFFING_OVERHEAD  (8 * (7/6)) // 7.1.9 Bit Stuffing
+
 typedef union _USB2_TT_ENDPOINT_PARAMS {
   struct {
     ULONG TransferType           : 4;