USBD_CalculateUsbBandwidth function

The USBD_CalculateUsbBandwidth routine has been deprecated in Windows XP and later operating systems. Do not use.


ULONG USBD_CalculateUsbBandwidth(
  _In_ ULONG   MaxPacketSize,
  _In_ UCHAR   EndpointType,
  _In_ BOOLEAN LowSpeed



Specifies the maximum packet size.


Contains a value of type USBD_PIPE_TYPE that specifies the pipe type.


Indicates, when TRUE, that the device is a low speed device. When FALSE, this member indicates that the device is a hi-speed device.

Return Value

The USBD_CalculateUsbBandwidth routine returns zero for bulk and control endpoints and the bandwidth consumed in bits per millisecond. returns for all other endpoints.


The USBD_CalculateUsbBandwidth routine approximates the bandwidth using the following procedure. First, USBD_CalculateUsbBandwidth adds the largest possible packet size, specified in MaxPacketSize, to the overhead associated with the type of end point specified in EndpointType. Next, USBD_CalculateUsbBandwidth multiplies this sum by 8 to convert the units from bytes per millisecond into bits per millisecond. Finally, USBD_CalculateUsbBandwidth multiplies this quantity by 7/6 to account for filler bits. In a worst case scenario, there will be one bit of filler data stuffed into the data stream for every six bits of data. USBD_CalculateUsbBandwidth uses worst-case assumptions to calculate the bandwidth required by the pipe.


Windows version Deprecated.
Target Platform Universal
Header usbdlib.h (include Usbdlib.h)
Library Usbd.lib

See Also

USB device driver programming reference


Send comments about this topic to Microsoft