mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 20:01:23 +00:00
[USBPORT] Implement USB2_MoveTtEndpoint().
This commit is contained in:
parent
c48093573b
commit
ae800da85b
2 changed files with 76 additions and 4 deletions
|
@ -634,9 +634,81 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
|
||||||
IN ULONG RebalanceListEntries,
|
IN ULONG RebalanceListEntries,
|
||||||
OUT BOOLEAN * OutResult)
|
OUT BOOLEAN * OutResult)
|
||||||
{
|
{
|
||||||
DPRINT("USB2_MoveTtEndpoint: UNIMPLEMENTED FIXME\n");
|
ULONG EndBusTime;
|
||||||
ASSERT(FALSE);
|
ULONG TransferType;
|
||||||
|
ULONG Num;
|
||||||
|
UCHAR ix;
|
||||||
|
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: TtEndpoint - %p, BusTime - %X\n",
|
||||||
|
TtEndpoint,
|
||||||
|
BusTime);
|
||||||
|
|
||||||
|
*OutResult = TRUE;
|
||||||
|
|
||||||
|
for (Num = 0; Rebalance->RebalanceEndpoint[Num]; Num++)
|
||||||
|
{
|
||||||
|
if (Rebalance->RebalanceEndpoint[Num] == TtEndpoint)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: Num - %X\n", Num);
|
||||||
|
|
||||||
|
TransferType = TtEndpoint->TtEndpointParams.TransferType;
|
||||||
|
|
||||||
|
if (Rebalance->RebalanceEndpoint[Num] &&
|
||||||
|
TtEndpoint->TtEndpointParams.EndpointMoved == TRUE &&
|
||||||
|
(TransferType != USBPORT_TRANSFER_TYPE_INTERRUPT || BusTime >= 0))
|
||||||
|
{
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: result - FALSE\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ix = 0;
|
||||||
|
(TtEndpoint->StartFrame + ix) < USB2_FRAMES;
|
||||||
|
ix += TtEndpoint->ActualPeriod)
|
||||||
|
{
|
||||||
|
USB2_DeallocateHS(TtEndpoint, ix);
|
||||||
|
}
|
||||||
|
|
||||||
|
TtEndpoint->StartTime += BusTime;
|
||||||
|
|
||||||
|
EndBusTime = TtEndpoint->StartTime + TtEndpoint->CalcBusTime;
|
||||||
|
|
||||||
|
if (EndBusTime > USB2_FS_MAX_PERIODIC_ALLOCATION)
|
||||||
|
{
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: EndBusTime is too large!\n");
|
||||||
|
*OutResult = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TtEndpoint->TtEndpointParams.EndpointMoved = TRUE;
|
||||||
|
|
||||||
|
if (Rebalance->RebalanceEndpoint[Num] == NULL)
|
||||||
|
{
|
||||||
|
if (Num >= RebalanceListEntries)
|
||||||
|
{
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: Too many changes!\n");
|
||||||
|
*OutResult = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Rebalance->RebalanceEndpoint[Num] = TtEndpoint;
|
||||||
|
Rebalance->RebalanceEndpoint[Num + 1] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ix = 0;
|
||||||
|
(TtEndpoint->StartFrame + ix) < USB2_FRAMES;
|
||||||
|
ix += TtEndpoint->ActualPeriod)
|
||||||
|
{
|
||||||
|
if (!USB2_AllocateHS(TtEndpoint, ix))
|
||||||
|
{
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: OutResult - FALSE\n");
|
||||||
|
OutResult = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT("USB2_MoveTtEndpoint: result - TRUE\n");
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -483,7 +483,7 @@ typedef union _USB2_TT_ENDPOINT_PARAMS {
|
||||||
ULONG TransferType : 4;
|
ULONG TransferType : 4;
|
||||||
ULONG Direction : 1;
|
ULONG Direction : 1;
|
||||||
USB_DEVICE_SPEED DeviceSpeed : 2;
|
USB_DEVICE_SPEED DeviceSpeed : 2;
|
||||||
ULONG EndpointMoved : 1;
|
BOOL EndpointMoved : 1;
|
||||||
ULONG Reserved : 24;
|
ULONG Reserved : 24;
|
||||||
};
|
};
|
||||||
ULONG AsULONG;
|
ULONG AsULONG;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue