4#define USBPORT_HCI_MN 0x10000001
7#define USBPORT_TRANSFER_TYPE_ISOCHRONOUS 0
8#define USBPORT_TRANSFER_TYPE_CONTROL 1
9#define USBPORT_TRANSFER_TYPE_BULK 2
10#define USBPORT_TRANSFER_TYPE_INTERRUPT 3
13#define USBPORT_ENDPOINT_UNKNOWN 0
14#define USBPORT_ENDPOINT_PAUSED 2
15#define USBPORT_ENDPOINT_ACTIVE 3
16#define USBPORT_ENDPOINT_REMOVE 4
17#define USBPORT_ENDPOINT_CLOSED 5
20#define USBPORT_ENDPOINT_RUN 0
21#define USBPORT_ENDPOINT_HALT 1
22#define USBPORT_ENDPOINT_CONTROL 4
25#define ENDPOINT_INTERRUPT_1ms 1
26#define ENDPOINT_INTERRUPT_2ms 2
27#define ENDPOINT_INTERRUPT_4ms 4
28#define ENDPOINT_INTERRUPT_8ms 8
29#define ENDPOINT_INTERRUPT_16ms 16
30#define ENDPOINT_INTERRUPT_32ms 32
32#define INTERRUPT_ENDPOINTs (ENDPOINT_INTERRUPT_32ms + \
33 ENDPOINT_INTERRUPT_16ms + \
34 ENDPOINT_INTERRUPT_8ms + \
35 ENDPOINT_INTERRUPT_4ms + \
36 ENDPOINT_INTERRUPT_2ms + \
37 ENDPOINT_INTERRUPT_1ms)
40#define USBPORT_RESOURCES_PORT 1
41#define USBPORT_RESOURCES_INTERRUPT 2
42#define USBPORT_RESOURCES_MEMORY 4
134#define MP_STATUS_SUCCESS 0
135#define MP_STATUS_FAILURE 1
136#define MP_STATUS_NO_RESOURCES 2
137#define MP_STATUS_NO_BANDWIDTH 3
138#define MP_STATUS_ERROR 4
139#define MP_STATUS_RESERVED1 5
140#define MP_STATUS_NOT_SUPPORTED 6
141#define MP_STATUS_HW_ERROR 7
142#define MP_STATUS_UNSUCCESSFUL 8
144#define RH_STATUS_SUCCESS 0
145#define RH_STATUS_NO_CHANGES 1
146#define RH_STATUS_UNSUCCESSFUL 2
149#define USBC_DEVICE_CLASS_TYPE_C_BRIDGE 0x12
288#define USB20_PORT_STATUS_RESERVED1_OWNED_BY_COMPANION (1 << 2)
464(
NTAPI ASYNC_TIMER_CALLBACK)(
474 ASYNC_TIMER_CALLBACK *);
489#define USBPORT_INVALIDATE_CONTROLLER_RESET 1
490#define USBPORT_INVALIDATE_CONTROLLER_SURPRISE_REMOVE 2
491#define USBPORT_INVALIDATE_CONTROLLER_SOFT_INTERRUPT 3
526#define USB_MINIPORT_VERSION_OHCI 0x01
527#define USB_MINIPORT_VERSION_UHCI 0x02
528#define USB_MINIPORT_VERSION_EHCI 0x03
529#define USB_MINIPORT_VERSION_XHCI 0x04
531#define USB_MINIPORT_FLAGS_INTERRUPT 0x0001
532#define USB_MINIPORT_FLAGS_PORT_IO 0x0002
533#define USB_MINIPORT_FLAGS_MEMORY_IO 0x0004
534#define USB_MINIPORT_FLAGS_USB2 0x0010
535#define USB_MINIPORT_FLAGS_DISABLE_SS 0x0020
536#define USB_MINIPORT_FLAGS_NOT_LOCK_INT 0x0040
537#define USB_MINIPORT_FLAGS_POLLING 0x0080
538#define USB_MINIPORT_FLAGS_NO_DMA 0x0100
539#define USB_MINIPORT_FLAGS_WAKE_SUPPORT 0x0200
541#define TOTAL_USB11_BUS_BANDWIDTH 12000
542#define TOTAL_USB20_BUS_BANDWIDTH 400000
636#define USB10_MINIPORT_INTERFACE_VERSION 100
637#define USB20_MINIPORT_INTERFACE_VERSION 200
649#define USBPORT_TRANSFER_DIRECTION_OUT 1
650#define USBPORT_MAX_DEVICE_ADDRESS 127
enum _KINTERRUPT_MODE KINTERRUPT_MODE
UCHAR SplitCompletionMask
UCHAR InterruptScheduleMask
UCHAR TransactionPerMicroframe
USB_DEVICE_SPEED DeviceSpeed
USHORT TotalMaxPacketSize
USBPORT_REGISTRATION_PACKET Packet
PDRIVER_OBJECT DriverObject
PDRIVER_UNLOAD DriverUnload
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
PUSBPORT_GET_MINIPORT_REGISTRY_KEY_VALUE UsbPortGetMiniportRegistryKeyValue
SIZE_T MiniPortTransferSize
PHCI_GET_ENDPOINT_STATUS GetEndpointStatus
PHCI_RH_ENABLE_IRQ RH_EnableIrq
SIZE_T MiniPortResourcesSize
PUSBPORT_INVALIDATE_CONTROLLER UsbPortInvalidateController
PUSBPORT_REQUEST_ASYNC_CALLBACK UsbPortRequestAsyncCallback
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
PUSBPORT_TEST_DEBUG_BREAK UsbPortTestDebugBreak
PHCI_RH_SET_FEATURE_PORT_SUSPEND RH_SetFeaturePortSuspend
PHCI_RH_CLEAR_FEATURE_PORT_RESET_CHANGE RH_ClearFeaturePortResetChange
PUSBPORT_LOG_ENTRY UsbPortLogEntry
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_NOTIFY_DOUBLE_BUFFER UsbPortNotifyDoubleBuffer
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
PUSBPORT_COMPLETE_ISO_TRANSFER UsbPortCompleteIsoTransfer
PUSBPORT_DBG_PRINT UsbPortDbgPrint
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
PUSBPORT_ASSERT_FAILURE UsbPortAssertFailure
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
KAFFINITY InterruptAffinity
KINTERRUPT_MODE InterruptMode
USB_CONTROLLER_FLAVOR HcFlavor
USBPORT_HUB_CHARACTERISTICS HubCharacteristics
PHYSICAL_ADDRESS SgPhysicalAddress
USBPORT_SCATTER_GATHER_ELEMENT SgElement[2]
ULONG TransferBufferLength
USB_DEFAULT_PIPE_SETUP_PACKET SetupPacket
USHORT PartOfCompoundDevice
USHORT OverCurrentProtectionMode
USHORT NoOverCurrentProtection
USHORT PartOfCompoundDevice
USHORT NoOverCurrentProtection
USHORT PortIndicatorsSupported
USHORT OverCurrentProtectionMode
USBPORT_HUB_30_CHARACTERISTICS Usb30HubCharacteristics
USBPORT_HUB_20_CHARACTERISTICS Usb20HubCharacteristics
USBPORT_HUB_11_CHARACTERISTICS Usb11HubCharacteristics
enum _USB_DEVICE_SPEED USB_DEVICE_SPEED
union _USB_HUB_STATUS_AND_CHANGE * PUSB_HUB_STATUS_AND_CHANGE
union _USB_PORT_STATUS_AND_CHANGE * PUSB_PORT_STATUS_AND_CHANGE
enum _USB_CONTROLLER_FLAVOR USB_CONTROLLER_FLAVOR
#define USBD_STATUS(Status)
MPSTATUS(NTAPI * PHCI_START_SEND_ONE_PACKET)(PVOID, PVOID, PVOID, PULONG, PVOID, PVOID, ULONG, USBD_STATUS *)
NTSTATUS(NTAPI * PUSBPORT_WAIT)(PVOID, ULONG)
struct _USBPORT_REGISTRATION_PACKET * PUSBPORT_REGISTRATION_PACKET
union _USBPORT_HUB_11_CHARACTERISTICS USBPORT_HUB_11_CHARACTERISTICS
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND_CHANGE)(PVOID, USHORT)
VOID(NTAPI * PUSBPORT_BUG_CHECK)(PVOID)
ULONG(NTAPI * PHCI_GET_ENDPOINT_STATUS)(PVOID, PVOID)
struct _USBPORT_ROOT_HUB_DATA * PUSBPORT_ROOT_HUB_DATA
VOID(NTAPI * PHCI_SET_ENDPOINT_STATE)(PVOID, PVOID, ULONG)
ULONG(NTAPI * PUSBPORT_REQUEST_ASYNC_CALLBACK)(PVOID, ULONG, PVOID, SIZE_T, ASYNC_TIMER_CALLBACK *)
VOID(NTAPI * PHCI_QUERY_ENDPOINT_REQUIREMENTS)(PVOID, PUSBPORT_ENDPOINT_PROPERTIES, PUSBPORT_ENDPOINT_REQUIREMENTS)
struct _USBPORT_SCATTER_GATHER_LIST USBPORT_SCATTER_GATHER_LIST
VOID(NTAPI * PHCI_ENABLE_INTERRUPTS)(PVOID)
VOID(NTAPI * PHCI_RH_GET_ROOT_HUB_DATA)(PVOID, PVOID)
MPSTATUS(NTAPI * PHCI_RH_CHIRP_ROOT_PORT)(PVOID, USHORT)
struct _USBPORT_RESOURCES * PUSBPORT_RESOURCES
ULONG(NTAPI * PUSBPORT_INVALIDATE_ROOT_HUB)(PVOID)
ULONG NTAPI USBPORT_GetHciMn(VOID)
USBPORT_HUB_11_CHARACTERISTICS USBPORT_HUB_30_CHARACTERISTICS
MPSTATUS(NTAPI * PHCI_START_CONTROLLER)(PVOID, PUSBPORT_RESOURCES)
ULONG(NTAPI * PUSBPORT_INVALIDATE_CONTROLLER)(PVOID, ULONG)
MPSTATUS(NTAPI * PHCI_PASS_THRU)(PVOID, PVOID, ULONG, PVOID)
MPSTATUS(NTAPI * PHCI_OPEN_ENDPOINT)(PVOID, PUSBPORT_ENDPOINT_PROPERTIES, PVOID)
struct _USBPORT_REGISTRATION_PACKET USBPORT_REGISTRATION_PACKET
ULONG(NTAPI * PUSBPORT_TEST_DEBUG_BREAK)(PVOID)
struct _USBPORT_ENDPOINT_PROPERTIES * PUSBPORT_ENDPOINT_PROPERTIES
union _USBPORT_HUB_20_CHARACTERISTICS USBPORT_HUB_20_CHARACTERISTICS
PVOID(NTAPI * PUSBPORT_GET_MAPPED_VIRTUAL_ADDRESS)(ULONG, PVOID, PVOID)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_RESET_CHANGE)(PVOID, USHORT)
ULONG(NTAPI * PUSBPORT_ASSERT_FAILURE)(PVOID, PVOID, PVOID, ULONG, PCHAR)
struct _USBPORT_ROOT_HUB_DATA USBPORT_ROOT_HUB_DATA
struct _USBPORT_RESOURCES USBPORT_RESOURCES
VOID(NTAPI * PHCI_CHECK_CONTROLLER)(PVOID)
MPSTATUS(NTAPI * PHCI_RH_SET_FEATURE_PORT_POWER)(PVOID, USHORT)
VOID(NTAPI * PUSBPORT_COMPLETE_TRANSFER)(PVOID, PVOID, PVOID, USBD_STATUS, ULONG)
struct _USBPORT_ENDPOINT_PROPERTIES USBPORT_ENDPOINT_PROPERTIES
VOID(NTAPI * PHCI_CLOSE_ENDPOINT)(PVOID, PVOID, BOOLEAN)
MPSTATUS(NTAPI * PUSBPORT_READ_WRITE_CONFIG_SPACE)(PVOID, BOOLEAN, PVOID, ULONG, ULONG)
VOID(NTAPI * PHCI_FLUSH_INTERRUPTS)(PVOID)
ULONG(NTAPI * PUSBPORT_LOG_ENTRY)(PVOID, ULONG, ULONG, ULONG, ULONG, ULONG)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_ENABLE)(PVOID, USHORT)
ULONG(* PUSBPORT_DBG_PRINT)(PVOID, ULONG, PCH,...)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_ENABLE_CHANGE)(PVOID, USHORT)
MPSTATUS(NTAPI * PHCI_RH_SET_FEATURE_PORT_ENABLE)(PVOID, USHORT)
union _USBPORT_HUB_CHARACTERISTICS USBPORT_HUB_CHARACTERISTICS
BOOLEAN(NTAPI * PHCI_INTERRUPT_SERVICE)(PVOID)
MPSTATUS(NTAPI * PHCI_RH_GET_PORT_STATUS)(PVOID, USHORT, PUSB_PORT_STATUS_AND_CHANGE)
MPSTATUS(NTAPI * PHCI_RESUME_CONTROLLER)(PVOID)
NTSTATUS NTAPI USBPORT_RegisterUSBPortDriver(IN PDRIVER_OBJECT DriverObject, IN ULONG Version, IN PUSBPORT_REGISTRATION_PACKET RegistrationPacket)
VOID(NTAPI * PHCI_SUSPEND_CONTROLLER)(PVOID)
VOID(NTAPI * PHCI_REBALANCE_ENDPOINT)(PVOID, PUSBPORT_ENDPOINT_PROPERTIES, PVOID)
struct _USBPORT_MINIPORT_INTERFACE USBPORT_MINIPORT_INTERFACE
MPSTATUS(NTAPI * PHCI_SUBMIT_ISO_TRANSFER)(PVOID, PVOID, PUSBPORT_TRANSFER_PARAMETERS, PVOID, PVOID)
VOID(NTAPI * PHCI_POLL_ENDPOINT)(PVOID, PVOID)
struct _USBPORT_SCATTER_GATHER_ELEMENT * PUSBPORT_SCATTER_GATHER_ELEMENT
MPSTATUS(NTAPI * PUSBPORT_GET_MINIPORT_REGISTRY_KEY_VALUE)(PVOID, BOOL, PCWSTR, SIZE_T, PVOID, SIZE_T)
MPSTATUS(NTAPI * PHCI_RH_GET_HUB_STATUS)(PVOID, PUSB_HUB_STATUS_AND_CHANGE)
struct _USBPORT_SCATTER_GATHER_ELEMENT USBPORT_SCATTER_GATHER_ELEMENT
MPSTATUS(NTAPI * PHCI_END_SEND_ONE_PACKET)(PVOID, PVOID, PVOID, PULONG, PVOID, PVOID, ULONG, USBD_STATUS *)
ULONG(NTAPI * PUSBPORT_INVALIDATE_ENDPOINT)(PVOID, PVOID)
MPSTATUS(NTAPI * PHCI_SUBMIT_TRANSFER)(PVOID, PVOID, PUSBPORT_TRANSFER_PARAMETERS, PVOID, PUSBPORT_SCATTER_GATHER_LIST)
VOID(NTAPI * PHCI_POLL_CONTROLLER)(PVOID)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_POWER)(PVOID, USHORT)
ULONG(NTAPI * PHCI_GET_ENDPOINT_STATE)(PVOID, PVOID)
VOID(NTAPI * PHCI_INTERRUPT_DPC)(PVOID, BOOLEAN)
VOID(NTAPI * PHCI_STOP_CONTROLLER)(PVOID, BOOLEAN)
ULONG(NTAPI * PHCI_GET_32BIT_FRAME_NUMBER)(PVOID)
VOID(NTAPI * PHCI_DISABLE_INTERRUPTS)(PVOID)
struct _USBPORT_MINIPORT_INTERFACE * PUSBPORT_MINIPORT_INTERFACE
VOID(NTAPI * PHCI_RH_ENABLE_IRQ)(PVOID)
struct _USBPORT_TRANSFER_PARAMETERS USBPORT_TRANSFER_PARAMETERS
VOID(NTAPI * PHCI_RESET_CONTROLLER)(PVOID)
VOID(NTAPI * PHCI_TAKE_PORT_CONTROL)(PVOID)
ULONG(NTAPI * PUSBPORT_COMPLETE_ISO_TRANSFER)(PVOID, PVOID, PVOID, ULONG)
MPSTATUS(NTAPI * PHCI_RH_SET_FEATURE_PORT_SUSPEND)(PVOID, USHORT)
struct _USBPORT_SCATTER_GATHER_LIST * PUSBPORT_SCATTER_GATHER_LIST
VOID(NTAPI * PHCI_SET_ENDPOINT_DATA_TOGGLE)(PVOID, PVOID, ULONG)
ULONG(NTAPI * PUSBPORT_NOTIFY_DOUBLE_BUFFER)(PVOID, PVOID, PVOID, SIZE_T)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_OVERCURRENT_CHANGE)(PVOID, USHORT)
VOID(NTAPI * PHCI_RH_DISABLE_IRQ)(PVOID)
struct _USBPORT_ENDPOINT_REQUIREMENTS USBPORT_ENDPOINT_REQUIREMENTS
VOID(NTAPI * PHCI_ABORT_TRANSFER)(PVOID, PVOID, PVOID, PULONG)
MPSTATUS(NTAPI * PHCI_REOPEN_ENDPOINT)(PVOID, PUSBPORT_ENDPOINT_PROPERTIES, PVOID)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND)(PVOID, USHORT)
MPSTATUS(NTAPI * PHCI_RH_SET_FEATURE_PORT_RESET)(PVOID, USHORT)
MPSTATUS(NTAPI * PHCI_RH_GET_STATUS)(PVOID, PUSHORT)
MPSTATUS(NTAPI * PHCI_RH_CLEAR_FEATURE_PORT_CONNECT_CHANGE)(PVOID, USHORT)
struct _USBPORT_TRANSFER_PARAMETERS * PUSBPORT_TRANSFER_PARAMETERS
VOID(NTAPI * PHCI_INTERRUPT_NEXT_SOF)(PVOID)
struct _USBPORT_ENDPOINT_REQUIREMENTS * PUSBPORT_ENDPOINT_REQUIREMENTS
VOID(NTAPI * PHCI_SET_ENDPOINT_STATUS)(PVOID, PVOID, ULONG)
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
DRIVER_UNLOAD * PDRIVER_UNLOAD