ReactOS 0.4.17-dev-1281-g065abb3
devlpm.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS SuperSpeed USB Hub Driver
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: SuperSpeed link power: U1 and U2 timeouts, exit latency and link delays
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8#include "usbhub3.h"
9#include "devhcd.h"
10
11#define NDEBUG
12#include <debug.h>
13
14/* Timeout values the port understands */
15#define TIMEOUT_DISABLED 0x00
16#define TIMEOUT_SHORTEST 0x01
17#define U1_TIMEOUT_LONGEST 0x7F
18#define U2_TIMEOUT_LONGEST 0xFE
19#define TIMEOUT_ACCEPT_ONLY 0xFF
20
21/* An endpoint's timeout is this many times its exit latency */
22#define LATENCY_TIMEOUT_FACTOR 5
23
24/* U2 timeouts count in units of 256 us */
25#define U2_TIMEOUT_UNIT 256
26
27/* Interrupt endpoint usage type bits 5:4, 0 is periodic */
28#define INTERRUPT_USAGE_PERIODIC 0x00
29
30/* Microframe length; bInterval is taken raw */
31#define MICROFRAME_US 125
32
33/* Exit latency terms, in ns */
34#define TP_DELAY_5GBPS_NS 40
35#define MAX_PACKET_FORWARD_NS 2100
36#define PING_RESPONSE_NS 400
37
38/* Missed pings raise the latency by 10, 20, 40, 80, 160 percent, then link power goes off */
39#define NO_PING_FIRST_PERCENT 10
40#define NO_PING_LAST_PERCENT 160
41
42/* Below this the link speed is not believable */
43#define MIN_LINK_SPEED_BPS 50000000ULL
44
45/* One TP is 20 symbols; this over the speed in bit/s gives ns */
46#define TP_SYMBOL_NS_SCALE 200000000000ULL
47
48static
53{
54 return Child->HasHack(ChildHack::DisableLpm) || Child->m_Hub->HasFlag(HubFlag::DisableLpm);
55}
56
57static
62 _In_ ULONG Bit)
63{
64 return (Child->m_LpmPolicy & Bit) != 0;
65}
66
67static
68VOID
72 _In_ ULONG Bit,
74{
75 if (Set)
76 Child->m_LinkFlags |= Bit;
77 else
78 Child->m_LinkFlags &= ~Bit;
79}
80
81/* Any pipe of the current configuration that is not a control pipe */
82static
87{
91
92 for (Entry = Config->Interfaces.Flink; Entry != &Config->Interfaces; Entry = Entry->Flink)
93 {
95
96 for (Index = 0; Index < Interface->PipeCount; Index++)
97 {
98 if ((Interface->Pipes[Index].Descriptor->bmAttributes & USB_ENDPOINT_TYPE_MASK) !=
100 {
101 return TRUE;
102 }
103 }
104 }
105
106 return FALSE;
107}
108
109VOID
111{
116}
117
118/* A tunneled device does not use the port's own link, so the platform's U2 rule for the port is skipped */
119static
121NTAPI
124{
125 HubPort* Port = Child->m_Port;
126
127 if (!Port->HasFlag(PortFlag::AcpiNoU2))
128 return FALSE;
129
130 return !(Port->HasFlag(PortFlag::Usb4Host) && Child->m_TunnelState == HUB_TUNNEL_STATE_TUNNELED);
131}
132
134NTAPI
137{
141 {
142 return FALSE;
143 }
144
147 return TRUE;
148}
149
152{
154}
155
156/*
157 * Endpoint driven U1 timeout. FALSE when an isochronous endpoint cannot
158 * live with the exit latency, which turns U1 off.
159 */
160static
162NTAPI
166{
167 HubConfiguration* Config = Child->m_CurrentConfig;
171 BOOLEAN NonControl;
172 USHORT Latency;
174 USHORT Longest = 0;
175 ULONG Index;
176
178 if (Config == NULL)
179 return TRUE;
180
181 NonControl = HubChildHasNonControlPipe(Config);
182
183 for (Entry = Config->Interfaces.Flink; Entry != &Config->Interfaces; Entry = Entry->Flink)
184 {
186
187 for (Index = 0; Index < Interface->PipeCount; Index++)
188 {
189 Endpoint = Interface->Pipes[Index].Descriptor;
190 Latency = USB_ENDPOINT_DIRECTION_IN(Endpoint->bEndpointAddress) ? Child->m_Sel.U1Sel
191 : Child->m_HostU1ExitLatency;
192
193 switch (Endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK)
194 {
196 Value = NonControl ? LATENCY_TIMEOUT_FACTOR : (USHORT)(LATENCY_TIMEOUT_FACTOR * Latency);
197 break;
198
200 if (Latency > Endpoint->bInterval * MICROFRAME_US)
201 return FALSE;
203 break;
204
205 default:
206 Value = (USHORT)(LATENCY_TIMEOUT_FACTOR * Latency);
207 break;
208 }
209
210 Longest = max(Longest, Value);
211 }
212 }
213
214 /* Only the low byte is kept before capping: 0x105 gives 5 */
215 *Timeout = min((UCHAR)Longest, U1_TIMEOUT_LONGEST);
216 return TRUE;
217}
218
219VOID
221{
224
227 {
230 }
231 else
232 {
234
243 else if (!HubChildU1FromPipes(Child, &Timeout))
245 }
246
247 /* Some hubs cannot take U2 accept only unless U1 is fully on; hubs as devices get accept only */
248 if (Child->m_Hub->HasFlag(HubFlag::DisallowU2AcceptOnly) &&
249 Child->HasProperty(ChildProperty::IsHub) &&
251 {
253 }
254
255 Child->m_TargetU1Timeout = Timeout;
256 DPRINT("Device %p target U1 timeout 0x%x\n", Child, Timeout);
257}
258
259/* What the endpoints of the configuration allow for U2 */
260enum class HubU2Verdict
261{
262 Computed,
263 Off,
265};
266
267static
269NTAPI
272 _Out_ PUSHORT Longest,
273 _Out_ PBOOLEAN PeriodicInterrupt)
274{
275 HubConfiguration* Config = Child->m_CurrentConfig;
279 BOOLEAN NonControl;
280 BOOLEAN NoHostInitiate = FALSE;
281 USHORT Latency;
283 ULONG Index;
284
285 *Longest = 0;
286 *PeriodicInterrupt = FALSE;
287 if (Config == NULL)
289
290 NonControl = HubChildHasNonControlPipe(Config);
291
292 for (Entry = Config->Interfaces.Flink; Entry != &Config->Interfaces; Entry = Entry->Flink)
293 {
295
296 for (Index = 0; Index < Interface->PipeCount; Index++)
297 {
298 Endpoint = Interface->Pipes[Index].Descriptor;
299 Latency = USB_ENDPOINT_DIRECTION_IN(Endpoint->bEndpointAddress) ? Child->m_Sel.U2Sel
300 : Child->m_HostU2ExitLatency;
301 Value = (USHORT)(LATENCY_TIMEOUT_FACTOR * Latency);
302
303 switch (Endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK)
304 {
306 if (NonControl)
308 break;
309
311 if (Latency > Endpoint->bInterval * MICROFRAME_US)
312 return HubU2Verdict::Off;
314 break;
315
318 break;
319
320 *PeriodicInterrupt = TRUE;
321 if (Latency > Endpoint->bInterval * MICROFRAME_US)
322 {
323 NoHostInitiate = TRUE;
325 }
326 break;
327
328 default:
329 break;
330 }
331
332 *Longest = max(*Longest, Value);
333 }
334 }
335
336 return NoHostInitiate ? HubU2Verdict::AcceptOnly : HubU2Verdict::Computed;
337}
338
339/* Runs after CalcU1Timeout: a periodic interrupt endpoint moves the U1 target to accept only */
340VOID
342{
345 BOOLEAN Periodic;
346 USHORT Longest;
348
351 {
354 }
355 else
356 {
358
360 {
362 }
363 else if (Child->HasProperty(ChildProperty::IsHub) ||
365 {
367 }
369 {
371 }
373 {
375 }
376 else
377 {
378 Verdict = HubChildU2FromPipes(Child, &Longest, &Periodic);
379
380 if (Verdict == HubU2Verdict::Off)
381 {
384 }
385 else if (Verdict == HubU2Verdict::AcceptOnly)
386 {
388 }
389 else
390 {
391 if (Periodic && Child->m_TargetU1Timeout != TIMEOUT_DISABLED)
392 Child->m_TargetU1Timeout = TIMEOUT_ACCEPT_ONLY;
393
394 if (Longest < U2_TIMEOUT_LONGEST * U2_TIMEOUT_UNIT)
395 Timeout = (UCHAR)(Longest / U2_TIMEOUT_UNIT + 1);
396 else
398 }
399 }
400 }
401
402 /* Accept only U2 next to a host initiated U1 upsets some hubs; turn U2 off instead */
403 if (Child->m_Hub->HasFlag(HubFlag::DisallowU2AcceptOnly) &&
404 !Child->HasProperty(ChildProperty::IsHub) &&
405 Child->m_TargetU1Timeout != TIMEOUT_DISABLED &&
406 Child->m_TargetU1Timeout != TIMEOUT_ACCEPT_ONLY &&
408 {
411 }
412
413 Child->m_TargetU2Timeout = Timeout;
414 DPRINT("Device %p target U2 timeout 0x%x, U1 0x%x\n", Child, Timeout, Child->m_TargetU1Timeout);
415}
416
417/* A state is off when its timeout is 0, or accept only while the device may not use it */
418static
420NTAPI
424{
426}
427
428/* Worked out in ns with 32 bit unsigned arithmetic, stored in us */
429VOID
431{
433 HubFdo* Hub = Child->m_Hub;
434 BOOLEAN U1Off;
435 BOOLEAN U2Off;
436 ULONG HostLatency;
437 ULONG PathDelay;
438 ULONG Latency;
439
440 U1Off = HubLinkStateOff(Child->m_TargetU1Timeout, (Child->m_LinkFlags & HUB_LINK_TARGET_U1) != 0);
441 U2Off = HubLinkStateOff(Child->m_TargetU2Timeout, (Child->m_LinkFlags & HUB_LINK_TARGET_U2) != 0);
442
443 if (U1Off && U2Off)
444 {
445 Child->m_TargetExitLatency = 0;
446 return;
447 }
448
449 HostLatency = (U2Off ? Child->m_HostU1ExitLatency : Child->m_HostU2ExitLatency) * 1000UL;
452 Child->m_TxTpDelay;
453
454 /* Out to the device and back, plus the device's ping response */
455 Latency = max(HostLatency, (ULONG)MAX_PACKET_FORWARD_NS) + PathDelay + PING_RESPONSE_NS + PathDelay;
456 Latency += Latency * Child->m_LatencyAdjustPercent / 100;
457
458 Child->m_TargetExitLatency = (USHORT)((Latency + 500) / 1000);
459 DPRINT("Device %p target exit latency %u us\n", Child, Child->m_TargetExitLatency);
460}
461
464{
466 return FALSE;
467
469 return TRUE;
470}
471
474{
476 return FALSE;
477
479 return TRUE;
480}
481
482static
484NTAPI
488{
489 if (Wanted == Enabled)
490 return DsmFeatureKeep;
491
493}
494
497{
499 m_Device->HasState(ChildState::U1EnabledUpstream));
500}
501
504{
506 m_Device->HasState(ChildState::U2EnabledUpstream));
507}
508
509VOID
511{
512 m_Device->SetState(ChildState::U1EnabledUpstream);
513}
514
515VOID
517{
518 m_Device->ClearState(ChildState::U1EnabledUpstream);
519}
520
521VOID
523{
524 m_Device->SetState(ChildState::U2EnabledUpstream);
525}
526
527VOID
529{
530 m_Device->ClearState(ChildState::U2EnabledUpstream);
531}
532
535{
537}
538
541{
543}
544
545/* U2 goes first since it costs the most latency; FALSE when both are already off */
548{
550 {
552 return TRUE;
553 }
554
556 {
558 return TRUE;
559 }
560
561 DPRINT1("Device %p exit latency still too large with U1 and U2 off\n", m_Device);
562 return FALSE;
563}
564
565/* FALSE when link power is already off and the controller still misses pings */
568{
570 ULONG Doubled;
571
572 if (Child->m_LatencyAdjustPercent == 0)
573 {
575 return TRUE;
576 }
577
578 Doubled = Child->m_LatencyAdjustPercent * 2UL;
579 if (Doubled <= NO_PING_LAST_PERCENT)
580 {
581 Child->m_LatencyAdjustPercent = (UCHAR)Doubled;
582 return TRUE;
583 }
584
585 if (Child->m_U1Timeout == TIMEOUT_DISABLED && Child->m_U2Timeout == TIMEOUT_DISABLED)
586 {
587 DPRINT1("Device %p misses pings with link power already off\n", Child);
588 return FALSE;
589 }
590
591 DPRINT1("Device %p misses pings, turning U1 and U2 off\n", Child);
592 Child->m_LinkFlags |= HUB_LINK_OFF_FOR_NO_PING;
593 return TRUE;
594}
595
596/* TP delay of one direction of the link; FALSE when the attribute gives an unusable speed */
597static
599NTAPI
602 _In_ ULONG LaneCount,
603 _Out_ PUSHORT Delay)
604{
605 static const ULONG64 Scale[] = { 1, 1000, 1000000, 1000000000 };
606 ULONG64 Speed;
607
608 Speed = Scale[Attribute->LaneSpeedExponent] * Attribute->LaneSpeedMantissa * (LaneCount + 1);
609 if (Speed < MIN_LINK_SPEED_BPS)
610 return FALSE;
611
612 *Delay = (USHORT)(TP_SYMBOL_NS_SCALE / Speed);
613 return TRUE;
614}
615
616/* First attribute of the port matching the sublink speed id in that direction */
617static
619NTAPI
622 _In_ ULONG SpeedId,
624{
626 ULONG Index;
627
628 for (Index = 0; Index < Port->m_Info.SublinkSpeedAttrCount; Index++)
629 {
630 Attribute = &Port->m_Info.SublinkSpeedAttr[Index];
631
632 if (Attribute->SublinkSpeedAttrID == SpeedId && Attribute->SublinkTypeDir == Direction)
633 return Attribute;
634 }
635
636 return NULL;
637}
638
639/* Gen 1 delays unless the enhanced SuperSpeed port reports something else */
642{
644 HubPort* Port = Child->m_Port;
646 USB_PORT_EXT_STATUS Extended;
647
648 Child->m_RxTpDelay = TP_DELAY_5GBPS_NS;
649 Child->m_TxTpDelay = TP_DELAY_5GBPS_NS;
650
651 if (!Port->HasProperty(PortProperty::EnhancedSuperSpeed))
652 return TRUE;
653
654 Extended.AsUlong32 = Port->m_Current.ExtendedStatus;
655
656 /* No matching attribute keeps the Gen 1 value; a bad Rx one leaves Tx untouched */
658 if (Attribute != NULL && !HubTpDelayFromAttribute(Attribute, Extended.RxLaneCount, &Child->m_RxTpDelay))
659 {
660 DPRINT1("Port %u receive sublink speed %u is unusable\n", Port->Number(), Extended.RxSublinkSpeedID);
661 return FALSE;
662 }
663
665 if (Attribute != NULL && !HubTpDelayFromAttribute(Attribute, Extended.TxLaneCount, &Child->m_TxTpDelay))
666 {
667 DPRINT1("Port %u transmit sublink speed %u is unusable\n", Port->Number(), Extended.TxSublinkSpeedID);
668 return FALSE;
669 }
670
671 return TRUE;
672}
unsigned char BOOLEAN
Definition: actypes.h:127
#define DPRINT1
Definition: precomp.h:8
HubFdo * Hub
Definition: bootdev.cpp:261
VOID MarkU1Disabled()
Definition: devlpm.cpp:516
BOOLEAN ExitLatencyMayDrop()
Definition: devlpm.cpp:540
DSM_FEATURE_CHANGE U2Change()
Definition: devlpm.cpp:503
HubChild * m_Device
Definition: devsm.h:1832
BOOLEAN SetSpeedFor30()
Definition: devlpm.cpp:641
BOOLEAN U1TimeoutChanged()
Definition: devlpm.cpp:463
VOID MarkU2Disabled()
Definition: devlpm.cpp:528
VOID MarkU2Enabled()
Definition: devlpm.cpp:522
BOOLEAN ExitLatencyMustRise()
Definition: devlpm.cpp:534
VOID ComputeExitLatency()
Definition: devlpm.cpp:430
DSM_FEATURE_CHANGE U1Change()
Definition: devlpm.cpp:496
BOOLEAN DisableLinkStatesForLatency()
Definition: devlpm.cpp:547
BOOLEAN AdjustLatencyForNoPing()
Definition: devlpm.cpp:567
VOID CalcU2Timeout()
Definition: devlpm.cpp:341
VOID MarkU1Enabled()
Definition: devlpm.cpp:510
VOID InitLinkStates()
Definition: devlpm.cpp:110
VOID CalcU1Timeout()
Definition: devlpm.cpp:220
BOOLEAN U2TimeoutChanged()
Definition: devlpm.cpp:473
BOOLEAN U2NeededForEnumerated()
Definition: devlpm.cpp:151
USHORT m_TargetExitLatency
Definition: hubchild.h:455
VOID ClearState(_In_ ChildState Flag)
Definition: hubchild.h:274
UCHAR m_TargetU2Timeout
Definition: hubchild.h:448
UCHAR m_TargetU1Timeout
Definition: hubchild.h:447
UCHAR m_U1Timeout
Definition: hubchild.h:421
ULONG m_LinkFlags
Definition: hubchild.h:444
UCHAR m_U2Timeout
Definition: hubchild.h:422
UCHAR m_LatencyAdjustPercent
Definition: hubchild.h:451
VOID SetState(_In_ ChildState Flag)
Definition: hubchild.h:267
USHORT m_EffectiveExitLatency
Definition: hubchild.h:454
BOOLEAN HasState(_In_ ChildState Flag) const
Definition: hubchild.h:260
Definition: fdo.h:132
HubParentInfo m_ParentInfo
Definition: fdo.h:360
USB_30_HUB_DESCRIPTOR Usb30
Definition: fdo.h:420
union HubFdo::@1628 m_HubDescriptor
Verdict
Definition: desccheck.cpp:15
PLIST_ENTRY Entry
Definition: devhcd.cpp:1262
BOOLEAN NTAPI HubChildU2ForEnumerated(_In_ HubChild *Child)
Definition: devlpm.cpp:135
#define HUB_LINK_OFF_FOR_NO_PING
Definition: devhcd.h:25
#define HUB_LPM_POLICY_U1_INITIATE
Definition: devhcd.h:15
#define HUB_LPM_POLICY_U1_ACCEPT
Definition: devhcd.h:13
#define HUB_LPM_POLICY_U2_ENABLED
Definition: devhcd.h:12
#define HUB_LPM_POLICY_U1_ENABLED
Definition: devhcd.h:11
#define HUB_LINK_U2_OFF_FOR_LATENCY
Definition: devhcd.h:24
#define HUB_LPM_POLICY_U2_ACCEPT
Definition: devhcd.h:14
#define HUB_LPM_POLICY_U2_INITIATE
Definition: devhcd.h:16
#define HUB_LPM_POLICY_CONSERVATIVE
Definition: devhcd.h:17
#define HUB_LINK_TARGET_U1
Definition: devhcd.h:21
#define HUB_LINK_U1_OFF_FOR_LATENCY
Definition: devhcd.h:23
#define HUB_LPM_POLICY_AGGRESSIVE
Definition: devhcd.h:18
#define HUB_LINK_TARGET_U2
Definition: devhcd.h:22
static BOOLEAN NTAPI HubChildPortKeepsU2Off(_In_ HubChild *Child)
Definition: devlpm.cpp:122
static BOOLEAN NTAPI HubTpDelayFromAttribute(_In_ const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED *Attribute, _In_ ULONG LaneCount, _Out_ PUSHORT Delay)
Definition: devlpm.cpp:600
#define TIMEOUT_SHORTEST
Definition: devlpm.cpp:16
BOOLEAN NTAPI HubChildU2ForEnumerated(_In_ HubChild *Child)
Definition: devlpm.cpp:135
static BOOLEAN NTAPI HubChildLpmBlocked(_In_ HubChild *Child)
Definition: devlpm.cpp:51
#define MIN_LINK_SPEED_BPS
Definition: devlpm.cpp:43
static VOID NTAPI HubChildSetLink(_In_ HubChild *Child, _In_ ULONG Bit, _In_ BOOLEAN Set)
Definition: devlpm.cpp:70
HubU2Verdict
Definition: devlpm.cpp:261
static BOOLEAN NTAPI HubChildHasPolicy(_In_ HubChild *Child, _In_ ULONG Bit)
Definition: devlpm.cpp:60
#define MICROFRAME_US
Definition: devlpm.cpp:31
static const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED *NTAPI HubPortFindSpeed(_In_ HubPort *Port, _In_ ULONG SpeedId, _In_ ULONG Direction)
Definition: devlpm.cpp:620
static BOOLEAN NTAPI HubLinkStateOff(_In_ UCHAR Timeout, _In_ BOOLEAN Target)
Definition: devlpm.cpp:421
#define NO_PING_LAST_PERCENT
Definition: devlpm.cpp:40
#define U2_TIMEOUT_LONGEST
Definition: devlpm.cpp:18
#define U2_TIMEOUT_UNIT
Definition: devlpm.cpp:25
#define MAX_PACKET_FORWARD_NS
Definition: devlpm.cpp:35
static HubU2Verdict NTAPI HubChildU2FromPipes(_In_ HubChild *Child, _Out_ PUSHORT Longest, _Out_ PBOOLEAN PeriodicInterrupt)
Definition: devlpm.cpp:270
#define TIMEOUT_DISABLED
Definition: devlpm.cpp:15
#define PING_RESPONSE_NS
Definition: devlpm.cpp:36
#define LATENCY_TIMEOUT_FACTOR
Definition: devlpm.cpp:22
static BOOLEAN NTAPI HubChildU1FromPipes(_In_ HubChild *Child, _Out_ PUCHAR Timeout)
Definition: devlpm.cpp:163
#define INTERRUPT_USAGE_PERIODIC
Definition: devlpm.cpp:28
#define TP_DELAY_5GBPS_NS
Definition: devlpm.cpp:34
#define TIMEOUT_ACCEPT_ONLY
Definition: devlpm.cpp:19
#define NO_PING_FIRST_PERCENT
Definition: devlpm.cpp:39
static DSM_FEATURE_CHANGE NTAPI HubLinkChange(_In_ BOOLEAN Wanted, _In_ BOOLEAN Enabled)
Definition: devlpm.cpp:485
#define U1_TIMEOUT_LONGEST
Definition: devlpm.cpp:17
static BOOLEAN NTAPI HubChildHasNonControlPipe(_In_ HubConfiguration *Config)
Definition: devlpm.cpp:85
#define TP_SYMBOL_NS_SCALE
Definition: devlpm.cpp:46
enum _DSM_FEATURE_CHANGE DSM_FEATURE_CHANGE
@ DsmFeatureKeep
Definition: devsm.h:108
@ DsmFeatureDisable
Definition: devsm.h:110
@ DsmFeatureEnable
Definition: devsm.h:109
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
CPPORT Port[4]
Definition: headless.c:38
#define HUB_TUNNEL_STATE_TUNNELED
Definition: hubchild.h:52
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
Definition: hubucx.h:238
_In_ ULONG Wanted
Definition: intr.cpp:782
unsigned __int64 ULONG64
Definition: imports.h:198
#define min(a, b)
Definition: monoChain.cc:55
@ Enabled
Definition: mountmgr.h:179
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
static BOOL Set
Definition: pageheap.c:10
unsigned short USHORT
Definition: pedump.c:61
static ULONG Timeout
Definition: ping.c:61
#define DPRINT
Definition: sndvol32.h:73
USHORT TotalTpPropagationDelay
Definition: fdo.h:99
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define max(a, b)
Definition: svc.c:63
unsigned char UCHAR
Definition: typedefs.h:53
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PUCX_CONTROLLER_CONFIG Config
_In_ UCXUSBDEVICE _In_ ULONG Interface
Definition: ucxusbdevice.h:428
ULONG TxSublinkSpeedID
Definition: usb300.h:300
ULONG RxSublinkSpeedID
Definition: usb300.h:299
#define USB_ENDPOINT_TYPE_INTERRUPT
Definition: usb100.h:65
#define USB_ENDPOINT_TYPE_CONTROL
Definition: usb100.h:62
#define USB_ENDPOINT_TYPE_ISOCHRONOUS
Definition: usb100.h:63
#define USB_ENDPOINT_TYPE_MASK
Definition: usb100.h:61
#define USB_ENDPOINT_DIRECTION_IN(x)
Definition: usb100.h:76
#define USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_MASK
Definition: usb300.h:69
#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_RX
Definition: usb300.h:59
#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_TX
Definition: usb300.h:60
_In_ WDFCOLLECTION _In_ ULONG Index
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306