USBD_CalculateUsbBandwidth function (usbdlib.h)

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

[in] MaxPacketSize

Specifies the maximum packet size.

[in] EndpointType

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

[in] 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

Requirement Value
Minimum supported client 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