mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[USBPORT] Use constants in USBPORT_CalculateUsbBandwidth().
This commit is contained in:
parent
41f4814c44
commit
a3dd5620d3
1 changed files with 6 additions and 6 deletions
|
@ -20,7 +20,7 @@ USBPORT_CalculateUsbBandwidth(IN PDEVICE_OBJECT FdoDevice,
|
|||
{
|
||||
PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties;
|
||||
ULONG Bandwidth;
|
||||
ULONG Additional;
|
||||
ULONG Overhead;
|
||||
|
||||
DPRINT("USBPORT_CalculateUsbBandwidth ... \n");
|
||||
|
||||
|
@ -29,25 +29,25 @@ USBPORT_CalculateUsbBandwidth(IN PDEVICE_OBJECT FdoDevice,
|
|||
switch (EndpointProperties->TransferType)
|
||||
{
|
||||
case USBPORT_TRANSFER_TYPE_ISOCHRONOUS:
|
||||
Additional = 9;
|
||||
Overhead = USB2_FS_ISOCHRONOUS_OVERHEAD;
|
||||
break;
|
||||
|
||||
case USBPORT_TRANSFER_TYPE_INTERRUPT:
|
||||
Additional = 13;
|
||||
Overhead = USB2_FS_INTERRUPT_OVERHEAD;
|
||||
break;
|
||||
|
||||
default: //USBPORT_TRANSFER_TYPE_CONTROL or USBPORT_TRANSFER_TYPE_BULK
|
||||
Additional = 0;
|
||||
Overhead = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Additional == 0)
|
||||
if (Overhead == 0)
|
||||
{
|
||||
Bandwidth = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Bandwidth = (EndpointProperties->TotalMaxPacketSize + Additional) * 8 * 7 / 6;
|
||||
Bandwidth = (EndpointProperties->TotalMaxPacketSize + Overhead) * 8 * 7 / 6;
|
||||
}
|
||||
|
||||
if (EndpointProperties->DeviceSpeed == UsbLowSpeed)
|
||||
|
|
Loading…
Reference in a new issue