https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f37a3dc42fb08d7c4ebde…
commit f37a3dc42fb08d7c4ebdeefb8c369b6c2f21a2e4
Author: Vadim Galyant <vgal(a)rambler.ru>
AuthorDate: Mon Jan 22 14:15:57 2018 +0900
Commit: Vadim Galyant <vgal(a)rambler.ru>
CommitDate: Mon Jan 22 14:15:57 2018 +0900
[USBPORT] Add USB2_BIT_STUFFING_OVERHEAD constant.
---
drivers/usb/usbport/endpoint.c | 2 +-
drivers/usb/usbport/usbport.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c
index 2e9881bff2..56ad3411b2 100644
--- a/drivers/usb/usbport/endpoint.c
+++ b/drivers/usb/usbport/endpoint.c
@@ -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)
diff --git a/drivers/usb/usbport/usbport.h b/drivers/usb/usbport/usbport.h
index 55c97e5330..20386f4845 100644
--- a/drivers/usb/usbport/usbport.h
+++ b/drivers/usb/usbport/usbport.h
@@ -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;