*OverheadSS = HostDelay + USB2_HS_SS_INTERRUPT_IN_OVERHEAD;
*OverheadCS = HostDelay + USB2_HS_CS_INTERRUPT_IN_OVERHEAD;
}
-
- //DPRINT("USB2_GetHsOverhead: *OverheadSS - %X, *OverheadCS - %X\n",
- // *OverheadSS,
- // *OverheadCS);
}
}
uframe = TtEndpoint->StartMicroframe;
if (TtEndpoint->StartMicroframe == 0xFF)
- {
USB2_GetPrevMicroFrame(&frame, &uframe);
- }
for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++)
{
uframe = TtEndpoint->StartMicroframe;
if (TtEndpoint->StartMicroframe == 0xFF)
- {
USB2_GetPrevMicroFrame(&frame, &uframe);
- }
DataTime = 0;
DataSize = PktSizeBitStuff - DataTime;
if (DataSize <= USB2_FS_RAW_BYTES_IN_MICROFRAME)
- {
CurrentDataTime = PktSizeBitStuff - DataTime;
- }
else
- {
CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME;
- }
HcExtension->TimeUsed[frame][uframe] -= CurrentDataTime;
USB2_IncMicroFrame(&frame, &uframe);
for (ix = 0; ix < TtEndpoint->Nums.NumCompletes; ix++)
{
if (PktSizeBitStuff >= USB2_FS_RAW_BYTES_IN_MICROFRAME)
- {
CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME;
- }
else
- {
CurrentDataTime = PktSizeBitStuff;
- }
Tt->TimeCS[frame][uframe] -= CurrentDataTime;
}
if (NextTtEndpoint->ActualPeriod < TtEndpoint->ActualPeriod)
- {
Frame = TtEndpoint->StartFrame % TtEndpoint->ActualPeriod;
- }
else
- {
Frame = NextTtEndpoint->StartFrame % TtEndpoint->ActualPeriod;
- }
return (Frame == TtEndpoint->StartFrame);
}
Direction = TtEndpoint->TtEndpointParams.Direction;
if (DeviceSpeed == UsbHighSpeed)
- {
return 0;
- }
if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT)
{
else
{
if (Direction == USBPORT_TRANSFER_DIRECTION_OUT)
- {
return 0;
- }
USB2_ConvertFrame(TtEndpoint->StartFrame,
TtEndpoint->StartMicroframe,
NumCompletes--;
if (!NumCompletes)
- {
return MaskCS;
- }
}
for (; NumCompletes; NumCompletes--)
if (Endpoint->EndpointProperties.Period != NewPeriod)
{
+ ASSERT(Endpoint->EndpointProperties.Period);
Factor = USB2_FRAMES / Endpoint->EndpointProperties.Period;
- ASSERT(Factor);
for (ix = 0; ix < Factor; ix++)
{
Endpoint->EndpointProperties.ScheduleOffset = ScheduleOffset;
Endpoint->EndpointProperties.UsbBandwidth = EndpointBandwidth;
+ ASSERT(NewPeriod);
Factor = USB2_FRAMES / NewPeriod;
- ASSERT(Factor);
for (ix = 0; ix < Factor; ix++)
{
}
if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT)
- {
endpoint = Tt->FrameBudget[frame].IntEndpoint;
- }
else
- {
endpoint = Tt->FrameBudget[frame].IsoEndpoint;
- }
nextEndpoint = endpoint->NextTtEndpoint;
}
if (Speed == UsbLowSpeed)
- {
TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize * 8 + Overhead;
- }
else
- {
TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize + Overhead;
- }
LatestStart = USB2_HUB_DELAY + USB2_FS_SOF_TIME;
nextEndpoint = nextEndpoint->NextTtEndpoint)
{
if (USB2_CheckTtEndpointInsert(nextEndpoint, TtEndpoint))
- {
break;
- }
prevEndpoint = nextEndpoint;
}
prevEndpoint,
frame);
- if (StartTime > LatestStart)
- LatestStart = StartTime;
+ LatestStart = max(LatestStart, StartTime);
}
TtEndpoint->StartTime = LatestStart;
ScheduleOffset = Endpoint->TtEndpoint->StartFrame;
EndpointProperties->ScheduleOffset = ScheduleOffset;
+ ASSERT(ActualPeriod);
Factor = USB2_FRAMES / ActualPeriod;
- ASSERT(Factor);
n = ScheduleOffset * Factor;
USB2_Rebalance(FdoDevice, &RebalanceList);
if (!TtExtension)
- {
return;
- }
for (ix = 0; ix < USB2_FRAMES; ix++)
{