mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +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;
|
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
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
USBPORT_AllocateBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice,
|
USBPORT_AllocateBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice,
|
||||||
|
|
|
@ -1296,6 +1296,11 @@ USBPORT_FreeBandwidthUSB2(
|
||||||
IN PDEVICE_OBJECT FdoDevice,
|
IN PDEVICE_OBJECT FdoDevice,
|
||||||
IN PUSBPORT_ENDPOINT Endpoint);
|
IN PUSBPORT_ENDPOINT Endpoint);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
USBPORT_UpdateAllocatedBwTt(
|
||||||
|
IN PUSB2_TT_EXTENSION TtExtension);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
USB2_InitTT(
|
USB2_InitTT(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue