mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[USBPORT] Add USBPORT_UpdateAllocatedBwTt().
This commit is contained in:
parent
18702047a1
commit
e48d6136ec
2 changed files with 39 additions and 0 deletions
|
@ -31,6 +31,40 @@ USB2_InitTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
|
|||
TtEndpoint->Tt = Tt;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
USBPORT_UpdateAllocatedBwTt(IN PUSB2_TT_EXTENSION TtExtension)
|
||||
{
|
||||
ULONG BusBandwidth;
|
||||
ULONG NewBusBandwidth;
|
||||
ULONG MaxBusBandwidth = 0;
|
||||
ULONG MinBusBandwidth;
|
||||
ULONG ix;
|
||||
|
||||
DPRINT("USBPORT_UpdateAllocatedBwTt: TtExtension - %p\n", TtExtension);
|
||||
|
||||
BusBandwidth = TtExtension->BusBandwidth;
|
||||
MinBusBandwidth = BusBandwidth;
|
||||
|
||||
for (ix = 0; ix < USB2_FRAMES; ix++)
|
||||
{
|
||||
NewBusBandwidth = BusBandwidth - TtExtension->Bandwidth[ix];
|
||||
|
||||
if (NewBusBandwidth > MaxBusBandwidth)
|
||||
MaxBusBandwidth = NewBusBandwidth;
|
||||
|
||||
if (NewBusBandwidth < MinBusBandwidth)
|
||||
MinBusBandwidth = NewBusBandwidth;
|
||||
}
|
||||
|
||||
TtExtension->MaxBandwidth = MaxBusBandwidth;
|
||||
|
||||
if (MinBusBandwidth == BusBandwidth)
|
||||
TtExtension->MinBandwidth = 0;
|
||||
else
|
||||
TtExtension->MinBandwidth = MinBusBandwidth;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
USBPORT_AllocateBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice,
|
||||
|
|
|
@ -1296,6 +1296,11 @@ USBPORT_FreeBandwidthUSB2(
|
|||
IN PDEVICE_OBJECT FdoDevice,
|
||||
IN PUSBPORT_ENDPOINT Endpoint);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
USBPORT_UpdateAllocatedBwTt(
|
||||
IN PUSB2_TT_EXTENSION TtExtension);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
USB2_InitTT(
|
||||
|
|
Loading…
Reference in a new issue