mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 06:55:55 +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;
|
PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties;
|
||||||
ULONG Bandwidth;
|
ULONG Bandwidth;
|
||||||
ULONG Additional;
|
ULONG Overhead;
|
||||||
|
|
||||||
DPRINT("USBPORT_CalculateUsbBandwidth ... \n");
|
DPRINT("USBPORT_CalculateUsbBandwidth ... \n");
|
||||||
|
|
||||||
|
@ -29,25 +29,25 @@ USBPORT_CalculateUsbBandwidth(IN PDEVICE_OBJECT FdoDevice,
|
||||||
switch (EndpointProperties->TransferType)
|
switch (EndpointProperties->TransferType)
|
||||||
{
|
{
|
||||||
case USBPORT_TRANSFER_TYPE_ISOCHRONOUS:
|
case USBPORT_TRANSFER_TYPE_ISOCHRONOUS:
|
||||||
Additional = 9;
|
Overhead = USB2_FS_ISOCHRONOUS_OVERHEAD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case USBPORT_TRANSFER_TYPE_INTERRUPT:
|
case USBPORT_TRANSFER_TYPE_INTERRUPT:
|
||||||
Additional = 13;
|
Overhead = USB2_FS_INTERRUPT_OVERHEAD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: //USBPORT_TRANSFER_TYPE_CONTROL or USBPORT_TRANSFER_TYPE_BULK
|
default: //USBPORT_TRANSFER_TYPE_CONTROL or USBPORT_TRANSFER_TYPE_BULK
|
||||||
Additional = 0;
|
Overhead = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Additional == 0)
|
if (Overhead == 0)
|
||||||
{
|
{
|
||||||
Bandwidth = 0;
|
Bandwidth = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bandwidth = (EndpointProperties->TotalMaxPacketSize + Additional) * 8 * 7 / 6;
|
Bandwidth = (EndpointProperties->TotalMaxPacketSize + Overhead) * 8 * 7 / 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EndpointProperties->DeviceSpeed == UsbLowSpeed)
|
if (EndpointProperties->DeviceSpeed == UsbLowSpeed)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue