USBD_CalculateUsbBandwidth function

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

Syntax

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

Parameters

MaxPacketSize

Specifies the maximum packet size.

EndpointType

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

LowSpeed

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.

Remarks

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.

Requirements

   
Windows version Deprecated.
Target Platform Universal
Header usbdlib.h (include Usbdlib.h)
Library Usbd.lib
IRQL "<=DISPATCH_LEVEL"

See Also

USB device driver programming reference

USBD_PIPE_TYPE

Send comments about this topic to Microsoft