13#define NDEBUG_EHCI_TRACE
98 0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30,
99 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31
104 255, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
105 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19,
106 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29,
121 if (EhciEndpoint->MaxTDs == 0)
127 TD = EhciEndpoint->FirstTD;
133 if (ix >= EhciEndpoint->MaxTDs)
142 EhciEndpoint->RemainTDs--;
157 DPRINT_EHCI(
"EHCI_InitializeQH: EhciEndpoint - %p, QH - %p, QhPA - %p\n",
162 EndpointProperties = &EhciEndpoint->EndpointProperties;
168 QH->sqh.PhysicalAddress = QhPA;
170 QH->sqh.HwQH.EndpointParams.DeviceAddress = EndpointProperties->
DeviceAddress;
171 QH->sqh.HwQH.EndpointParams.EndpointNumber = EndpointProperties->
EndpointAddress;
195 QH->sqh.HwQH.EndpointParams.MaximumPacketLength = EndpointProperties->
MaxPacketSize;
196 QH->sqh.HwQH.EndpointCaps.PipeMultiplier = 1;
200 QH->sqh.HwQH.EndpointCaps.HubAddr = 0;
201 QH->sqh.HwQH.EndpointCaps.PortNumber = 0;
205 QH->sqh.HwQH.EndpointCaps.HubAddr = EndpointProperties->
HubAddr;
206 QH->sqh.HwQH.EndpointCaps.PortNumber = EndpointProperties->
PortNumber;
209 QH->sqh.HwQH.EndpointParams.ControlEndpointFlag = 1;
236 DPRINT(
"EHCI_OpenBulkOrControlEndpoint: EhciEndpoint - %p, IsControl - %x\n",
242 EhciEndpoint->DmaBufferVA = (
PVOID)EndpointProperties->BufferVA;
243 EhciEndpoint->DmaBufferPA = EndpointProperties->BufferPA;
248 QhPA = EhciEndpoint->DmaBufferPA +
sizeof(
EHCI_HCD_TD);
252 TdCount = (EndpointProperties->BufferLength -
259 EhciEndpoint->MaxTDs = TdCount;
260 EhciEndpoint->RemainTDs = TdCount;
262 TdVA = EhciEndpoint->FirstTD;
265 for (ix = 0; ix < TdCount; ix++)
267 DPRINT_EHCI(
"EHCI_OpenBulkOrControlEndpoint: TdVA - %p, TdPA - %p\n",
291 EhciEndpoint->HcdHeadP =
NULL;
312 EhciEndpoint->HcdTailP = TD;
313 EhciEndpoint->HcdHeadP = TD;
340 ULONG ScheduleOffset;
344 DPRINT(
"EHCI_OpenInterruptEndpoint: EhciExtension - %p, EndpointProperties - %p, EhciEndpoint - %p\n",
349 Period = EndpointProperties->Period;
350 ScheduleOffset = EndpointProperties->ScheduleOffset;
364 if (EhciEndpoint->EndpointProperties.DeviceSpeed ==
UsbHighSpeed)
367 EhciEndpoint->PeriodTable = PeriodTable;
369 DPRINT(
"EHCI_OpenInterruptEndpoint: EhciEndpoint - %p, ScheduleMask - %X, Index - %X\n",
374 EhciEndpoint->StaticQH = EhciExtension->PeriodicHead[PeriodTable->
PeriodIdx];
378 EhciEndpoint->PeriodTable =
NULL;
380 DPRINT(
"EHCI_OpenInterruptEndpoint: EhciEndpoint - %p, Index - %X\n",
384 EhciEndpoint->StaticQH = EhciExtension->PeriodicHead[
ClassicPeriod[Idx] +
388 EhciEndpoint->DmaBufferVA = (
PVOID)EndpointProperties->BufferVA;
389 EhciEndpoint->DmaBufferPA = EndpointProperties->BufferPA;
394 QhPA = EndpointProperties->BufferPA +
sizeof(
EHCI_HCD_TD);
400 FirstTdPA = EndpointProperties->BufferPA +
404 TdCount = (EndpointProperties->BufferLength -
410 EhciEndpoint->FirstTD = FirstTD;
411 EhciEndpoint->MaxTDs = TdCount;
413 for (ix = 0; ix < TdCount; ix++)
415 TD = EhciEndpoint->FirstTD + ix;
428 EhciEndpoint->RemainTDs = TdCount;
435 if (EhciEndpoint->EndpointProperties.DeviceSpeed ==
UsbHighSpeed)
442 EndpointProperties->InterruptScheduleMask;
445 EndpointProperties->SplitCompletionMask;
459 EhciEndpoint->HcdTailP = DummyTD;
460 EhciEndpoint->HcdHeadP = DummyTD;
478 DPRINT1(
"EHCI_OpenHsIsoEndpoint: UNIMPLEMENTED. FIXME\n");
488 DPRINT1(
"EHCI_OpenIsoEndpoint: UNIMPLEMENTED. FIXME\n");
503 DPRINT(
"EHCI_OpenEndpoint: ... \n");
509 TransferType = EndpointProperties->TransferType;
511 switch (TransferType)
568 EhciEndpoint = ehciEndpoint;
570 TransferType = EndpointProperties->TransferType;
572 DPRINT(
"EHCI_ReopenEndpoint: EhciEndpoint - %p, TransferType - %x\n",
576 switch (TransferType)
581 DPRINT1(
"EHCI_ReopenEndpoint: HS Iso. UNIMPLEMENTED. FIXME\n");
586 DPRINT1(
"EHCI_ReopenEndpoint: Iso. UNIMPLEMENTED. FIXME\n");
599 QH = EhciEndpoint->
QH;
610 DPRINT1(
"EHCI_ReopenEndpoint: Unknown TransferType\n");
626 DPRINT(
"EHCI_QueryEndpointRequirements: ... \n");
628 TransferType = EndpointProperties->TransferType;
630 switch (TransferType)
633 DPRINT(
"EHCI_QueryEndpointRequirements: IsoTransfer\n");
648 DPRINT(
"EHCI_QueryEndpointRequirements: ControlTransfer\n");
649 EndpointRequirements->HeaderBufferSize =
sizeof(
EHCI_HCD_TD) +
657 DPRINT(
"EHCI_QueryEndpointRequirements: BulkTransfer\n");
658 EndpointRequirements->HeaderBufferSize =
sizeof(
EHCI_HCD_TD) +
666 DPRINT(
"EHCI_QueryEndpointRequirements: InterruptTransfer\n");
667 EndpointRequirements->HeaderBufferSize =
sizeof(
EHCI_HCD_TD) +
675 DPRINT1(
"EHCI_QueryEndpointRequirements: Unknown TransferType - %x\n",
689 DPRINT(
"EHCI_DisablePeriodicList: ... \n");
693 OperationalRegs = EhciExtension->OperationalRegs;
711 DPRINT1(
"EHCI_CloseEndpoint: EhciEndpoint - %p, DisablePeriodic - %X\n",
771 VAddress += NewPAddress - PAddress;
772 PAddress = NewPAddress;
774 DPRINT(
"EHCI_AlignHwStructure: VAddress - %X, PAddress - %X\n",
794 DPRINT(
"EHCI_AddDummyQueueHeads: EhciExtension - %p\n", EhciExtension);
796 HcResourcesVA = EhciExtension->HcResourcesVA;
798 DummyQH = EhciExtension->IsoDummyQHListVA;
799 DummyQhPA = EhciExtension->IsoDummyQHListPA;
846 DPRINT(
"EHCI_InitializeInterruptSchedule: ... \n");
850 StaticQH = EhciExtension->PeriodicHead[ix];
859 StaticQH = EhciExtension->PeriodicHead[ix];
865 EhciExtension->PeriodicHead[
LinkTable[ix]]->PhysicalAddress;
876 EhciExtension->PeriodicHead[0]->HwQH.HorizontalLink.Terminate = 1;
894 ULONG PeriodicHeadPA;
901 DPRINT(
"EHCI_InitializeSchedule: BaseVA - %p, BasePA - %p\n",
905 OperationalRegs = EhciExtension->OperationalRegs;
908 HcResourcesPA = BasePA;
910 EhciExtension->HcResourcesVA = HcResourcesVA;
911 EhciExtension->HcResourcesPA = BasePA;
920 NextLink.
AsULONG = AsyncHeadPA;
932 EhciExtension->AsyncHead = AsyncHead;
946 EhciExtension->PeriodicHead[ix] = PeriodicHead;
947 EhciExtension->PeriodicHead[ix]->PhysicalAddress = PeriodicHeadPA;
969 EhciExtension->IsoDummyQHListVA = &HcResourcesVA->
IsoDummyQH[0];
994 DPRINT(
"EHCI_InitializeHardware: ... \n");
996 OperationalRegs = EhciExtension->OperationalRegs;
997 CapabilityRegisters = EhciExtension->CapabilityRegisters;
1006 DPRINT(
"EHCI_InitializeHardware: Start reset ... \n");
1020 DPRINT1(
"EHCI_InitializeHardware: Reset failed!\n");
1028 DPRINT(
"EHCI_InitializeHardware: Reset - OK\n");
1032 EhciExtension->NumberOfPorts = StructuralParams.
PortCount;
1035 DPRINT(
"EHCI_InitializeHardware: StructuralParams - %X\n", StructuralParams.
AsULONG);
1036 DPRINT(
"EHCI_InitializeHardware: PortPowerControl - %x\n", EhciExtension->PortPowerControl);
1037 DPRINT(
"EHCI_InitializeHardware: N_PORTS - %x\n", EhciExtension->NumberOfPorts);
1042 EhciExtension->InterruptMask.AsULONG = 0;
1043 EhciExtension->InterruptMask.Interrupt = 1;
1044 EhciExtension->InterruptMask.ErrorInterrupt = 1;
1045 EhciExtension->InterruptMask.PortChangeInterrupt = 0;
1046 EhciExtension->InterruptMask.FrameListRollover = 1;
1047 EhciExtension->InterruptMask.HostSystemError = 1;
1048 EhciExtension->InterruptMask.InterruptOnAsyncAdvance = 1;
1062 DPRINT(
"EHCI_GetOffsetEECP: CapabilityID - %x\n", CapabilityID);
1064 CapParameters = EhciExtension->CapabilityRegisters->CapParameters;
1077 sizeof(LegacyCapability));
1079 DPRINT(
"EHCI_GetOffsetEECP: OffsetEECP - %x\n", OffsetEECP);
1102 DPRINT(
"EHCI_TakeControlHC: EhciExtension - %p\n", EhciExtension);
1106 if (OffsetEECP == 0)
1109 DPRINT(
"EHCI_TakeControlHC: OffsetEECP - %X\n", OffsetEECP);
1115 sizeof(LegacyCapability));
1126 sizeof(LegacyCapability));
1137 sizeof(LegacyCapability));
1142 DPRINT(
"EHCI_TakeControlHC: Ownership is ok\n");
1155 DPRINT1(
"EHCI_GetRegistryParameters: UNIMPLEMENTED. FIXME\n");
1168 UCHAR CapabilityRegLength;
1171 DPRINT(
"EHCI_StartController: ... \n");
1176 DPRINT1(
"EHCI_StartController: Resources->ResourcesTypes - %x\n",
1188 CapabilityRegLength);
1192 DPRINT(
"EHCI_StartController: CapabilityRegisters - %p\n", CapabilityRegisters);
1193 DPRINT(
"EHCI_StartController: OperationalRegs - %p\n", OperationalRegs);
1209 DPRINT1(
"EHCI_StartController: Unsuccessful TakeControlHC()\n");
1217 DPRINT1(
"EHCI_StartController: Unsuccessful InitializeHardware()\n");
1227 DPRINT1(
"EHCI_StartController: Unsuccessful InitializeSchedule()\n");
1254 Command.InterruptThreshold = 1;
1288 DPRINT1(
"EHCI_StopController: UNIMPLEMENTED. FIXME\n");
1302 DPRINT(
"EHCI_SuspendController: ... \n");
1312 Command.InterruptAdvanceDoorbell = 0;
1325 Status.PeriodicStatus = 0;
1326 Status.AsynchronousStatus = 0;
1333 for (ix = 0; ix < 10; ix++)
1359 ULONG RoutingControl;
1362 DPRINT(
"EHCI_ResumeController: ... \n");
1392 Command.InterruptAdvanceDoorbell = 0;
1394 Command.AsynchronousParkModeCount = 0;
1395 Command.AsynchronousParkModeEnable = 0;
1405 EhciExtension->
Flags &= ~EHCI_FLAGS_CONTROLLER_SUSPEND;
1420 DPRINT1(
"EHCI_HardwarePresent: IsInvalidateController - %x\n",
1421 IsInvalidateController);
1423 if (!IsInvalidateController)
1504 DPRINT_EHCI(
"EHCI_InterruptDpc: [%p] EnableInterrupts - %x\n",
1514 DPRINT_EHCI(
"EHCI_InterruptDpc: [%p] InterruptStatus - %X\n", EhciExtension, iStatus.
AsULONG);
1520 DPRINT_EHCI(
"EHCI_InterruptDpc: [%p] PortChangeInterrupt\n", EhciExtension);
1550 DPRINT_EHCI(
"EHCI_MapAsyncTransferToTd: EhciTransfer - %p, TD - %p, TransferedLen - %x, MaxPacketSize - %x, DataToggle - %x\n",
1557 TransferParameters = EhciTransfer->TransferParameters;
1559 SgElement = &
SgList->SgElement[0];
1561 for (SgIdx = 0; SgIdx <
SgList->SgElementCount; SgIdx++)
1563 if (TransferedLen >= SgElement->
SgOffset &&
1572 SgRemain =
SgList->SgElementCount - SgIdx;
1576 TD->HwTD.Buffer[0] =
SgList->SgElement[SgIdx].SgPhysicalAddress.LowPart -
1577 SgList->SgElement[SgIdx].SgOffset +
1585 TD->HwTD.Buffer[ix] =
SgList->SgElement[SgIdx + ix].SgPhysicalAddress.LowPart;
1588 NumPackets = LengthThisTD / MaxPacketSize;
1589 DiffLength = LengthThisTD - MaxPacketSize * (LengthThisTD / MaxPacketSize);
1591 if (LengthThisTD != MaxPacketSize * (LengthThisTD / MaxPacketSize))
1592 LengthThisTD -= DiffLength;
1594 if (DataToggle && (NumPackets & 1))
1595 *DataToggle = !(*DataToggle);
1601 TD->HwTD.Buffer[0] = TransferedLen +
1602 SgList->SgElement[SgIdx].SgPhysicalAddress.LowPart -
1603 SgList->SgElement[SgIdx].SgOffset;
1607 if ((SgIdx + ix) >=
SgList->SgElementCount)
1610 TD->HwTD.Buffer[ix] =
SgList->SgElement[SgIdx + ix].SgPhysicalAddress.LowPart;
1614 TD->HwTD.Token.TransferBytes = LengthThisTD;
1615 TD->LengthThisTD = LengthThisTD;
1617 return LengthThisTD + TransferedLen;
1629 OperationalRegs = EhciExtension->OperationalRegs;
1643 DPRINT(
"EHCI_DisableAsyncList: ... \n");
1645 OperationalRegs = EhciExtension->OperationalRegs;
1659 DPRINT(
"EHCI_EnablePeriodicList: ... \n");
1661 OperationalRegs = EhciExtension->OperationalRegs;
1679 DPRINT_EHCI(
"EHCI_FlushAsyncCache: EhciExtension - %p\n", EhciExtension);
1681 OperationalRegs = EhciExtension->OperationalRegs;
1685 if (!
Status.AsynchronousStatus && !
Command.AsynchronousEnable)
1688 if (
Status.AsynchronousStatus && !
Command.AsynchronousEnable)
1707 if (!
Status.AsynchronousStatus &&
Command.AsynchronousEnable)
1721 Command.InterruptAdvanceDoorbell = 1;
1729 if (
Cmd.InterruptAdvanceDoorbell)
1733 if (
Cmd.AsULONG == -1)
1740 if (!
Command.InterruptAdvanceDoorbell)
1760 ULONG FrameIndexReg;
1764 DPRINT_EHCI(
"EHCI_LockQH: QH - %p, TransferType - %x\n",
1768 OperationalRegs = EhciExtension->OperationalRegs;
1780 EhciExtension->PrevQH = PrevQH;
1781 EhciExtension->NextQH = NextQH;
1782 EhciExtension->LockQH = QH;
1824 ASSERT(EhciExtension->LockQH);
1825 ASSERT(EhciExtension->LockQH == QH);
1827 QH->sqh.QhFlags &= ~EHCI_QH_FLAG_UPDATING;
1829 EhciExtension->LockQH =
NULL;
1831 QhPA = QH->sqh.PhysicalAddress;
1835 EhciExtension->PrevQH->sqh.HwQH.HorizontalLink.AsULONG = QhPA;
1851 DPRINT_EHCI(
"EHCI_LinkTransferToQueue: EhciEndpoint - %p, NextTD - %p\n",
1858 QH = EhciEndpoint->QH;
1859 TD = EhciEndpoint->HcdHeadP;
1861 if (TD == EhciEndpoint->HcdTailP)
1867 EhciEndpoint->EndpointProperties.TransferType);
1882 EhciEndpoint->HcdHeadP = NextTD;
1886 DPRINT_EHCI(
"EHCI_LinkTransferToQueue: TD - %p, HcdTailP - %p\n",
1887 EhciEndpoint->HcdHeadP,
1888 EhciEndpoint->HcdTailP);
1890 LinkTD = EhciEndpoint->HcdHeadP;
1892 while (TD != EhciEndpoint->HcdTailP)
1898 ASSERT(LinkTD != EhciEndpoint->HcdTailP);
1902 TD = EhciEndpoint->FirstTD;
1904 for (ix = 0; ix < EhciEndpoint->MaxTDs; ix++)
1915 LinkTD->
HwTD.
NextTD = NextTD->PhysicalAddress;
1939 ULONG TransferedLen = 0;
1941 ULONG DataToggle = 1;
1943 DPRINT_EHCI(
"EHCI_ControlTransfer: EhciEndpoint - %p, EhciTransfer - %p\n",
1950 EhciExtension->PendingTransfers++;
1951 EhciEndpoint->PendingTDs++;
1953 EhciTransfer->TransferOnAsyncList = 1;
1963 EhciTransfer->PendingTDs++;
1986 &TransferParameters->SetupPacket,
1997 EhciTransfer->PendingTDs++;
2021 while (TransferedLen < TransferParameters->TransferBufferLength)
2033 EhciTransfer->PendingTDs++;
2072 EhciEndpoint->EndpointProperties.MaxPacketSize,
2090 Token.InterruptOnComplete = 1;
2091 Token.DataToggle = 1;
2100 LastTD->
NextHcdTD = EhciEndpoint->HcdTailP;
2101 LastTD->
HwTD.
NextTD = EhciEndpoint->HcdTailP->PhysicalAddress;
2106 ASSERT(EhciEndpoint->HcdTailP->NextHcdTD ==
NULL);
2107 ASSERT(EhciEndpoint->HcdTailP->AltNextHcdTD ==
NULL);
2123 ULONG TransferedLen;
2125 DPRINT_EHCI(
"EHCI_BulkTransfer: EhciEndpoint - %p, EhciTransfer - %p\n",
2129 if (((TransferParameters->TransferBufferLength /
2132 DPRINT1(
"EHCI_BulkTransfer: return MP_STATUS_FAILURE\n");
2136 EhciExtension->PendingTransfers++;
2137 EhciEndpoint->PendingTDs++;
2139 EhciTransfer->TransferOnAsyncList = 1;
2144 if (TransferParameters->TransferBufferLength)
2146 while (TransferedLen < TransferParameters->TransferBufferLength)
2156 EhciTransfer->PendingTDs++;
2174 if (EhciTransfer->PendingTDs == 1)
2198 EhciEndpoint->EndpointProperties.MaxPacketSize,
2218 EhciTransfer->PendingTDs++;
2237 ASSERT(EhciTransfer->PendingTDs == 1);
2259 TD->
HwTD.
NextTD = EhciEndpoint->HcdTailP->PhysicalAddress;
2265 ASSERT(EhciEndpoint->HcdTailP->NextHcdTD == 0);
2266 ASSERT(EhciEndpoint->HcdTailP->AltNextHcdTD == 0);
2282 ULONG TransferedLen = 0;
2284 DPRINT_EHCI(
"EHCI_InterruptTransfer: EhciEndpoint - %p, EhciTransfer - %p\n",
2288 if (!EhciEndpoint->RemainTDs)
2290 DPRINT1(
"EHCI_InterruptTransfer: EhciEndpoint - %p\n", EhciEndpoint);
2295 EhciEndpoint->PendingTDs++;
2297 if (!TransferParameters->TransferBufferLength)
2299 DPRINT1(
"EHCI_InterruptTransfer: EhciEndpoint - %p\n", EhciEndpoint);
2304 while (TransferedLen < TransferParameters->TransferBufferLength)
2310 DPRINT1(
"EHCI_InterruptTransfer: EhciEndpoint - %p\n", EhciEndpoint);
2315 EhciTransfer->PendingTDs++;
2334 if (EhciTransfer->PendingTDs == 1)
2353 EhciEndpoint->EndpointProperties.TotalMaxPacketSize,
2365 DPRINT_EHCI(
"EHCI_InterruptTransfer: PendingTDs - %x, TD->PhysicalAddress - %p, FirstTD - %p\n",
2366 EhciTransfer->PendingTDs,
2370 TD->
HwTD.
NextTD = EhciEndpoint->HcdTailP->PhysicalAddress;
2375 ASSERT(EhciEndpoint->HcdTailP->NextHcdTD ==
NULL);
2376 ASSERT(EhciEndpoint->HcdTailP->AltNextHcdTD ==
NULL);
2396 DPRINT_EHCI(
"EHCI_SubmitTransfer: EhciEndpoint - %p, EhciTransfer - %p\n",
2449 DPRINT1(
"EHCI_SubmitIsoTransfer: UNIMPLEMENTED. FIXME\n");
2459 DPRINT1(
"EHCI_AbortIsoTransfer: UNIMPLEMENTED. FIXME\n");
2470 ULONG TransferLength;
2478 DPRINT(
"EHCI_AbortAsyncTransfer: EhciEndpoint - %p, EhciTransfer - %p\n",
2482 QH = EhciEndpoint->QH;
2483 TD = EhciEndpoint->HcdHeadP;
2485 ASSERT(EhciEndpoint->PendingTDs);
2486 EhciEndpoint->PendingTDs--;
2492 while (TD != EhciEndpoint->HcdTailP &&
2503 EhciEndpoint->RemainTDs++;
2509 EhciTransfer->TransferLen += TransferLength;
2519 EhciEndpoint->HcdHeadP = TD;
2530 TD = EhciEndpoint->HcdHeadP;
2548 EhciEndpoint->RemainTDs++;
2562 if (CurrentTransfer == EhciTransfer)
2583 for (TD = EhciEndpoint->HcdHeadP;
2609 DPRINT(
"EHCI_AbortTransfer: EhciTransfer - %p, CompletedLength - %x\n",
2626 DPRINT1(
"EHCI_GetEndpointState: UNIMPLEMENTED. FIXME\n");
2640 QH = EhciEndpoint->QH;
2645 DPRINT(
"EHCI_RemoveQhFromPeriodicList: EhciEndpoint - %p, QH - %X, EhciEndpoint->StaticQH - %p\n",
2648 EhciEndpoint->StaticQH);
2671 QH->
sqh.
QhFlags &= ~EHCI_QH_FLAG_IN_SCHEDULE;
2688 DPRINT(
"EHCI_RemoveQhFromAsyncList: QH - %p\n", QH);
2695 AsyncHead = EhciExtension->AsyncHead;
2713 QH->sqh.PhysicalAddress)
2719 QH->sqh.QhFlags &= ~EHCI_QH_FLAG_IN_SCHEDULE;
2734 QH = EhciEndpoint->QH;
2742 QH->
sqh.
Period = EhciEndpoint->EndpointProperties.Period;
2743 QH->
sqh.
Ordinal = EhciEndpoint->EndpointProperties.Reserved6;
2745 DPRINT(
"EHCI_InsertQhInPeriodicList: EhciEndpoint - %p, QH - %X, EhciEndpoint->StaticQH - %p\n",
2748 EhciEndpoint->StaticQH);
2755 DPRINT(
"EHCI_InsertQhInPeriodicList: StaticQH - %p, StaticQH->NextHead - %p\n",
2765 PrevHead = NextHead;
2797 DPRINT(
"EHCI_InsertQhInAsyncList: QH - %p\n", QH);
2802 AsyncHead = EhciExtension->AsyncHead;
2807 QH->sqh.NextHead = NextHead;
2812 QhPA = QH->sqh.PhysicalAddress;
2827 DPRINT1(
"EHCI_SetIsoEndpointState: UNIMPLEMENTED. FIXME\n");
2839 DPRINT(
"EHCI_SetAsyncEndpointState: EhciEndpoint - %p, EndpointState - %x\n",
2843 QH = EhciEndpoint->QH;
2845 TransferType = EhciEndpoint->EndpointProperties.TransferType;
2847 switch (EndpointState)
2880 EhciEndpoint->EndpointState = EndpointState;
2892 DPRINT(
"EHCI_SetEndpointState: ... \n");
2894 EhciEndpoint = ehciEndpoint;
2943 DPRINT(
"EHCI_GetErrorFromTD: TD - %p, TRANSACTION_ERROR\n", TD);
2949 DPRINT(
"EHCI_GetErrorFromTD: TD - %p, BABBLE_DETECTED\n", TD);
2955 DPRINT(
"EHCI_GetErrorFromTD: TD - %p, DATA_BUFFER_ERROR\n", TD);
2961 DPRINT(
"EHCI_GetErrorFromTD: TD - %p, MISSED_MICROFRAME\n", TD);
2965 DPRINT(
"EHCI_GetErrorFromTD: TD - %p, STALL_PID\n", TD);
2978 ULONG LengthTransfered;
2983 DPRINT_EHCI(
"EHCI_ProcessDoneAsyncTd: TD - %p\n", TD);
2985 EhciTransfer = TD->EhciTransfer;
3000 LengthTransfered = TD->LengthThisTD - TD->HwTD.Token.TransferBytes;
3009 TD->HwTD.NextTD = 0;
3010 TD->HwTD.AlternateNextTD = 0;
3013 TD->EhciTransfer =
NULL;
3026 EhciExtension->PendingTransfers--;
3028 if (EhciExtension->PendingTransfers == 0)
3030 OperationalRegs = EhciExtension->OperationalRegs;
3033 if (!
Command.InterruptAdvanceDoorbell &&
3057 ULONG CurrentTDPhys;
3060 DPRINT_EHCI(
"EHCI_PollActiveAsyncEndpoint: ... \n");
3062 QH = EhciEndpoint->QH;
3071 if (CurrentTD == EhciEndpoint->DmaBufferVA)
3079 TD = EhciEndpoint->HcdHeadP;
3081 if (TD == CurrentTD)
3083 if (TD != EhciEndpoint->HcdTailP &&
3109 while (TD != CurrentTD)
3126 EhciEndpoint->HcdHeadP = TD;
3130 if ((CurrentTD->
NextHcdTD != EhciEndpoint->HcdTailP) &&
3135 EhciEndpoint->HcdHeadP = TD;
3143 EhciEndpoint->EndpointProperties.TransferType);
3156 while (TD != EhciEndpoint->HcdTailP)
3169 EhciEndpoint->HcdHeadP = EhciEndpoint->HcdTailP;
3187 DPRINT(
"EHCI_PollHaltedAsyncEndpoint: EhciEndpoint - %p\n", EhciEndpoint);
3189 QH = EhciEndpoint->QH;
3204 DPRINT(
"EHCI_PollHaltedAsyncEndpoint: CurrentTD - %p\n", CurrentTD);
3206 if (CurrentTD == EhciEndpoint->DmaBufferVA)
3209 ASSERT(EhciEndpoint->HcdTailP != CurrentTD);
3215 EhciEndpoint->EndpointProperties.TransferType);
3218 TD = EhciEndpoint->HcdHeadP;
3220 while (TD != CurrentTD)
3222 DPRINT(
"EHCI_PollHaltedAsyncEndpoint: TD - %p\n", TD);
3242 DPRINT(
"EHCI_PollHaltedAsyncEndpoint: TD - %p\n", TD);
3255 EhciEndpoint->HcdHeadP = TD;
3267 EhciEndpoint->EndpointStatus &= ~USBPORT_ENDPOINT_HALT;
3286 if (!EhciEndpoint->PendingTDs)
3289 QH = EhciEndpoint->QH;
3305 DoneList = &EhciEndpoint->ListTDs;
3327 DPRINT1(
"EHCI_PollIsoEndpoint: UNIMPLEMENTED. FIXME\n");
3388 DPRINT(
"EHCI_EnableInterrupts: EhciExtension->InterruptMask - %x\n",
3401 DPRINT(
"EHCI_DisableInterrupts: ... \n");
3447 EhciEndpoint = ehciEndpoint;
3449 DPRINT(
"EHCI_SetEndpointDataToggle: EhciEndpoint - %p, DataToggle - %x\n",
3471 EhciEndpoint = ehciEndpoint;
3473 DPRINT(
"EHCI_GetEndpointStatus: EhciEndpoint - %p\n", EhciEndpoint);
3478 return EndpointStatus;
3483 return EndpointStatus;
3496 EhciEndpoint = ehciEndpoint;
3498 DPRINT(
"EHCI_SetEndpointStatus: EhciEndpoint - %p, EndpointStatus - %x\n",
3511 QH = EhciEndpoint->
QH;
3526 DPRINT1(
"EHCI_ResetController: UNIMPLEMENTED. FIXME\n");
3540 DPRINT1(
"EHCI_StartSendOnePacket: UNIMPLEMENTED. FIXME\n");
3555 DPRINT1(
"EHCI_EndSendOnePacket: UNIMPLEMENTED. FIXME\n");
3566 DPRINT1(
"EHCI_PassThru: UNIMPLEMENTED. FIXME\n");
3576 DPRINT1(
"EHCI_RebalanceEndpoint: UNIMPLEMENTED. FIXME\n");
3587 DPRINT(
"EHCI_FlushInterrupts: ... \n");
3599 DPRINT1(
"EHCI_TakePortControl: UNIMPLEMENTED. FIXME\n");
3607 DPRINT1(
"EHCI_Unload: Not supported\n");
3617 DPRINT(
"DriverEntry: DriverObject - %p, RegistryPath - %wZ\n",
#define WRITE_REGISTER_ULONG(r, v)
#define READ_REGISTER_ULONG(r)
Token(const std::string &text, size_t pos, size_t len, int type)
DRIVER_INITIALIZE DriverEntry
VOID NTAPI EHCI_DumpHwQH(IN PEHCI_HCD_QH QH)
#define EHCI_TOKEN_STATUS_BABBLE_DETECTED
#define EHCI_LINK_TYPE_QH
#define EHCI_TOKEN_STATUS_DATA_BUFFER_ERROR
#define EHCI_QH_EP_LOW_SPEED
#define EHCI_FLADJ_PCI_CONFIG_OFFSET
#define EHCI_TOKEN_STATUS_TRANSACTION_ERROR
#define EHCI_QH_EP_HIGH_SPEED
#define EHCI_FRINDEX_INDEX_MASK
#define EHCI_QH_EP_FULL_SPEED
#define EHCI_TD_TOKEN_PID_OUT
#define EHCI_TOKEN_STATUS_HALTED
#define EHCI_MAX_QTD_BUFFER_PAGES
#define LINK_POINTER_MASK
#define EHCI_FRAME_LIST_MAX_ENTRIES
#define EHCI_TD_TOKEN_PID_IN
#define EHCI_INTERRUPT_MASK
#define EHCI_TOKEN_STATUS_ACTIVE
#define EHCI_TD_TOKEN_PID_SETUP
#define EHCI_FRINDEX_FRAME_MASK
#define EHCI_TOKEN_STATUS_MISSED_MICROFRAME
struct _EHCI_HC_CAPABILITY_REGISTERS * PEHCI_HC_CAPABILITY_REGISTERS
#define EHCI_CONFIG_FLAG_CONFIGURED
#define TERMINATE_POINTER
struct _EHCI_HW_REGISTERS * PEHCI_HW_REGISTERS
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define KeQuerySystemTime(t)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN IsPresent
_In_ PUSBD_PIPE_INFORMATION _In_ USB_DEVICE_SPEED DeviceSpeed
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define KeStallExecutionProcessor(MicroSeconds)
USBPORT_ENDPOINT_PROPERTIES EndpointProperties
ULONG BackupCtrlDSSegment
EHCI_INTERRUPT_ENABLE InterruptStatus
EHCI_INTERRUPT_ENABLE InterruptMask
PEHCI_HC_CAPABILITY_REGISTERS CapabilityRegisters
UCHAR FrameLengthAdjustment
PEHCI_HW_REGISTERS OperationalRegs
ULONG BackupAsynclistaddr
ULONG BackupPeriodiclistbase
USB_DEFAULT_PIPE_SETUP_PACKET SetupPacket
struct _EHCI_HCD_TD * AltNextHcdTD
struct _EHCI_HCD_TD * NextHcdTD
struct _EHCI_TRANSFER * EhciTransfer
struct _EHCI_ENDPOINT * EhciEndpoint
EHCI_HC_STRUCTURAL_PARAMS StructParameters
ULONG PeriodicFrameList[EHCI_FRAME_LIST_MAX_ENTRIES]
EHCI_STATIC_QH PeriodicHead[64]
EHCI_HCD_QH IsoDummyQH[EHCI_FRAME_LIST_MAX_ENTRIES]
EHCI_USB_COMMAND HcCommand
EHCI_INTERRUPT_ENABLE HcInterruptEnable
EHCI_PORT_STATUS_CONTROL PortControl[15]
EHCI_LINK_POINTER HorizontalLink
EHCI_QH_EP_PARAMS EndpointParams
EHCI_QH_EP_CAPS EndpointCaps
struct _EHCI_STATIC_QH * StaticQH
struct _EHCI_HCD_QH * NextHead
struct _EHCI_HCD_QH * PrevHead
PEHCI_ENDPOINT EhciEndpoint
PUSBPORT_TRANSFER_PARAMETERS TransferParameters
struct _LIST_ENTRY * Flink
USB_DEVICE_SPEED DeviceSpeed
PHCI_STOP_CONTROLLER StopController
PHCI_SUBMIT_ISO_TRANSFER SubmitIsoTransfer
PHCI_RH_CLEAR_FEATURE_PORT_POWER RH_ClearFeaturePortPower
PHCI_SUBMIT_TRANSFER SubmitTransfer
PHCI_SET_ENDPOINT_STATUS SetEndpointStatus
PHCI_RH_GET_HUB_STATUS RH_GetHubStatus
PHCI_ENABLE_INTERRUPTS EnableInterrupts
SIZE_T MiniPortTransferSize
PHCI_GET_ENDPOINT_STATUS GetEndpointStatus
PHCI_RH_ENABLE_IRQ RH_EnableIrq
SIZE_T MiniPortResourcesSize
PUSBPORT_INVALIDATE_CONTROLLER UsbPortInvalidateController
PHCI_RH_CLEAR_FEATURE_PORT_OVERCURRENT_CHANGE RH_ClearFeaturePortOvercurrentChange
PHCI_RH_DISABLE_IRQ RH_DisableIrq
PHCI_DISABLE_INTERRUPTS DisableInterrupts
SIZE_T MiniPortEndpointSize
PHCI_INTERRUPT_NEXT_SOF InterruptNextSOF
PHCI_ABORT_TRANSFER AbortTransfer
PHCI_FLUSH_INTERRUPTS FlushInterrupts
PHCI_RH_CLEAR_FEATURE_PORT_ENABLE_CHANGE RH_ClearFeaturePortEnableChange
PHCI_RH_GET_ROOT_HUB_DATA RH_GetRootHubData
PHCI_RH_SET_FEATURE_PORT_SUSPEND RH_SetFeaturePortSuspend
PHCI_RH_CLEAR_FEATURE_PORT_RESET_CHANGE RH_ClearFeaturePortResetChange
PHCI_RH_GET_PORT_STATUS RH_GetPortStatus
PUSBPORT_BUG_CHECK UsbPortBugCheck
PHCI_OPEN_ENDPOINT OpenEndpoint
SIZE_T MiniPortExtensionSize
PHCI_RH_CLEAR_FEATURE_PORT_ENABLE RH_ClearFeaturePortEnable
PHCI_CHECK_CONTROLLER CheckController
PHCI_SET_ENDPOINT_DATA_TOGGLE SetEndpointDataToggle
PHCI_POLL_CONTROLLER PollController
PHCI_SUSPEND_CONTROLLER SuspendController
PHCI_GET_32BIT_FRAME_NUMBER Get32BitFrameNumber
PUSBPORT_INVALIDATE_ROOT_HUB UsbPortInvalidateRootHub
PHCI_RESUME_CONTROLLER ResumeController
PHCI_SET_ENDPOINT_STATE SetEndpointState
PHCI_START_SEND_ONE_PACKET StartSendOnePacket
PHCI_QUERY_ENDPOINT_REQUIREMENTS QueryEndpointRequirements
PUSBPORT_WAIT UsbPortWait
PHCI_CLOSE_ENDPOINT CloseEndpoint
ULONG MiniPortBusBandwidth
PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND_CHANGE RH_ClearFeaturePortSuspendChange
PHCI_END_SEND_ONE_PACKET EndSendOnePacket
PHCI_RH_CHIRP_ROOT_PORT RH_ChirpRootPort
PHCI_RH_SET_FEATURE_PORT_RESET RH_SetFeaturePortReset
PUSBPORT_COMPLETE_TRANSFER UsbPortCompleteTransfer
PHCI_INTERRUPT_SERVICE InterruptService
PHCI_START_CONTROLLER StartController
PUSBPORT_READ_WRITE_CONFIG_SPACE UsbPortReadWriteConfigSpace
PHCI_REOPEN_ENDPOINT ReopenEndpoint
PHCI_INTERRUPT_DPC InterruptDpc
PHCI_RH_CLEAR_FEATURE_PORT_CONNECT_CHANGE RH_ClearFeaturePortConnectChange
PHCI_TAKE_PORT_CONTROL TakePortControl
PHCI_POLL_ENDPOINT PollEndpoint
PHCI_GET_ENDPOINT_STATE GetEndpointState
PHCI_RH_SET_FEATURE_PORT_ENABLE RH_SetFeaturePortEnable
PUSBPORT_GET_MAPPED_VIRTUAL_ADDRESS UsbPortGetMappedVirtualAddress
PUSBPORT_INVALIDATE_ENDPOINT UsbPortInvalidateEndpoint
PHCI_RH_SET_FEATURE_PORT_POWER RH_SetFeaturePortPower
PHCI_REBALANCE_ENDPOINT RebalanceEndpoint
PHCI_RH_GET_STATUS RH_GetStatus
PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND RH_ClearFeaturePortSuspend
ULONG TransferBufferLength
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INSUFFICIENT_RESOURCES
ULONG ExtCapabilitiesPointer
ULONG PortChangeInterrupt
ULONG InterruptOnAsyncAdvance
ULONG NextCapabilityPointer
ULONG ConnectStatusChange
ULONG SplitCompletionMask
ULONG MaximumPacketLength
ULONG HeadReclamationListFlag
ULONG InterruptOnComplete
#define USBD_STATUS_DATA_BUFFER_ERROR
#define USBD_STATUS_STALL_PID
#define USBD_STATUS_SUCCESS
#define USBD_TRANSFER_DIRECTION_IN
#define USBD_STATUS_XACT_ERROR
#define USBD_STATUS_BABBLE_DETECTED
_In_ ULONG ParameterLength
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortConnectChange(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_GetPortStatus(IN PVOID ehciExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortOvercurrentChange(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortSuspendChange(IN PVOID ehciExtension, IN USHORT Port)
VOID NTAPI EHCI_RH_GetRootHubData(IN PVOID ehciExtension, IN PVOID rootHubData)
VOID NTAPI EHCI_RH_DisableIrq(IN PVOID ehciExtension)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortResetChange(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_SetFeaturePortPower(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_SetFeaturePortSuspend(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_GetHubStatus(IN PVOID ehciExtension, IN PUSB_HUB_STATUS_AND_CHANGE HubStatus)
MPSTATUS NTAPI EHCI_RH_SetFeaturePortReset(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_SetFeaturePortEnable(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortSuspend(IN PVOID ehciExtension, IN USHORT Port)
VOID NTAPI EHCI_RH_EnableIrq(IN PVOID ehciExtension)
MPSTATUS NTAPI EHCI_RH_ChirpRootPort(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortPower(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortEnable(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortEnableChange(IN PVOID ehciExtension, IN USHORT Port)
MPSTATUS NTAPI EHCI_RH_GetStatus(IN PVOID ehciExtension, IN PUSHORT Status)
MPSTATUS NTAPI EHCI_PassThru(IN PVOID ehciExtension, IN PVOID passThruParameters, IN ULONG ParameterLength, IN PVOID pParameters)
PEHCI_HCD_TD NTAPI EHCI_AllocTd(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
BOOLEAN NTAPI EHCI_InterruptService(IN PVOID ehciExtension)
BOOLEAN NTAPI EHCI_HardwarePresent(IN PEHCI_EXTENSION EhciExtension, IN BOOLEAN IsInvalidateController)
VOID NTAPI EHCI_StopController(IN PVOID ehciExtension, IN BOOLEAN DisableInterrupts)
VOID NTAPI EHCI_Unload(IN PDRIVER_OBJECT DriverObject)
VOID NTAPI EHCI_FlushAsyncCache(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_SetIsoEndpointState(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN ULONG EndpointState)
VOID NTAPI EHCI_PollIsoEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
VOID NTAPI EHCI_InterruptNextSOF(IN PVOID ehciExtension)
MPSTATUS NTAPI EHCI_OpenHsIsoEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PEHCI_ENDPOINT EhciEndpoint)
VOID NTAPI EHCI_PollEndpoint(IN PVOID ehciExtension, IN PVOID ehciEndpoint)
ULONG NTAPI EHCI_GetEndpointState(IN PVOID ehciExtension, IN PVOID ehciEndpoint)
VOID NTAPI EHCI_PollHaltedAsyncEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
VOID NTAPI EHCI_SetEndpointStatus(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN ULONG EndpointStatus)
VOID NTAPI EHCI_DisableInterrupts(IN PVOID ehciExtension)
MPSTATUS NTAPI EHCI_BulkTransfer(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PEHCI_TRANSFER EhciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SgList)
VOID NTAPI EHCI_ResetController(IN PVOID ehciExtension)
VOID NTAPI EHCI_CheckController(IN PVOID ehciExtension)
MPSTATUS NTAPI EHCI_InitializeSchedule(IN PEHCI_EXTENSION EhciExtension, IN ULONG_PTR BaseVA, IN ULONG BasePA)
VOID NTAPI EHCI_RebalanceEndpoint(IN PVOID ohciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PVOID ohciEndpoint)
VOID NTAPI EHCI_PollAsyncEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
UCHAR NTAPI EHCI_GetOffsetEECP(IN PEHCI_EXTENSION EhciExtension, IN UCHAR CapabilityID)
VOID NTAPI EHCI_PollController(IN PVOID ehciExtension)
VOID NTAPI EHCI_CloseEndpoint(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN BOOLEAN DisablePeriodic)
ULONG NTAPI EHCI_GetEndpointStatus(IN PVOID ehciExtension, IN PVOID ehciEndpoint)
VOID NTAPI EHCI_EnableInterrupts(IN PVOID ehciExtension)
ULONG NTAPI EHCI_Get32BitFrameNumber(IN PVOID ehciExtension)
VOID NTAPI EHCI_PollActiveAsyncEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
static const UCHAR Balance[]
USBPORT_REGISTRATION_PACKET RegPacket
VOID NTAPI EHCI_InsertQhInAsyncList(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_HCD_QH QH)
VOID NTAPI EHCI_DisablePeriodicList(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_TakePortControl(IN PVOID ohciExtension)
VOID NTAPI EHCI_GetRegistryParameters(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_EnableAsyncList(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_EnablePeriodicList(IN PEHCI_EXTENSION EhciExtension)
MPSTATUS NTAPI EHCI_InitializeHardware(IN PEHCI_EXTENSION EhciExtension)
MPSTATUS NTAPI EHCI_OpenBulkOrControlEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PEHCI_ENDPOINT EhciEndpoint, IN BOOLEAN IsControl)
MPSTATUS NTAPI EHCI_OpenIsoEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PEHCI_ENDPOINT EhciEndpoint)
VOID NTAPI EHCI_QueryEndpointRequirements(IN PVOID ehciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PUSBPORT_ENDPOINT_REQUIREMENTS EndpointRequirements)
MPSTATUS NTAPI EHCI_OpenEndpoint(IN PVOID ehciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PVOID ehciEndpoint)
VOID NTAPI EHCI_FlushInterrupts(IN PVOID ehciExtension)
MPSTATUS NTAPI EHCI_ControlTransfer(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PEHCI_TRANSFER EhciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SgList)
MPSTATUS NTAPI EHCI_TakeControlHC(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_SetEndpointDataToggle(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN ULONG DataToggle)
MPSTATUS NTAPI EHCI_ReopenEndpoint(IN PVOID ehciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PVOID ehciEndpoint)
VOID NTAPI EHCI_LinkTransferToQueue(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PEHCI_HCD_TD NextTD)
VOID NTAPI EHCI_RemoveQhFromPeriodicList(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
VOID NTAPI EHCI_SetEndpointState(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN ULONG EndpointState)
VOID NTAPI EHCI_AbortTransfer(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN PVOID ehciTransfer, IN PULONG CompletedLength)
VOID NTAPI EHCI_ProcessDoneAsyncTd(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_HCD_TD TD)
MPSTATUS NTAPI EHCI_StartController(IN PVOID ehciExtension, IN PUSBPORT_RESOURCES Resources)
MPSTATUS NTAPI EHCI_ResumeController(IN PVOID ehciExtension)
VOID NTAPI EHCI_SuspendController(IN PVOID ehciExtension)
VOID NTAPI EHCI_LockQH(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_HCD_QH QH, IN ULONG TransferType)
VOID NTAPI EHCI_AbortIsoTransfer(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PEHCI_TRANSFER EhciTransfer)
USBD_STATUS NTAPI EHCI_GetErrorFromTD(IN PEHCI_HCD_TD TD)
VOID NTAPI EHCI_AlignHwStructure(IN PEHCI_EXTENSION EhciExtension, IN PULONG PhysicalAddress, IN PULONG_PTR VirtualAddress, IN ULONG Alignment)
static const UCHAR LinkTable[]
PEHCI_HCD_QH NTAPI EHCI_GetDummyQhForFrame(IN PEHCI_EXTENSION EhciExtension, IN ULONG Idx)
VOID NTAPI EHCI_AbortAsyncTransfer(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PEHCI_TRANSFER EhciTransfer)
MPSTATUS NTAPI EHCI_SubmitTransfer(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PVOID ehciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SgList)
VOID NTAPI EHCI_InterruptDpc(IN PVOID ehciExtension, IN BOOLEAN EnableInterrupts)
VOID NTAPI EHCI_InitializeInterruptSchedule(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_SetAsyncEndpointState(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN ULONG EndpointState)
MPSTATUS NTAPI EHCI_EndSendOnePacket(IN PVOID ehciExtension, IN PVOID PacketParameters, IN PVOID Data, IN PULONG pDataLength, IN PVOID BufferVA, IN PVOID BufferPA, IN ULONG BufferLength, IN USBD_STATUS *pUSBDStatus)
VOID NTAPI EHCI_UnlockQH(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_HCD_QH QH)
VOID NTAPI EHCI_DisableAsyncList(IN PEHCI_EXTENSION EhciExtension)
VOID NTAPI EHCI_RemoveQhFromAsyncList(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_HCD_QH QH)
VOID NTAPI EHCI_InsertQhInPeriodicList(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint)
PEHCI_HCD_QH NTAPI EHCI_InitializeQH(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PEHCI_HCD_QH QH, IN ULONG QhPA)
PEHCI_STATIC_QH NTAPI EHCI_GetQhForFrame(IN PEHCI_EXTENSION EhciExtension, IN ULONG FrameIdx)
MPSTATUS NTAPI EHCI_StartSendOnePacket(IN PVOID ehciExtension, IN PVOID PacketParameters, IN PVOID Data, IN PULONG pDataLength, IN PVOID BufferVA, IN PVOID BufferPA, IN ULONG BufferLength, IN USBD_STATUS *pUSBDStatus)
static const UCHAR ClassicPeriod[8]
MPSTATUS NTAPI EHCI_OpenInterruptEndpoint(IN PEHCI_EXTENSION EhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PEHCI_ENDPOINT EhciEndpoint)
MPSTATUS NTAPI EHCI_InterruptTransfer(IN PEHCI_EXTENSION EhciExtension, IN PEHCI_ENDPOINT EhciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PEHCI_TRANSFER EhciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SgList)
ULONG NTAPI EHCI_MapAsyncTransferToTd(IN PEHCI_EXTENSION EhciExtension, IN ULONG MaxPacketSize, IN ULONG TransferedLen, IN PULONG DataToggle, IN PEHCI_TRANSFER EhciTransfer, IN PEHCI_HCD_TD TD, IN PUSBPORT_SCATTER_GATHER_LIST SgList)
static const EHCI_PERIOD pTable[]
MPSTATUS NTAPI EHCI_SubmitIsoTransfer(IN PVOID ehciExtension, IN PVOID ehciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PVOID ehciTransfer, IN PVOID isoParameters)
VOID NTAPI EHCI_AddDummyQHs(IN PEHCI_EXTENSION EhciExtension)
struct _EHCI_EXTENSION EHCI_EXTENSION
#define EHCI_QH_FLAG_NUKED
#define EHCI_HCD_TD_FLAG_DONE
#define EHCI_MAX_HS_ISO_HEADER_BUFFER_SIZE
#define EHCI_MAX_INTERRUPT_TD_COUNT
#define EHCI_QH_FLAG_UPDATING
#define EHCI_HCD_TD_FLAG_ALLOCATED
#define EHCI_MAX_FS_ISO_TRANSFER_SIZE
#define EHCI_FLAGS_CONTROLLER_SUSPEND
struct _EHCI_HCD_TD EHCI_HCD_TD
#define EHCI_QH_FLAG_STATIC
#define EHCI_HCD_TD_FLAG_DUMMY
#define EHCI_DUMMYQH_MAX_PACKET_LENGTH
#define EHCI_MAX_HS_ISO_TRANSFER_SIZE
#define EHCI_QH_FLAG_IN_SCHEDULE
struct _EHCI_STATIC_QH EHCI_STATIC_QH
#define EHCI_MAX_BULK_TD_COUNT
#define EHCI_FLAGS_IDLE_SUPPORT
struct _EHCI_HCD_QH EHCI_HCD_QH
#define EHCI_HCD_TD_FLAG_PROCESSED
struct _EHCI_ENDPOINT EHCI_ENDPOINT
struct _EHCI_HC_RESOURCES * PEHCI_HC_RESOURCES
#define EHCI_MAX_FS_ISO_HEADER_BUFFER_SIZE
#define EHCI_MAX_INTERRUPT_TRANSFER_SIZE
struct _EHCI_HCD_QH * PEHCI_HCD_QH
struct _EHCI_HC_RESOURCES EHCI_HC_RESOURCES
struct _EHCI_TRANSFER EHCI_TRANSFER
#define EHCI_QH_FLAG_CLOSED
#define EHCI_HCD_TD_FLAG_ACTIVE
#define EHCI_MAX_CONTROL_TRANSFER_SIZE
#define EHCI_MAX_BULK_TRANSFER_SIZE
#define EHCI_QH_FLAG_STATIC_FAST
struct _EHCI_HCD_TD * PEHCI_HCD_TD
#define EHCI_MAX_HC_SYSTEM_ERRORS
#define EHCI_MAX_CONTROL_TD_COUNT
#define USBPORT_ENDPOINT_REMOVE
#define USBPORT_ENDPOINT_ACTIVE
#define USB_MINIPORT_FLAGS_USB2
#define ENDPOINT_INTERRUPT_16ms
#define USB_MINIPORT_VERSION_EHCI
#define USB_MINIPORT_FLAGS_MEMORY_IO
#define INTERRUPT_ENDPOINTs
#define USBPORT_ENDPOINT_RUN
#define ENDPOINT_INTERRUPT_32ms
#define USBPORT_ENDPOINT_HALT
#define ENDPOINT_INTERRUPT_8ms
#define USB_MINIPORT_FLAGS_POLLING
#define USBPORT_TRANSFER_TYPE_INTERRUPT
#define USBPORT_ENDPOINT_PAUSED
#define USBPORT_TRANSFER_TYPE_ISOCHRONOUS
#define USBPORT_RESOURCES_MEMORY
#define ENDPOINT_INTERRUPT_1ms
#define MP_STATUS_NOT_SUPPORTED
#define USB_MINIPORT_FLAGS_INTERRUPT
#define MP_STATUS_NO_RESOURCES
#define ENDPOINT_INTERRUPT_4ms
#define ENDPOINT_INTERRUPT_2ms
#define USB_MINIPORT_FLAGS_WAKE_SUPPORT
#define TOTAL_USB20_BUS_BANDWIDTH
#define USBPORT_RESOURCES_INTERRUPT
#define MP_STATUS_HW_ERROR
#define USBPORT_TRANSFER_TYPE_CONTROL
#define USBPORT_INVALIDATE_CONTROLLER_SURPRISE_REMOVE
#define MP_STATUS_FAILURE
#define USBPORT_ENDPOINT_CONTROL
#define USB20_MINIPORT_INTERFACE_VERSION
#define MP_STATUS_SUCCESS
#define USBPORT_INVALIDATE_CONTROLLER_SOFT_INTERRUPT
#define USBPORT_TRANSFER_TYPE_BULK
ULONG NTAPI USBPORT_GetHciMn(VOID)
NTSTATUS NTAPI USBPORT_RegisterUSBPortDriver(IN PDRIVER_OBJECT DriverObject, IN ULONG Version, IN PUSBPORT_REGISTRATION_PACKET RegPacket)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION _In_ PSCATTER_GATHER_LIST SgList
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET SetupPacket
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
_In_ LARGE_INTEGER _In_ ULONG Period