13#define NDEBUG_OHCI_TRACE
32 0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30,
33 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31
52 DPRINT(
"gTD.Control - %08X\n", TD->
HwTD.gTD.Control.AsULONG);
53 if (TD->
HwTD.gTD.CurrentBuffer)
54 DPRINT(
"gTD.CurrentBuffer - %08X\n", TD->
HwTD.gTD.CurrentBuffer);
55 if (TD->
HwTD.gTD.NextTD)
56 DPRINT(
"gTD.NextTD - %08X\n", TD->
HwTD.gTD.NextTD);
57 if (TD->
HwTD.gTD.BufferEnd)
58 DPRINT(
"gTD.BufferEnd - %08X\n", TD->
HwTD.gTD.BufferEnd);
60 if (TD->
HwTD.SetupPacket.bmRequestType.B)
61 DPRINT(
"bmRequestType - %02X\n", TD->
HwTD.SetupPacket.bmRequestType.B);
62 if (TD->
HwTD.SetupPacket.bRequest)
63 DPRINT(
"bRequest - %02X\n", TD->
HwTD.SetupPacket.bRequest);
64 if (TD->
HwTD.SetupPacket.wValue.W)
65 DPRINT(
"wValue - %04X\n", TD->
HwTD.SetupPacket.wValue.W);
66 if (TD->
HwTD.SetupPacket.wIndex.W)
67 DPRINT(
"wIndex - %04X\n", TD->
HwTD.SetupPacket.wIndex.W);
68 if (TD->
HwTD.SetupPacket.wLength)
69 DPRINT(
"wLength - %04X\n", TD->
HwTD.SetupPacket.wLength);
91 OperationalRegs = OhciExtension->OperationalRegs;
102 TransferType = OhciEndpoint->EndpointProperties.TransferType;
121 DPRINT_OHCI(
"OHCI_InsertEndpointInSchedule: OhciEndpoint - %p\n",
124 ED = OhciEndpoint->HcdED;
126 HeadED = OhciEndpoint->HeadED;
127 HeadLink = &HeadED->
Link;
146 DPRINT1(
"OHCI_InsertEndpointInSchedule: Unknown HeadED->Type - %x\n",
174 DPRINT_OHCI(
"OHCI_InitializeED: OhciEndpoint - %p, ED - %p, FirstTD - %p, EdPA - %p\n",
182 ED->PhysicalAddress = EdPA;
184 EndpointProperties = &OhciEndpoint->EndpointProperties;
186 EndpointControl = ED->HwED.EndpointControl;
211 EndpointControl.
sKip = 1;
213 ED->HwED.EndpointControl = EndpointControl;
215 ED->HwED.TailPointer = FirstTD->PhysicalAddress;
216 ED->HwED.HeadPointer = FirstTD->PhysicalAddress;
220 OhciEndpoint->HcdTailP = FirstTD;
221 OhciEndpoint->HcdHeadP = FirstTD;
238 TdCount = (EndpointProperties->BufferLength -
sizeof(
OHCI_HCD_ED)) /
241 OhciEndpoint->MaxTransferDescriptors = TdCount;
243 DPRINT_OHCI(
"OHCI_InitializeTDs: TdCount - %x\n", TdCount);
247 TdVA = OhciEndpoint->FirstTD;
249 TdPA = EndpointProperties->BufferPA +
sizeof(
OHCI_HCD_ED);
251 for (ix = 0; ix < TdCount; ix++)
253 DPRINT_OHCI(
"OHCI_InitializeTDs: TdVA - %p, TdPA - %08X\n", TdVA, TdPA);
279 OhciEndpoint->HeadED = &OhciExtension->ControlStaticED;
285 OhciEndpoint->FirstTD,
286 EndpointProperties->BufferPA);
309 OhciEndpoint->HeadED = &OhciExtension->BulkStaticED;
315 OhciEndpoint->FirstTD,
316 EndpointProperties->BufferPA);
332 ULONG ScheduleOffset;
340 Period = EndpointProperties->Period;
352 ScheduleOffset = EndpointProperties->ScheduleOffset;
353 DPRINT_OHCI(
"OHCI_OpenInterruptEndpoint: InitTD. Index[PeriodIdx] - %x, ScheduleOffset - %x\n",
357 OhciEndpoint->HeadED = &OhciExtension->IntStaticED[
Index[PeriodIdx] +
366 OhciEndpoint->FirstTD,
367 EndpointProperties->BufferPA);
380 DPRINT1(
"OHCI_OpenIsoEndpoint: UNIMPLEMENTED. FIXME\n");
403 TransferType = EndpointProperties->TransferType;
405 switch (TransferType)
450 ED = OhciEndpoint->
HcdED;
473 DPRINT_OHCI(
"OHCI_QueryEndpointRequirements: ... \n");
475 TransferType = EndpointProperties->TransferType;
477 switch (TransferType)
480 DPRINT_OHCI(
"OHCI_QueryEndpointRequirements: IsoTransfer\n");
482 EndpointRequirements->HeaderBufferSize =
487 DPRINT_OHCI(
"OHCI_QueryEndpointRequirements: ControlTransfer\n");
489 EndpointRequirements->HeaderBufferSize =
494 DPRINT_OHCI(
"OHCI_QueryEndpointRequirements: BulkTransfer\n");
496 EndpointRequirements->HeaderBufferSize =
501 DPRINT_OHCI(
"OHCI_QueryEndpointRequirements: InterruptTransfer\n");
503 EndpointRequirements->HeaderBufferSize =
508 DPRINT1(
"OHCI_QueryEndpointRequirements: Unknown TransferType - %x\n",
522 DPRINT1(
"OHCI_CloseEndpoint: Not supported\n");
534 PULONG InterruptEnableReg;
535 PULONG InterruptDisableReg;
537 PULONG InterruptStatusReg;
546 DPRINT(
"OHCI_TakeControlHC: ...\n");
548 OperationalRegs = OhciExtension->OperationalRegs;
559 if (
Control.InterruptRouting == 0)
562 DPRINT1(
"OHCI_TakeControlHC: detected Legacy BIOS\n");
566 DPRINT(
"OHCI_TakeControlHC: Control - %lX, IntEnable - %lX\n",
606 if (
Control.InterruptRouting == 0)
609 IntStatus.
AsULONG = 0xFFFFFFFF;
638 PULONG InterruptEnableReg;
644 ULONG MaxFrameIntervalAdjusting;
656 DPRINT_OHCI(
"OHCI_StartController: ohciExtension - %p, Resources - %p\n",
676 DPRINT1(
"OHCI_StartController: OHCI_TakeControlHC return MPStatus - %x\n",
685 DPRINT_OHCI(
"OHCI_StartController: HcResourcesVA - %p, HcResourcesPA - %lx\n",
704 HeadIndex = ((ix - 1) / 2);
727 DPRINT_OHCI(
"OHCI_InitializeSchedule: OhciHCCA - %p\n", OhciHCCA);
743 DPRINT_OHCI(
"OHCI_InitializeSchedule: ix - %x\n", ix);
778 DPRINT_OHCI(
"OHCI_StartController: FrameInterval - %lX\n",
819 DPRINT_OHCI(
"OHCI_StartController: frame interval not set\n");
845 Control.ControlBulkServiceRatio = 0;
846 Control.PeriodicListEnable = 1;
871 PULONG InterruptDisableReg;
872 PULONG InterruptStatusReg;
877 DPRINT(
"OHCI_StopController: ... \n");
888 Control.PeriodicListEnable = 0;
893 Control.RemoteWakeupEnable = 0;
898 IntDisable.
AsULONG = 0xFFFFFFFF;
902 IntStatus.
AsULONG = 0xFFFFFFFF;
913 PULONG InterruptEnableReg;
917 DPRINT(
"OHCI_SuspendController: ... \n");
934 Control.RemoteWakeupEnable = 1;
955 PULONG InterruptEnableReg;
960 DPRINT(
"OHCI_ResumeController \n");
1000 OperationalRegs = OhciExtension->OperationalRegs;
1006 DPRINT1(
"OHCI_HardwarePresent: IsInvalidateController - %x\n",
1007 IsInvalidateController);
1009 if (IsInvalidateController)
1029 DPRINT_OHCI(
"OHCI_Interrupt: Ext %p\n", OhciExtension);
1035 if (!HardwarePresent)
1045 DPRINT1(
"OHCI_InterruptService: IntStatus.UnrecoverableError\n");
1061 OhciExtension->
FrameHighPart += 1 * (1 << 16) - ((hp ^ fm) & 0x8000);
1080 PULONG InterruptDisableReg;
1081 PULONG InterruptEnableReg;
1082 PULONG InterruptStatusReg;
1093 DPRINT_OHCI(
"OHCI_InterruptDpc: OhciExtension - %p, IsDoEnableInterrupts - %x\n",
1095 IsDoEnableInterrupts);
1101 DPRINT_OHCI(
"OHCI_InterruptDpc: RootHubStatusChange\n");
1107 DPRINT_OHCI(
"OHCI_InterruptDpc: WritebackDoneHead\n");
1125 DPRINT1(
"OHCI_IntDpc: ResumeDetected\n");
1129 DPRINT1(
"OHCI_IntDpc: UnrecoverableError\n");
1134 if (IsDoEnableInterrupts)
1165 ULONG TransferDataLeft = OhciTransfer->TransferParameters->TransferBufferLength - TransferedLen;
1167 DPRINT_OHCI(
"OHCI_MapTransferToTD: TransferedLen - %x\n", TransferedLen);
1169 for (SgIdx = 0; SgIdx < SGList->SgElementCount; SgIdx++)
1171 SgElement = &SGList->SgElement[SgIdx];
1173 if (TransferedLen >= SgElement->
SgOffset &&
1180 DPRINT_OHCI(
"OHCI_MapTransferToTD: SgIdx - %x, SgCount - %x\n",
1182 SGList->SgElementCount);
1184 ASSERT(SgIdx < SGList->SgElementCount);
1197 if (TransferDataLeft <= SgElement->SgTransferLength)
1199 CurrentTransferLen = TransferDataLeft;
1205 ASSERT(SGList->SgElementCount - SgIdx > 1);
1207 SgNextElement = &SGList->SgElement[SgIdx + 1];
1212 if (TransferDataLeft <= SgNextElement->SgTransferLength)
1214 CurrentTransferLen += TransferDataLeft;
1226 TD->TransferLen = CurrentTransferLen;
1228 return TransferedLen + CurrentTransferLen;
1240 TD = OhciEndpoint->FirstTD;
1266 MaxTDs = OhciEndpoint->MaxTransferDescriptors;
1267 TD = OhciEndpoint->FirstTD;
1271 for (ix = 0; ix < MaxTDs; ix++)
1294 ULONG TransferedLen;
1297 DPRINT_OHCI(
"OHCI_ControlTransfer: Ext %p, Endpoint %p\n",
1307 SetupTD = OhciEndpoint->HcdTailP;
1316 &TransferParameters->SetupPacket,
1317 sizeof(SetupTD->
HwTD.SetupPacket));
1340 while (TransferedLen < TransferParameters->TransferBufferLength)
1342 OhciTransfer->PendingTDs++;
1351 TD->
HwTD.gTD.Control.DataToggle = DataToggle;
1374 PrevTD->
HwTD.gTD.Control.BufferRounding =
TRUE;
1385 TD->
HwTD.gTD.Control.BufferRounding =
FALSE;
1390 TD->
HwTD.gTD.Control.BufferRounding =
TRUE;
1399 OhciTransfer->PendingTDs++;
1400 OhciTransfer->ControlStatusTD = TD;
1413 OhciTransfer->NextTD = TD;
1414 OhciEndpoint->HcdTailP = TD;
1433 ULONG TransferedLen;
1436 DPRINT_OHCI(
"OHCI_BulkOrInterruptTransfer: ... \n");
1440 if (SGList->SgElementCount > MaxTDs)
1443 TD = OhciEndpoint->HcdTailP;
1454 TD->
HwTD.gTD.Control.BufferRounding =
FALSE;
1459 TD->
HwTD.gTD.Control.BufferRounding =
TRUE;
1466 if (TransferParameters->TransferBufferLength)
1476 ASSERT(SGList->SgElementCount == 0);
1483 OhciTransfer->PendingTDs++;
1488 while (TransferedLen < TransferParameters->TransferBufferLength);
1492 PrevTD->
HwTD.gTD.Control.BufferRounding =
TRUE;
1504 OhciTransfer->NextTD = TD;
1505 OhciEndpoint->HcdTailP = TD;
1579 DPRINT1(
"OHCI_SubmitIsoTransfer: UNIMPLEMENTED. FIXME\n");
1597 OhciTransfer = TD->OhciTransfer;
1602 Buffer = TD->HwTD.gTD.CurrentBuffer;
1611 if (TD->HwTD.gTD.CurrentBuffer)
1613 if (TD->TransferLen)
1623 TD->TransferLen -=
Length;
1630 if (TD->HwTD.gTD.Control.ConditionCode)
1633 TD->HwTD.gTD.Control.ConditionCode;
1638 TD->HwTD.gTD.NextTD = 0;
1639 TD->OhciTransfer = 0;
1641 TD->DoneLink.Flink =
NULL;
1642 TD->DoneLink.Blink =
NULL;
1644 if (IsPortComplete && (OhciTransfer->
PendingTDs == 0))
1660 DPRINT1(
"OHCI_ProcessDoneIsoTD: UNIMPLEMENTED. FIXME\n");
1687 DPRINT(
"OHCI_AbortTransfer: ohciEndpoint - %p, ohciTransfer - %p\n",
1698 LastTD = OhciTransfer->
NextTD;
1708 TD = &OhciEndpoint->
FirstTD[ix];
1723 if (NextTD == OhciEndpoint->
HcdHeadP)
1775 DPRINT(
"OHCI_AbortTransfer: *CompletedLength - %x\n", *CompletedLength);
1789 ED = OhciEndpoint->
HcdED;
1808 DPRINT_OHCI(
"OHCI_RemoveEndpointFromSchedule \n");
1810 ED = OhciEndpoint->HcdED;
1811 HeadED = OhciEndpoint->HeadED;
1826 DPRINT1(
"OHCI_RemoveEndpointFromSchedule: Unknown HeadED->Type - %x\n",
1842 OhciEndpoint->HeadED =
NULL;
1855 DPRINT_OHCI(
"OHCI_SetEndpointState: EndpointState - %x\n",
1858 ED = OhciEndpoint->
HcdED;
1860 switch (EndpointState)
1897 ULONG TransferNumber;
1899 UCHAR ConditionCode;
1904 ED = OhciEndpoint->HcdED;
1919 goto ProcessListTDs;
1924 DPRINT1(
"PollAsyncEndpoint: IsResetOnHalt %x\n", IsResetOnHalt);
1926 for (TD = OhciEndpoint->HcdHeadP; ; TD = TD->
NextTDVa)
1936 DPRINT(
"TD == NextTD - %p\n", TD);
1937 goto HandleDoneList;
1941 ConditionCode = TD->
HwTD.gTD.Control.ConditionCode;
1943 DPRINT(
"TD - %p, ConditionCode - %X\n", TD, ConditionCode);
1946 switch (ConditionCode)
1959 DPRINT1(
"DATA_UNDERRUN. Transfer->Flags - %X\n", OhciTransfer->
Flags);
1963 IsResetOnHalt =
TRUE;
1987 transfer = OhciTransfer;
1992 NextTD = transfer->
NextTD;
1994 while (transfer && TransferNumber ==
2012 NextTD = OhciTransfer->
NextTD;
2032 NextTD = OhciTransfer->
NextTD;
2039 TD = OhciEndpoint->HcdHeadP;
2041 while (TD != NextTD)
2052 OhciEndpoint->HcdHeadP = NextTD;
2054 DoneList = &OhciEndpoint->TDList;
2083 DPRINT1(
"OHCI_PollAsyncEndpoint: UNIMPLEMENTED. FIXME \n");
2096 DPRINT_OHCI(
"OHCI_PollEndpoint: OhciExtension - %p, Endpoint - %p\n",
2144 if (FmNumber == 0 || FmDiff < 5)
2150 if (HcHCCA->
Pad1 == 0)
2152 HcHCCA->
Pad1 = 0xBAD1;
2156 DPRINT1(
"OHCI_CheckController: HcHCCA->Pad1 - %x\n", HcHCCA->
Pad1);
2158 if (HcHCCA->
Pad1 == 0xBAD1)
2160 HcHCCA->
Pad1 = 0xBAD2;
2162 else if (HcHCCA->
Pad1 == 0xBAD2)
2164 HcHCCA->
Pad1 = 0xBAD3;
2187 DPRINT_OHCI(
"OHCI_Get32BitFrameNumber: hp - %lX, fm - %lX\n", hp, fm);
2189 return ((fm & 0x7FFF) | hp) + ((fm ^ hp) & 0x8000);
2198 PULONG InterruptEnableReg;
2201 DPRINT_OHCI(
"OHCI_InterruptNextSOF: OhciExtension - %p\n",
2220 PULONG InterruptEnableReg;
2223 DPRINT_OHCI(
"OHCI_EnableInterrupts: OhciExtension - %p\n",
2242 PULONG InterruptDisableReg;
2261 DPRINT1(
"OHCI_PollController: UNIMPLEMENTED. FIXME\n");
2273 DPRINT_OHCI(
"OHCI_SetEndpointDataToggle: Endpoint - %p, DataToggle - %x\n",
2277 ED = OhciEndpoint->
HcdED;
2296 ED = OhciEndpoint->
HcdED;
2304 return EndpointStatus;
2317 DPRINT_OHCI(
"OHCI_SetEndpointStatus: Endpoint - %p, EndpointStatus - %lX\n",
2323 ED = OhciEndpoint->
HcdED;
2343 PULONG InterruptEnableReg;
2363 DPRINT(
"OHCI_ResetController: ... \n");
2424 for (ix = 0; ix < NumPorts; ix++)
2435 IntEnable.
AsULONG = 0xFFFFFFFF;
2451 DPRINT1(
"OHCI_StartSendOnePacket: UNIMPLEMENTED. FIXME\n");
2466 DPRINT1(
"OHCI_EndSendOnePacket: UNIMPLEMENTED. FIXME\n");
2477 DPRINT1(
"OHCI_PassThru: UNIMPLEMENTED. FIXME\n");
2486 DPRINT1(
"OHCI_Unload: Not supported\n");
2496 DPRINT1(
"OHCI_FlushInterrupts: Not supported\n");
2508 DPRINT_OHCI(
"DriverEntry: DriverObject - %p, RegistryPath - %wZ\n",
2581 DPRINT_OHCI(
"DriverEntry: USBPORT_RegisterUSBPortDriver return Status - %x\n",
static ACPI_BUFFER CurrentBuffer
#define WRITE_REGISTER_ULONG(r, v)
#define READ_REGISTER_ULONG(r)
DRIVER_INITIALIZE DriverEntry
#define OHCI_HC_STATE_RESET
#define OHCI_ED_HEAD_POINTER_MASK
#define OHCI_ED_DATA_FLOW_DIRECTION_OUT
#define OHCI_ED_HEAD_POINTER_HALT
struct _OHCI_OPERATIONAL_REGISTERS * POHCI_OPERATIONAL_REGISTERS
#define OHCI_NUMBER_OF_INTERRUPTS
#define OHCI_DEFAULT_FRAME_INTERVAL
#define OHCI_ED_DATA_FLOW_DIRECTION_FROM_TD
#define OHCI_HC_STATE_SUSPEND
#define OHCI_TD_DIRECTION_PID_IN
#define OHCI_TD_DATA_TOGGLE_DATA0
#define OHCI_HC_STATE_OPERATIONAL
#define OHCI_TD_DIRECTION_PID_OUT
#define OHCI_TD_DATA_TOGGLE_DATA1
#define OHCI_TD_INTERRUPT_NONE
#define OHCI_ENDPOINT_LOW_SPEED
#define OHCI_ENDPOINT_ISOCHRONOUS_FORMAT
#define OHCI_TD_CONDITION_NO_ERROR
#define OHCI_TD_CONDITION_DATA_UNDERRUN
#define OHCI_MAXIMUM_OVERHEAD
#define OHCI_TD_INTERRUPT_IMMEDIATE
#define OHCI_ED_HEAD_POINTER_FLAGS_MASK
#define OHCI_ED_HEAD_POINTER_CARRY
#define OHCI_ED_DATA_FLOW_DIRECTION_IN
#define OHCI_TD_DIRECTION_PID_SETUP
#define OHCI_TD_CONDITION_NOT_ACCESSED
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define KeStallExecutionProcessor(MicroSeconds)
_In_ ULONG _In_ ULONG _In_ ULONG Length
ULONG NTAPI KeQueryTimeIncrement(VOID)
#define KeQueryTickCount(CurrentCount)
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
OHCI_ENDPOINT_CONTROL EndpointControl
USBPORT_ENDPOINT_PROPERTIES EndpointProperties
ULONG MaxTransferDescriptors
OHCI_STATIC_ED ControlStaticED
POHCI_HC_RESOURCES HcResourcesVA
OHCI_STATIC_ED IntStaticED[63]
OHCI_REG_FRAME_INTERVAL FrameInterval
OHCI_STATIC_ED BulkStaticED
POHCI_OPERATIONAL_REGISTERS OperationalRegs
ULONG InterrruptTable[OHCI_NUMBER_OF_INTERRUPTS]
OHCI_ENDPOINT_DESCRIPTOR HwED
struct _OHCI_HCD_TD * NextTDVa
POHCI_TRANSFER OhciTransfer
OHCI_HW_TRANSFER_DESCRIPTOR HwTD
OHCI_ENDPOINT_DESCRIPTOR InterrruptHeadED[63]
OHCI_REG_INTERRUPT_STATUS HcInterruptStatus
OHCI_REG_COMMAND_STATUS HcCommandStatus
OHCI_REG_CONTROL HcControl
OHCI_REG_INTERRUPT_ENABLE_DISABLE HcInterruptEnable
OHCI_REG_INTERRUPT_ENABLE_DISABLE HcInterruptDisable
OHCI_REG_RH_STATUS HcRhStatus
OHCI_REG_RH_PORT_STATUS HcRhPortStatus[OHCI_MAX_PORT_COUNT]
OHCI_REG_FRAME_INTERVAL HcFmInterval
POHCI_ENDPOINT_DESCRIPTOR HwED
POHCI_HCD_TD ControlStatusTD
POHCI_ENDPOINT OhciEndpoint
PUSBPORT_TRANSFER_PARAMETERS TransferParameters
USB_DEVICE_SPEED DeviceSpeed
USHORT TotalMaxPacketSize
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
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
PHCI_RESET_CONTROLLER ResetController
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
PHCI_CLOSE_ENDPOINT CloseEndpoint
ULONG MiniPortBusBandwidth
PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND_CHANGE RH_ClearFeaturePortSuspendChange
PHCI_END_SEND_ONE_PACKET EndSendOnePacket
PHCI_RH_SET_FEATURE_PORT_RESET RH_SetFeaturePortReset
PUSBPORT_COMPLETE_TRANSFER UsbPortCompleteTransfer
PHCI_INTERRUPT_SERVICE InterruptService
PHCI_START_CONTROLLER StartController
PHCI_REOPEN_ENDPOINT ReopenEndpoint
PHCI_INTERRUPT_DPC InterruptDpc
PHCI_RH_CLEAR_FEATURE_PORT_CONNECT_CHANGE RH_ClearFeaturePortConnectChange
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_RH_GET_STATUS RH_GetStatus
PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND RH_ClearFeaturePortSuspend
PHYSICAL_ADDRESS SgPhysicalAddress
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
ULONG OwnershipChangeRequest
ULONG HostControllerReset
ULONG HostControllerFunctionalState
ULONG FSLargestDataPacket
ULONG FrameIntervalToggle
ULONG FrameNumberOverflow
ULONG RootHubStatusChange
ULONG MasterInterruptEnable
ULONG RootHubStatusChange
ULONG FrameNumberOverflow
ULONG NumberDownstreamPorts
ULONG SetRemoteWakeupEnable
struct _USB_DEFAULT_PIPE_SETUP_PACKET USB_DEFAULT_PIPE_SETUP_PACKET
#define USBD_TRANSFER_DIRECTION_IN
#define USBD_SHORT_TRANSFER_OK
#define USBD_STATUS_HALTED
_In_ ULONG ParameterLength
#define USBPORT_ENDPOINT_REMOVE
#define USBPORT_ENDPOINT_ACTIVE
#define ENDPOINT_INTERRUPT_16ms
#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 USBPORT_TRANSFER_TYPE_INTERRUPT
#define USBPORT_ENDPOINT_PAUSED
#define USBPORT_TRANSFER_TYPE_ISOCHRONOUS
#define ENDPOINT_INTERRUPT_1ms
#define MP_STATUS_NOT_SUPPORTED
#define USB_MINIPORT_FLAGS_INTERRUPT
#define ENDPOINT_INTERRUPT_4ms
#define ENDPOINT_INTERRUPT_2ms
#define TOTAL_USB11_BUS_BANDWIDTH
#define USBPORT_INVALIDATE_CONTROLLER_RESET
#define MP_STATUS_HW_ERROR
#define USBPORT_TRANSFER_TYPE_CONTROL
#define USBPORT_INVALIDATE_CONTROLLER_SURPRISE_REMOVE
#define USB_MINIPORT_VERSION_OHCI
#define MP_STATUS_FAILURE
#define MP_STATUS_SUCCESS
#define USB10_MINIPORT_INTERFACE_VERSION
#define USBPORT_TRANSFER_TYPE_BULK
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortSuspendChange(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_SetFeaturePortPower(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortConnectChange(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_GetHubStatus(IN PVOID ohciExtension, IN PUSB_HUB_STATUS_AND_CHANGE HubStatus)
OHCI_REG_RH_DESCRIPTORA NTAPI OHCI_ReadRhDescriptorA(IN POHCI_EXTENSION OhciExtension)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortOvercurrentChange(IN PVOID ohciExtension, IN USHORT Port)
VOID NTAPI OHCI_RH_GetRootHubData(IN PVOID ohciExtension, IN PVOID rootHubData)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortResetChange(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortPower(IN PVOID ohciExtension, IN USHORT Port)
VOID NTAPI OHCI_RH_DisableIrq(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortEnableChange(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortEnable(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_SetFeaturePortReset(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_GetStatus(IN PVOID ohciExtension, IN PUSHORT Status)
MPSTATUS NTAPI OHCI_RH_SetFeaturePortEnable(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_GetPortStatus(IN PVOID ohciExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus)
VOID NTAPI OHCI_RH_EnableIrq(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_RH_ClearFeaturePortSuspend(IN PVOID ohciExtension, IN USHORT Port)
MPSTATUS NTAPI OHCI_RH_SetFeaturePortSuspend(IN PVOID ohciExtension, IN USHORT Port)
ULONG NTAPI OHCI_GetEndpointStatus(IN PVOID ohciExtension, IN PVOID ohciEndpoint)
VOID NTAPI OHCI_SetEndpointDataToggle(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN ULONG DataToggle)
BOOLEAN NTAPI OHCI_InterruptService(IN PVOID ohciExtension)
VOID NTAPI OHCI_DumpHcdTD(POHCI_HCD_TD TD)
MPSTATUS NTAPI OHCI_EndSendOnePacket(IN PVOID ohciExtension, IN PVOID PacketParameters, IN PVOID Data, IN PULONG pDataLength, IN PVOID BufferVA, IN PVOID BufferPA, IN ULONG BufferLength, IN USBD_STATUS *pUSBDStatus)
VOID NTAPI OHCI_CloseEndpoint(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN BOOLEAN IsDoDisablePeriodic)
VOID NTAPI OHCI_PollController(IN PVOID ohciExtension)
VOID NTAPI OHCI_InitializeTDs(IN POHCI_ENDPOINT OhciEndpoint, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties)
ULONG NTAPI OHCI_RemainTDs(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint)
VOID NTAPI OHCI_StopController(IN PVOID ohciExtension, IN BOOLEAN IsDoDisableInterrupts)
VOID NTAPI OHCI_ProcessDoneIsoTD(IN POHCI_EXTENSION OhciExtension, IN POHCI_HCD_TD TD, IN BOOLEAN IsPortComplete)
VOID NTAPI OHCI_SuspendController(IN PVOID ohciExtension)
BOOLEAN NTAPI OHCI_HardwarePresent(IN POHCI_EXTENSION OhciExtension, IN BOOLEAN IsInvalidateController)
VOID NTAPI OHCI_PollEndpoint(IN PVOID ohciExtension, IN PVOID ohciEndpoint)
VOID NTAPI OHCI_InsertEndpointInSchedule(IN POHCI_ENDPOINT OhciEndpoint)
VOID NTAPI OHCI_DisableInterrupts(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_OpenBulkEndpoint(IN POHCI_EXTENSION OhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN POHCI_ENDPOINT OhciEndpoint)
VOID NTAPI OHCI_QueryEndpointRequirements(IN PVOID ohciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PUSBPORT_ENDPOINT_REQUIREMENTS EndpointRequirements)
MPSTATUS NTAPI OHCI_ResumeController(IN PVOID ohciExtension)
static ULONG OHCI_MapTransferToTD(IN POHCI_EXTENSION OhciExtension, IN ULONG TransferedLen, IN POHCI_TRANSFER OhciTransfer, OUT POHCI_HCD_TD TD, IN PUSBPORT_SCATTER_GATHER_LIST SGList)
Forms the next General Transfer Descriptor for the current transfer.
VOID NTAPI OHCI_FlushInterrupts(IN PVOID uhciExtension)
VOID NTAPI OHCI_InterruptNextSOF(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_SubmitTransfer(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PVOID ohciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SGList)
Creates the transfer descriptor chain for the given transfer's buffer and attaches it to a given endp...
USBPORT_REGISTRATION_PACKET RegPacket
MPSTATUS NTAPI OHCI_StartSendOnePacket(IN PVOID ohciExtension, IN PVOID PacketParameters, IN PVOID Data, IN PULONG pDataLength, IN PVOID BufferVA, IN PVOID BufferPA, IN ULONG BufferLength, IN USBD_STATUS *pUSBDStatus)
VOID NTAPI OHCI_AbortTransfer(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN PVOID ohciTransfer, IN OUT PULONG CompletedLength)
Aborts the transfer descriptor chain in a given endpoint.
VOID NTAPI OHCI_EnableList(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint)
MPSTATUS NTAPI OHCI_SubmitIsoTransfer(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN PVOID ohciTransfer, IN PVOID isoParameters)
static const UCHAR Balance[OHCI_NUMBER_OF_INTERRUPTS]
VOID NTAPI OHCI_CheckController(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_TakeControlHC(IN POHCI_EXTENSION OhciExtension, IN PUSBPORT_RESOURCES Resources)
VOID NTAPI OHCI_SetEndpointStatus(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN ULONG EndpointStatus)
VOID NTAPI OHCI_ResetController(IN PVOID ohciExtension)
VOID NTAPI OHCI_PollAsyncEndpoint(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint)
MPSTATUS NTAPI OHCI_OpenControlEndpoint(IN POHCI_EXTENSION OhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN POHCI_ENDPOINT OhciEndpoint)
MPSTATUS NTAPI OHCI_OpenInterruptEndpoint(IN POHCI_EXTENSION OhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN POHCI_ENDPOINT OhciEndpoint)
VOID NTAPI OHCI_RemoveEndpointFromSchedule(IN POHCI_ENDPOINT OhciEndpoint)
MPSTATUS NTAPI OHCI_StartController(IN PVOID ohciExtension, IN PUSBPORT_RESOURCES Resources)
ULONG NTAPI OHCI_Get32BitFrameNumber(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_OpenIsoEndpoint(IN POHCI_EXTENSION OhciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN POHCI_ENDPOINT OhciEndpoint)
MPSTATUS NTAPI OHCI_PassThru(IN PVOID ohciExtension, IN PVOID passThruParameters, IN ULONG ParameterLength, IN PVOID pParameters)
VOID NTAPI OHCI_EnableInterrupts(IN PVOID ohciExtension)
MPSTATUS NTAPI OHCI_OpenEndpoint(IN PVOID ohciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PVOID ohciEndpoint)
VOID NTAPI OHCI_ProcessDoneTD(IN POHCI_EXTENSION OhciExtension, IN POHCI_HCD_TD TD, IN BOOLEAN IsPortComplete)
POHCI_HCD_ED NTAPI OHCI_InitializeED(IN POHCI_ENDPOINT OhciEndpoint, IN POHCI_HCD_ED ED, IN POHCI_HCD_TD FirstTD, IN ULONG_PTR EdPA)
VOID NTAPI OHCI_PollIsoEndpoint(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint)
POHCI_HCD_TD NTAPI OHCI_AllocateTD(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint)
static MPSTATUS OHCI_ControlTransfer(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN POHCI_TRANSFER OhciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SGList)
static MPSTATUS OHCI_BulkOrInterruptTransfer(IN POHCI_EXTENSION OhciExtension, IN POHCI_ENDPOINT OhciEndpoint, IN PUSBPORT_TRANSFER_PARAMETERS TransferParameters, IN POHCI_TRANSFER OhciTransfer, IN PUSBPORT_SCATTER_GATHER_LIST SGList)
VOID NTAPI OHCI_InterruptDpc(IN PVOID ohciExtension, IN BOOLEAN IsDoEnableInterrupts)
VOID NTAPI OHCI_DumpHcdED(POHCI_HCD_ED ED)
VOID NTAPI OHCI_SetEndpointState(IN PVOID ohciExtension, IN PVOID ohciEndpoint, IN ULONG EndpointState)
ULONG NTAPI OHCI_GetEndpointState(IN PVOID ohciExtension, IN PVOID ohciEndpoint)
MPSTATUS NTAPI OHCI_ReopenEndpoint(IN PVOID ohciExtension, IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties, IN PVOID ohciEndpoint)
VOID NTAPI OHCI_Unload(IN PDRIVER_OBJECT DriverObject)
#define OHCI_STATIC_ED_TYPE_INTERRUPT
#define OHCI_HCD_ED_FLAG_NOT_ACCESSED
struct _OHCI_HCD_ED OHCI_HCD_ED
#define OHCI_HCD_TD_FLAG_PROCESSED
struct _OHCI_HC_RESOURCES OHCI_HC_RESOURCES
struct _OHCI_HCD_ED * POHCI_HCD_ED
#define OHCI_MAX_INTERRUPT_TRANSFER_SIZE
struct _OHCI_EXTENSION OHCI_EXTENSION
#define OHCI_STATIC_ED_TYPE_BULK
#define OHCI_HCD_TD_FLAG_NOT_ACCESSED
#define OHCI_MAX_ISO_TD_COUNT
#define OHCI_HCD_TD_FLAG_CONTROL_STATUS
#define OHCI_MAX_BULK_TRANSFER_SIZE
#define OHCI_MAX_CONTROL_TRANSFER_SIZE
#define OHCI_HCD_TD_FLAG_DONE
struct _OHCI_HC_RESOURCES * POHCI_HC_RESOURCES
#define OHCI_MAX_ISO_TRANSFER_SIZE
#define OHCI_HCD_ED_FLAG_CONTROL
#define OHCI_NON_DATA_CONTROL_TDS
#define OHCI_TRANSFER_FLAGS_SHORT_TRANSFER_OK
struct _OHCI_TRANSFER OHCI_TRANSFER
struct _OHCI_ENDPOINT OHCI_ENDPOINT
struct _OHCI_HCD_TD OHCI_HCD_TD
#define OHCI_HCD_TD_FLAG_ALLOCATED
#define OHCI_HCD_ED_FLAG_RESET_ON_HALT
#define OHCI_MAX_INTERRUPT_TD_COUNT
#define OHCI_MAX_CONTROL_TD_COUNT
#define OHCI_MAX_BULK_TD_COUNT
#define OHCI_STATIC_ED_TYPE_CONTROL
NTSTATUS NTAPI USBPORT_RegisterUSBPortDriver(IN PDRIVER_OBJECT DriverObject, IN ULONG Version, IN PUSBPORT_REGISTRATION_PACKET RegPacket)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_In_ WDF_WMI_PROVIDER_CONTROL Control
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
_In_ LARGE_INTEGER _In_ ULONG Period
FORCEINLINE PVOID RtlSecureZeroMemory(_Out_writes_bytes_all_(Size) PVOID Pointer, _In_ SIZE_T Size)