ReactOS 0.4.17-dev-1281-g065abb3
xhcihw.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS xHCI Host Controller Driver
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: xHCI hardware definitions (registers, TRBs, contexts)
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8#pragma once
9
10/* Layouts follow xHCI 1.2; each block cites its spec section */
11
12/* TRBs (xHCI 6.4) ************************************************************/
13
15typedef struct _XHCI_TRB
16{
19
20C_ASSERT(sizeof(XHCI_TRB) == 16);
21
22#define XHCI_TRB_CYCLE 0x00000001
23#define XHCI_TRB_TYPE_SHIFT 10
24#define XHCI_TRB_TYPE_MASK 0x0000FC00
25#define XHCI_TRB_SLOT_SHIFT 24
26#define XHCI_TRB_ENDPOINT_SHIFT 16
27#define XHCI_TRB_ENDPOINT_MASK 0x001F0000
28#define XHCI_TRB_CODE_SHIFT 24
29
34 _In_ const XHCI_TRB* Trb)
35{
36 return (Trb->Dword[3] & XHCI_TRB_TYPE_MASK) >> XHCI_TRB_TYPE_SHIFT;
37}
38
43 _In_ const XHCI_TRB* Trb)
44{
45 return Trb->Dword[2] >> XHCI_TRB_CODE_SHIFT;
46}
47
52 _In_ const XHCI_TRB* Trb)
53{
54 return Trb->Dword[3] >> XHCI_TRB_SLOT_SHIFT;
55}
56
61 _In_ const XHCI_TRB* Trb)
62{
63 return ((ULONG64)Trb->Dword[1] << 32) | Trb->Dword[0];
64}
65
66/* TRB type codes (xHCI 6.4.6) */
67enum class XhciTrbType : ULONG
68{
69 Normal = 1,
70 SetupStage = 2,
71 DataStage = 3,
72 StatusStage = 4,
73 Isoch = 5,
74 Link = 6,
75 EventData = 7,
76 NoOp = 8,
77 EnableSlot = 9,
78 DisableSlot = 10,
79 AddressDevice = 11,
81 EvaluateContext = 13,
82 ResetEndpoint = 14,
83 StopEndpoint = 15,
85 ResetDevice = 17,
86 ForceEvent = 18,
90 ForceHeader = 22,
91 NoOpCommand = 23,
92 TransferEvent = 32,
96 DoorbellEvent = 36,
100
101 /* Vendor defined, used for firmware version queries */
106};
107
108/* Completion codes (xHCI 6.4.5) */
110{
111 Invalid = 0,
112 Success = 1,
113 DataBufferError = 2,
114 BabbleDetected = 3,
116 TrbError = 5,
117 StallError = 6,
118 ResourceError = 7,
119 BandwidthError = 8,
122 SlotNotEnabled = 11,
124 ShortPacket = 13,
125 RingUnderrun = 14,
126 RingOverrun = 15,
127 VfEventRingFull = 16,
128 ParameterError = 17,
129 BandwidthOverrun = 18,
131 NoPingResponse = 20,
132 EventRingFull = 21,
134 MissedService = 23,
136 CommandAborted = 25,
137 Stopped = 26,
142 EventLost = 32,
143 UndefinedError = 33,
144 InvalidStreamId = 34,
147 VendorQuirk199 = 199
148};
149
150/* Interrupter register set (xHCI 5.5.2), runtime base + 0x20 + 32 * n */
151#define XHCI_RUNTIME_INTERRUPTER_BASE 0x20
152#define XHCI_INTERRUPTER_STRIDE 0x20
153#define XHCI_IMAN 0x00
154#define XHCI_IMOD 0x04
155#define XHCI_ERSTSZ 0x08
156#define XHCI_ERSTBA 0x10
157#define XHCI_ERDP 0x18
158
159#define XHCI_IMAN_PENDING 0x00000001
160#define XHCI_IMAN_ENABLE 0x00000002
161#define XHCI_ERDP_BUSY 0x00000008
162
164typedef struct _XHCI_ERST_ENTRY
165{
170
172
173
174/* command */
175
176/* Command Ring Control Register bits (xHCI 5.4.5) */
177#define XHCI_CRCR_RING_CYCLE 0x00000001
178#define XHCI_CRCR_STOP 0x00000002
179#define XHCI_CRCR_ABORT 0x00000004
180#define XHCI_CRCR_RUNNING 0x00000008
181#define XHCI_CRCR_POINTER_MASK 0xFFFFFFFFFFFFFFC0ULL
182
183/* Link TRB dword 3 Toggle Cycle (xHCI 6.4.4.1) */
184#define XHCI_LINK_TOGGLE_CYCLE 0x00000002
185
186/* buffers */
187
188/* Operational registers owned by the slot table (xHCI 5.4.6, 5.4.7) */
189#define XHCI_OP_DCBAAP 0x30
190#define XHCI_OP_CONFIG 0x38
191#define XHCI_CONFIG_MAX_SLOTS_MASK 0x000000FF
192
193/* DCBAA: entry 0 is the scratchpad array, 1..255 the output device contexts (xHCI 6.1) */
194#define XHCI_DCBAA_ENTRIES 256
195
196/* Device Notification Event dword 0 (xHCI 6.4.2.7) */
197#define XHCI_NOTIFICATION_TYPE_SHIFT 4
198#define XHCI_NOTIFICATION_TYPE_MASK 0x000000F0
199
200/* roothub */
201
202/* Port register set offsets for ReadPort32/WritePort32 (xHCI 5.4.8 to 5.4.11) */
203#define XHCI_PORT_SC 0x00
204#define XHCI_PORT_PMSC 0x04
205#define XHCI_PORT_LI 0x08
206#define XHCI_PORT_HLPMC 0x0C
207
208/* PORTSC (xHCI 5.4.8) */
209#define XHCI_PORTSC_CCS 0x00000001
210#define XHCI_PORTSC_PED 0x00000002
211#define XHCI_PORTSC_OCA 0x00000008
212#define XHCI_PORTSC_PR 0x00000010
213#define XHCI_PORTSC_PLS_SHIFT 5
214#define XHCI_PORTSC_PLS_MASK 0x000001E0
215#define XHCI_PORTSC_PP 0x00000200
216#define XHCI_PORTSC_SPEED_SHIFT 10
217#define XHCI_PORTSC_SPEED_MASK 0x00003C00
218#define XHCI_PORTSC_PIC_SHIFT 14
219#define XHCI_PORTSC_PIC_MASK 0x0000C000
220#define XHCI_PORTSC_LWS 0x00010000
221#define XHCI_PORTSC_CSC 0x00020000
222#define XHCI_PORTSC_PEC 0x00040000
223#define XHCI_PORTSC_WRC 0x00080000
224#define XHCI_PORTSC_OCC 0x00100000
225#define XHCI_PORTSC_PRC 0x00200000
226#define XHCI_PORTSC_PLC 0x00400000
227#define XHCI_PORTSC_CEC 0x00800000
228#define XHCI_PORTSC_CAS 0x01000000
229#define XHCI_PORTSC_WAKE_SHIFT 25
230#define XHCI_PORTSC_WAKE_MASK 0x0E000000
231#define XHCI_PORTSC_DR 0x40000000
232#define XHCI_PORTSC_WPR 0x80000000
233
235#define XHCI_PORTSC_PRESERVE (XHCI_PORTSC_PP | XHCI_PORTSC_PIC_MASK | XHCI_PORTSC_WAKE_MASK)
236
237/* PLS values beyond the hub link states in usb200.h */
238#define XHCI_PLS_RESUME 15
239
240/* Port speed IDs in PORTSC (xHCI 7.2.2.1.1 default table) */
241#define XHCI_SPEED_FULL 1
242#define XHCI_SPEED_LOW 2
243#define XHCI_SPEED_HIGH 3
244#define XHCI_SPEED_SUPER 4
245
246/* PORTPMSC, USB 3.x layout (xHCI 5.4.9.1) */
247#define XHCI_PORTPMSC_U1_TIMEOUT_MASK 0x000000FF
248#define XHCI_PORTPMSC_U2_TIMEOUT_SHIFT 8
249#define XHCI_PORTPMSC_U2_TIMEOUT_MASK 0x0000FF00
250#define XHCI_PORTPMSC_FLA 0x00010000
251
252/* PORTPMSC, USB 2.x layout (xHCI 5.4.9.2) */
253#define XHCI_PORTPMSC_RWE 0x00000008
254#define XHCI_PORTPMSC_BESL_SHIFT 4
255#define XHCI_PORTPMSC_BESL_MASK 0x000000F0
256#define XHCI_PORTPMSC_L1_SLOT_SHIFT 8
257#define XHCI_PORTPMSC_L1_SLOT_MASK 0x0000FF00
258#define XHCI_PORTPMSC_HLE 0x00010000
259#define XHCI_PORTPMSC_TEST_SHIFT 28
260#define XHCI_PORTPMSC_TEST_MASK 0xF0000000
261
262/* PORTLI (xHCI 5.4.10) */
263#define XHCI_PORTLI_ERROR_COUNT_MASK 0x0000FFFF
264#define XHCI_PORTLI_RX_LANES_SHIFT 16
265#define XHCI_PORTLI_RX_LANES_MASK 0x000F0000
266#define XHCI_PORTLI_TX_LANES_SHIFT 20
267#define XHCI_PORTLI_TX_LANES_MASK 0x00F00000
268
269/* PORTHLPMC, USB 2.x (xHCI 5.4.11.2) */
270#define XHCI_PORTHLPMC_HIRDM_MASK 0x00000003
271#define XHCI_PORTHLPMC_L1_TIMEOUT_SHIFT 2
272#define XHCI_PORTHLPMC_L1_TIMEOUT_MASK 0x000003FC
273#define XHCI_PORTHLPMC_BESLD_SHIFT 10
274#define XHCI_PORTHLPMC_BESLD_MASK 0x00003C00
275
276/* Supported Protocol Capability (xHCI 7.2), byte offsets from the capability */
277#define XHCI_EXTCAP_SUPPORTED_PROTOCOL 2
278#define XHCI_PROTOCOL_REVISION 0x00
279#define XHCI_PROTOCOL_NAME 0x04
280#define XHCI_PROTOCOL_PORTS 0x08
281#define XHCI_PROTOCOL_PSI 0x10
282
283#define XHCI_PROTOCOL_MINOR_SHIFT 16
284#define XHCI_PROTOCOL_MAJOR_SHIFT 24
285#define XHCI_PROTOCOL_NAME_USB 0x20425355
286
287#define XHCI_PROTOCOL_OFFSET_MASK 0x000000FF
288#define XHCI_PROTOCOL_COUNT_SHIFT 8
289#define XHCI_PROTOCOL_COUNT_MASK 0x0000FF00
290#define XHCI_PROTOCOL_HSO 0x00020000
291#define XHCI_PROTOCOL_IHI 0x00040000
292#define XHCI_PROTOCOL_HLC 0x00080000
293#define XHCI_PROTOCOL_BLC 0x00100000
294#define XHCI_PROTOCOL_MHD_SHIFT 25
295#define XHCI_PROTOCOL_MHD_MASK 0x0E000000
296#define XHCI_PROTOCOL_PSIC_SHIFT 28
297
298/* Protocol Speed ID dword (xHCI 7.2.1) */
299#define XHCI_PSI_ID_MASK 0x0000000F
300#define XHCI_PSI_EXPONENT_SHIFT 4
301#define XHCI_PSI_EXPONENT_MASK 0x00000030
302#define XHCI_PSI_TYPE_SHIFT 6
303#define XHCI_PSI_TYPE_MASK 0x000000C0
304#define XHCI_PSI_MANTISSA_SHIFT 16
305
306#define XHCI_PSI_TYPE_SYMMETRIC 0
307#define XHCI_PSI_TYPE_ASYMMETRIC_RX 2
308#define XHCI_PSI_TYPE_ASYMMETRIC_TX 3
309
310/* Debug Capability (xHCI 7.6.8): DCST holds the debug port number in bits 31:24 */
311#define XHCI_EXTCAP_DEBUG 10
312#define XHCI_DBC_DCST 0x24
313#define XHCI_DBC_DCST_PORT_SHIFT 24
314
315/* Port Status Change Event: Port ID in dword 0 bits 31:24 (xHCI 6.4.2.3) */
316#define XHCI_EVENT_PORT_ID_SHIFT 24
317
318/* interrupter */
319
320/* Transfer Event dword 3 Event Data flag (xHCI 6.4.2.1) */
321#define XHCI_TRANSFER_EVENT_ED 0x00000004
322
323/* Bits 1:0 of a driver written Event Data value carry the USB endpoint type */
324#define XHCI_EVENT_DATA_TYPE_MASK 0x00000003
325
326/* ERDP Dequeue ERST Segment Index (xHCI 5.5.2.3.3) */
327#define XHCI_ERDP_SEGMENT_MASK 0x00000007
328
329/* IMOD value for every enabled interrupter: 200 x 250 ns, counter 0 */
330#define XHCI_IMOD_INTERVAL_50US 0x000000C8
331
332/* controller */
333
334/* Capability registers, offsets from the BAR (xHCI 5.3) */
335#define XHCI_CAP_LENGTH_VERSION 0x00
336#define XHCI_CAP_HCSPARAMS1 0x04
337#define XHCI_CAP_HCSPARAMS2 0x08
338#define XHCI_CAP_HCSPARAMS3 0x0C
339#define XHCI_CAP_HCCPARAMS1 0x10
340#define XHCI_CAP_DBOFF 0x14
341#define XHCI_CAP_RTSOFF 0x18
342#define XHCI_CAP_HCCPARAMS2 0x1C
343
344#define XHCI_CAPLENGTH_MASK 0x000000FF
345#define XHCI_HCIVERSION_MAJOR_SHIFT 24
346#define XHCI_HCIVERSION_MINOR_SHIFT 16
347
348/* HCSPARAMS1 (xHCI 5.3.3) */
349#define XHCI_HCS1_MAX_SLOTS_MASK 0x000000FF
350#define XHCI_HCS1_MAX_INTRS_SHIFT 8
351#define XHCI_HCS1_MAX_INTRS_MASK 0x0007FF00
352#define XHCI_HCS1_MAX_PORTS_SHIFT 24
353
354/* HCSPARAMS2 (xHCI 5.3.4) */
355#define XHCI_HCS2_IST_MASK 0x0000000F
356#define XHCI_HCS2_ERST_MAX_SHIFT 4
357#define XHCI_HCS2_ERST_MAX_MASK 0x000000F0
358#define XHCI_HCS2_SCRATCH_HI_SHIFT 21
359#define XHCI_HCS2_SCRATCH_HI_MASK 0x03E00000
360#define XHCI_HCS2_SPR 0x04000000
361#define XHCI_HCS2_SCRATCH_LO_SHIFT 27
362
363/* HCSPARAMS3 (xHCI 5.3.5) */
364#define XHCI_HCS3_U1_LATENCY_MASK 0x000000FF
365#define XHCI_HCS3_U2_LATENCY_SHIFT 16
366
367/* HCCPARAMS1 (xHCI 5.3.6) */
368#define XHCI_HCC1_AC64 0x00000001
369#define XHCI_HCC1_CSZ 0x00000004
370#define XHCI_HCC1_CFC 0x00000800
371#define XHCI_HCC1_MAX_PSA_SHIFT 12
372#define XHCI_HCC1_MAX_PSA_MASK 0x0000F000
373#define XHCI_HCC1_XECP_SHIFT 16
374
375/* HCCPARAMS2 (xHCI 5.3.9) */
376#define XHCI_HCC2_CMC 0x00000002
377#define XHCI_HCC2_LEC 0x00000010
378#define XHCI_HCC2_ETC 0x00000040
379
380/* Operational registers, offsets from the operational base (xHCI 5.4) */
381#define XHCI_OP_USBCMD 0x00
382#define XHCI_OP_USBSTS 0x04
383#define XHCI_OP_PAGESIZE 0x08
384#define XHCI_OP_DNCTRL 0x14
385#define XHCI_OP_CRCR 0x18
386#define XHCI_OP_PORT_BASE 0x400
387#define XHCI_OP_PORT_STRIDE 0x10
388
389/* USBCMD (xHCI 5.4.1) */
390#define XHCI_USBCMD_RS 0x00000001
391#define XHCI_USBCMD_HCRST 0x00000002
392#define XHCI_USBCMD_INTE 0x00000004
393#define XHCI_USBCMD_HSEE 0x00000008
394#define XHCI_USBCMD_CSS 0x00000100
395#define XHCI_USBCMD_CRS 0x00000200
396#define XHCI_USBCMD_EWE 0x00000400
397#define XHCI_USBCMD_CME 0x00002000
398#define XHCI_USBCMD_ETE 0x00004000
399
400/* USBSTS (xHCI 5.4.2) */
401#define XHCI_USBSTS_HCH 0x00000001
402#define XHCI_USBSTS_HSE 0x00000004
403#define XHCI_USBSTS_EINT 0x00000008
404#define XHCI_USBSTS_PCD 0x00000010
405#define XHCI_USBSTS_SSS 0x00000100
406#define XHCI_USBSTS_RSS 0x00000200
407#define XHCI_USBSTS_SRE 0x00000400
408#define XHCI_USBSTS_CNR 0x00000800
409#define XHCI_USBSTS_HCE 0x00001000
410
411/* PAGESIZE bit 0 means 4 KB pages (xHCI 5.4.3) */
412#define XHCI_PAGESIZE_4K 0x00000001
413
414/* DNCTRL N1, Function Wake device notifications (xHCI 5.4.4) */
415#define XHCI_DNCTRL_FUNCTION_WAKE 0x00000002
416
417/* Runtime registers (xHCI 5.5) */
418#define XHCI_RT_MFINDEX 0x00
419#define XHCI_MFINDEX_MASK 0x00003FFF
420
421/* Doorbell array (xHCI 5.6), one dword per slot, 0 is the command ring */
422#define XHCI_DOORBELL_STRIDE 4
423
424/* Extended capability header (xHCI 7) */
425#define XHCI_EXTCAP_ID_MASK 0x000000FF
426#define XHCI_EXTCAP_NEXT_SHIFT 8
427#define XHCI_EXTCAP_NEXT_MASK 0x0000FF00
428#define XHCI_EXTCAP_LEGACY 1
429
430/* USB Legacy Support Capability (xHCI 7.1), byte offsets from the capability */
431#define XHCI_LEGSUP_BIOS_OWNED_BYTE 0x02
432#define XHCI_LEGSUP_OS_OWNED_BYTE 0x03
433#define XHCI_LEGSUP_OWNED 0x01
434#define XHCI_LEGSUP_CTLSTS 0x04
435
437#define XHCI_LEGCTLSTS_KEEP_MASK 0x1FFFDFFF
438
439/* Device contexts (xHCI 6.2.1 to 6.2.5) */
440
441/*
442 * Only the first 32 bytes of a context carry fields, even when HCCPARAMS1.CSZ makes it
443 * 64 bytes. Locate a context by the controller context size, then use the layouts below.
444 */
445#define XHCI_CONTEXT_SIZE_32 32
446#define XHCI_CONTEXT_SIZE_64 64
447
449#define XHCI_DEVICE_CONTEXT_COUNT 32
450#define XHCI_INPUT_CONTEXT_COUNT 33
451
453typedef struct _XHCI_SLOT_CONTEXT
454{
461
465
471
475
478
480
482{
486
488
489/* Slot Context Slot State values */
490#define XHCI_SLOT_STATE_DISABLED 0
491#define XHCI_SLOT_STATE_DEFAULT 1
492#define XHCI_SLOT_STATE_ADDRESSED 2
493#define XHCI_SLOT_STATE_CONFIGURED 3
494
497{
505
513
515
518
521
523
525{
529
531
532/* Endpoint Context EP State values */
533#define XHCI_ENDPOINT_STATE_DISABLED 0
534#define XHCI_ENDPOINT_STATE_RUNNING 1
535#define XHCI_ENDPOINT_STATE_HALTED 2
536#define XHCI_ENDPOINT_STATE_STOPPED 3
537#define XHCI_ENDPOINT_STATE_ERROR 4
538
539/* Endpoint Context EP Type values */
540#define XHCI_ENDPOINT_TYPE_ISOCH_OUT 1
541#define XHCI_ENDPOINT_TYPE_BULK_OUT 2
542#define XHCI_ENDPOINT_TYPE_INTERRUPT_OUT 3
543#define XHCI_ENDPOINT_TYPE_CONTROL 4
544#define XHCI_ENDPOINT_TYPE_ISOCH_IN 5
545#define XHCI_ENDPOINT_TYPE_BULK_IN 6
546#define XHCI_ENDPOINT_TYPE_INTERRUPT_IN 7
547
550{
559
561
563{
567
569
570/* Slot command TRB dword 3 fields (xHCI 6.4.3) */
571#define XHCI_CMD_SLOT_TYPE_SHIFT 16
572#define XHCI_CMD_BLOCK_SET_ADDRESS 0x00000200
573#define XHCI_CMD_DECONFIGURE 0x00000200
574
575/* Command Completion Event dword 2 Command Completion Parameter (xHCI 6.4.2.2) */
576#define XHCI_COMPLETION_PARAMETER_MASK 0x00FFFFFF
577
578/* Device Notification Event: Function Wake type and its interface byte (xHCI 6.4.2.7) */
579#define XHCI_NOTIFICATION_FUNCTION_WAKE 1
580#define XHCI_NOTIFICATION_DATA_SHIFT 8
581#define XHCI_NOTIFICATION_DATA_MASK 0x0000FF00
582
583/* Endpoint commands and stream contexts (xHCI 6.2.4, 6.4.3.6 to 6.4.3.9) */
584
585/* Reset Endpoint dword 3 Transfer State Preserve, Stop Endpoint dword 3 Suspend */
586#define XHCI_CMD_TRANSFER_STATE_PRESERVE 0x00000200
587#define XHCI_CMD_SUSPEND 0x00800000
588
589/* Set TR Dequeue Pointer dword 2 Stream ID */
590#define XHCI_CMD_STREAM_ID_SHIFT 16
591
592/* Low bits of a TR dequeue pointer: DCS in bit 0, SCT in bits 3:1 */
593#define XHCI_DEQUEUE_CYCLE 0x0000000000000001ULL
594#define XHCI_DEQUEUE_FLAGS_MASK 0x000000000000000FULL
595
598{
603
605
606#define XHCI_STREAM_EDTLA_MASK 0x00FFFFFF
607
608/* Transfer ring TRB fields and the TR Dequeue Pointer SCT field (xHCI 6.4.1, 6.4.4.1, 6.2.4.1) */
609#define XHCI_TRB_CHAIN 0x00000010
610#define XHCI_TRB_INTERRUPTER_SHIFT 22
611#define XHCI_TRB_INTERRUPTER_MASK 0x000003FF
612#define XHCI_DEQUEUE_SCT_SHIFT 1
613#define XHCI_SCT_PRIMARY_RING 1
614
615/* URB TransferFlags bit for transfers that must make forward progress */
616#ifndef USB3_URB_RESERVED_RESOURCES
617#define USB3_URB_RESERVED_RESOURCES 0x00000010
618#endif
619
620/* Transfer TRB length, TD Size and flag bits (xHCI 6.4.1) */
621#define XHCI_TRB_LENGTH_MASK 0x0001FFFF
622#define XHCI_TRB_TD_SIZE_SHIFT 17
623#define XHCI_TRB_ENT 0x00000002
624#define XHCI_TRB_IOC 0x00000020
625#define XHCI_TRB_IDT 0x00000040
626#define XHCI_TRB_DIR_IN 0x00010000
627
628/* Setup Stage TRB Transfer Type (xHCI 6.4.1.2.1) */
629#define XHCI_TRB_TRT_SHIFT 16
630#define XHCI_TRB_TRT_NO_DATA 0
631#define XHCI_TRB_TRT_OUT 2
632#define XHCI_TRB_TRT_IN 3
633
634/* Transfer Event TRB Transfer Length, dword 2 bits 23:0 (xHCI 6.4.2.1) */
635#define XHCI_TRANSFER_EVENT_LENGTH_MASK 0x00FFFFFF
636
637/* Isoch TRB fields (xHCI 6.4.1.3) and the Block Event Interrupt flag */
638#define XHCI_TRB_BEI 0x00000200
639#define XHCI_ISOCH_TBC_SHIFT 7
640#define XHCI_ISOCH_TLBPC_SHIFT 16
641#define XHCI_ISOCH_FRAME_ID_SHIFT 20
642#define XHCI_ISOCH_FRAME_ID_MASK 0x000007FF
643
644/* USB4 tunneling: extended capability 0x12 and PORTSC bit 2 (reserved in xHCI 1.2) report a USB 3.x link over USB4 */
645#define XHCI_EXTCAP_USB4_TUNNELING 0x12
646#define XHCI_USB4_CAP_PORTSC_TUNNEL_VALID 0x00010000
647#define XHCI_PORTSC_TUNNELED 0x00000004
648
649/* Vendor tunnel status registers, offsets from the capability registers */
650#define XHCI_VENDOR_PORT_TUNNEL_BASE 0x8AC4
651#define XHCI_VENDOR_PORT_TUNNEL_STRIDE 0x20
652#define XHCI_VENDOR_PORT_TUNNEL_ACTIVE 0x00000010
653#define XHCI_VENDOR_TUNNEL_STATUS 0xCD20
654#define XHCI_VENDOR_TUNNEL_STATUS_ACTIVE 0x00000001
#define C_ASSERT(e)
Definition: intsafe.h:73
unsigned __int64 ULONG64
Definition: imports.h:198
#define _In_
Definition: no_sal2.h:158
XHCI_ENDPOINT_CONTEXT Context
Definition: xhcihw.h:526
ULONG HostInitiateDisable
Definition: xhcihw.h:510
ULONG Reserved3[3]
Definition: xhcihw.h:519
ULONG64 TRDequeuePointer
Definition: xhcihw.h:514
Definition: xhcihw.h:165
ULONG Reserved
Definition: xhcihw.h:168
ULONG SegmentSize
Definition: xhcihw.h:167
ULONG64 SegmentAddress
Definition: xhcihw.h:166
XHCI_INPUT_CONTROL_CONTEXT Context
Definition: xhcihw.h:564
XHCI_SLOT_CONTEXT Context
Definition: xhcihw.h:483
ULONG RouteString
Definition: xhcihw.h:455
ULONG UsbDeviceAddress
Definition: xhcihw.h:472
ULONG Reserved3[4]
Definition: xhcihw.h:476
ULONG InterrupterTarget
Definition: xhcihw.h:470
ULONG MaxExitLatency
Definition: xhcihw.h:462
ULONG TTPortNumber
Definition: xhcihw.h:467
ULONG TTThinkTime
Definition: xhcihw.h:468
ULONG NumberOfPorts
Definition: xhcihw.h:464
ULONG RootHubPortNumber
Definition: xhcihw.h:463
ULONG TTHubSlotId
Definition: xhcihw.h:466
ULONG ContextEntries
Definition: xhcihw.h:460
ULONG64 DequeuePointer
Definition: xhcihw.h:599
ULONG Dword[4]
Definition: xhcihw.h:17
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
#define FORCEINLINE
Definition: wdftypes.h:67
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define XHCI_CONTEXT_SIZE_32
Definition: xhcihw.h:445
struct _XHCI_INPUT_CONTROL_CONTEXT * PXHCI_INPUT_CONTROL_CONTEXT
struct _XHCI_ERST_ENTRY * PXHCI_ERST_ENTRY
struct _XHCI_INPUT_CONTROL_CONTEXT64 XHCI_INPUT_CONTROL_CONTEXT64
struct _XHCI_STREAM_CONTEXT * PXHCI_STREAM_CONTEXT
struct _XHCI_SLOT_CONTEXT64 * PXHCI_SLOT_CONTEXT64
#define XHCI_TRB_TYPE_SHIFT
Definition: xhcihw.h:23
FORCEINLINE ULONG64 NTAPI XhciTrbPointer(_In_ const XHCI_TRB *Trb)
Definition: xhcihw.h:60
struct _XHCI_SLOT_CONTEXT * PXHCI_SLOT_CONTEXT
struct _XHCI_ENDPOINT_CONTEXT * PXHCI_ENDPOINT_CONTEXT
struct _XHCI_STREAM_CONTEXT XHCI_STREAM_CONTEXT
struct _XHCI_ENDPOINT_CONTEXT XHCI_ENDPOINT_CONTEXT
struct _XHCI_ENDPOINT_CONTEXT64 * PXHCI_ENDPOINT_CONTEXT64
struct _XHCI_TRB * PXHCI_TRB
#define XHCI_TRB_SLOT_SHIFT
Definition: xhcihw.h:25
#define XHCI_CONTEXT_SIZE_64
Definition: xhcihw.h:446
struct _XHCI_INPUT_CONTROL_CONTEXT64 * PXHCI_INPUT_CONTROL_CONTEXT64
struct _XHCI_ENDPOINT_CONTEXT64 XHCI_ENDPOINT_CONTEXT64
struct _XHCI_SLOT_CONTEXT XHCI_SLOT_CONTEXT
struct _XHCI_INPUT_CONTROL_CONTEXT XHCI_INPUT_CONTROL_CONTEXT
XhciTrbType
Definition: xhcihw.h:68
@ DeviceNotificationEvent
@ SetLatencyToleranceValue
@ VendorFirmwareVersionAlt
@ CommandCompletionEvent
@ VendorFirmwareVersionAltSetup
@ BandwidthRequestEvent
@ VendorFirmwareVersion
@ PortStatusChangeEvent
@ VendorCommandCompletionEvent
struct _XHCI_TRB XHCI_TRB
XhciCompletionCode
Definition: xhcihw.h:110
#define XHCI_TRB_TYPE_MASK
Definition: xhcihw.h:24
struct _XHCI_SLOT_CONTEXT64 XHCI_SLOT_CONTEXT64
#define XHCI_TRB_CODE_SHIFT
Definition: xhcihw.h:28
struct _XHCI_ERST_ENTRY XHCI_ERST_ENTRY
FORCEINLINE ULONG NTAPI XhciTrbCompletionCode(_In_ const XHCI_TRB *Trb)
Definition: xhcihw.h:42
FORCEINLINE ULONG NTAPI XhciTrbSlotId(_In_ const XHCI_TRB *Trb)
Definition: xhcihw.h:51