ReactOS 0.4.17-dev-1407-g3e6033a
devsm.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS USB Hub Driver
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Device state machine, event table, engine hooks and shared states
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include "usbhub3.h"
11
12/* GLOBALS ********************************************************************/
13
15{
16 { "PortAttached", SmEventCompletion, FALSE, FALSE },
17 { "PortReattached", SmEventCompletion, FALSE, FALSE },
18 { "PortDetached", SmEventCompletion, FALSE, FALSE },
19 { "PortDisableDone", SmEventCompletion, FALSE, FALSE },
20 { "PortFault", SmEventCompletion, FALSE, FALSE },
21 { "PortResetDone", SmEventCompletion, FALSE, FALSE },
22 { "PortResetAbortedForSuspend", SmEventCompletion, FALSE, FALSE },
23 { "PortResetTimeout", SmEventCompletion, FALSE, FALSE },
24 { "PortResumeDone", SmEventCompletion, FALSE, FALSE },
25 { "PortResumeAbortedForSuspend", SmEventCompletion, FALSE, FALSE },
26 { "PortResumeTimeout", SmEventCompletion, FALSE, FALSE },
27 { "PortSuspendDone", SmEventCompletion, FALSE, FALSE },
28 { "PortNowDisabled", SmEventCompletion, FALSE, FALSE },
29 { "PortNowEnabled", SmEventCompletion, FALSE, FALSE },
30 { "PortNowEnabledOnReconnect", SmEventCompletion, FALSE, FALSE },
31 { "PortNowSuspended", SmEventCompletion, FALSE, FALSE },
32 { "PortTimeoutSet", SmEventCompletion, FALSE, FALSE },
33 { "HubStarted", SmEventCompletion, FALSE, FALSE },
34 { "HubStopping", SmEventCompletion, FALSE, FALSE },
35 { "HubStoppingAfterSuspend", SmEventCompletion, FALSE, FALSE },
36 { "HubSuspending", SmEventCompletion, FALSE, FALSE },
37 { "HubResumed", SmEventCompletion, FALSE, FALSE },
38 { "HubResumedInS0", SmEventCompletion, FALSE, FALSE },
39 { "HubResumedWithReset", SmEventCompletion, FALSE, FALSE },
40 { "TimerFired", SmEventCompletion, FALSE, FALSE },
41 { "TransferDone", SmEventCritical, FALSE, FALSE },
42 { "TransferFailed", SmEventCritical, FALSE, FALSE },
43 { "TransferStalled", SmEventCritical, FALSE, FALSE },
44 { "ControllerIoctlDone", SmEventCritical, FALSE, FALSE },
45 { "ControllerIoctlFailed", SmEventCritical, FALSE, FALSE },
46 { "ControllerExitLatencyTooLarge", SmEventCritical, FALSE, FALSE },
47 { "ControllerRequestDone", SmEventCritical, FALSE, FALSE },
48 { "PdoPreStart", SmEventRequest, FALSE, FALSE },
49 { "PdoPowerUp", SmEventRequest, FALSE, FALSE },
50 { "PdoPowerDown", SmEventRequest, FALSE, FALSE },
51 { "PdoPowerDownFinal", SmEventRequest, FALSE, FALSE },
52 { "PdoPrepareHibernate", SmEventRequest, FALSE, FALSE },
53 { "PdoInstallMsOsExt", SmEventRequest, FALSE, FALSE },
54 { "PdoReportedMissing", SmEventRequest, FALSE, FALSE },
55 { "PdoCleanup", SmEventRequest, FALSE, FALSE },
56 { "ClientCyclePort", SmEventRequest, FALSE, FALSE },
57 { "ClientResetDevice", SmEventRequest, FALSE, FALSE },
58 { "ClientResetPipe", SmEventRequest, FALSE, FALSE },
59 { "ClientSyncResetPipe", SmEventRequest, FALSE, FALSE },
60 { "ClientClearStall", SmEventRequest, FALSE, FALSE },
61 { "ClientSelectConfig", SmEventRequest, FALSE, FALSE },
62 { "ClientUnconfigure", SmEventRequest, FALSE, FALSE },
63 { "ClientSetInterface", SmEventRequest, FALSE, FALSE },
64 { "ClientStreams", SmEventRequest, FALSE, FALSE },
65 { "DeviceTextQuery", SmEventRequest, FALSE, FALSE },
66 { "HubGetDescriptor", SmEventRequest, FALSE, FALSE },
67 { "LpmSettingChanged", SmEventRequest, FALSE, TRUE },
68 { "NoPingResponse", SmEventRequest, FALSE, TRUE },
69 { "Succeeded", SmEventCompletion, FALSE, FALSE },
70 { "Failed", SmEventCompletion, FALSE, FALSE },
71 { "FailedDeviceEnabled", SmEventCompletion, FALSE, FALSE },
72 { "DetachedDeviceEnabled", SmEventCompletion, FALSE, FALSE },
73 { "PortOffForHubSuspend", SmEventCompletion, FALSE, FALSE },
74 { "HubStoppedHoldingReference", SmEventCompletion, FALSE, FALSE },
75 { "ResumeDone", SmEventCompletion, FALSE, FALSE },
76 { "ResumedWithHub", SmEventCompletion, FALSE, FALSE },
77 { "SuspendedAfterHubResume", SmEventCompletion, FALSE, FALSE },
78 { "NeedsReenumeration", SmEventCompletion, FALSE, FALSE },
79 { "FailEnumeration", SmEventCompletion, FALSE, FALSE },
80};
81
82static_assert(RTL_NUMBER_OF(DeviceMachine::EventInfo) == static_cast<ULONG>(DsmEvent::Count),
83 "EventInfo must have one entry per DsmEvent");
84
85/* Runs the code m_Then names at passive level */
88
89/* Ends the current sub machine with m_Result */
91 { NULL, "Ending", 0, NULL, &DeviceMachine::EnterEnding };
92
93/* FUNCTIONS ******************************************************************/
94
95VOID
98{
100 m_Next = NULL;
101 m_Then = NULL;
102 m_Start = NULL;
105 m_Resume = NULL;
111 m_Result = DsmEvent::Succeeded;
112 m_HubEvent = DsmEvent::PortDetached;
124 m_D3Cold = FALSE;
126
128}
129
130VOID
132{
134}
135
136VOID
138{
140}
141
142VOID
144{
146}
147
150{
151 return CancelStateTimer();
152}
153
160 _In_ ULONG Allowed)
161{
162 return (DeviceKind() & ~Allowed) == 0;
163}
164
165/* Go to a shared wait state; Next gets the event that ends the wait */
168 _In_ const State* Target,
169 _In_ DSM_NEXT Next)
170{
171 m_Next = Next;
172 return SmTransition(Target);
173}
174
175/* Run Then from a state entered at passive level */
178 _In_ DSM_THEN Then)
179{
180 m_Then = Then;
181 return SmTransition(&PassiveStep);
182}
183
184/* End the sub machine of the frame the caller runs in */
188{
190 return SmTransition(&Ending);
191}
192
193/* Handler of the shared waits: the event goes to the continuation */
197{
198 return (this->*m_Next)(Event);
199}
200
203{
204 return (this->*m_Then)();
205}
206
209{
210 return SmReturn(m_Result);
211}
212
213/* SHARED WAITS ***************************************************************/
214
216{
218};
219
220/* Asked the port machine to disable the port */
223
224/* Waiting for a port, hub or timer event with nothing to start */
226 { NULL, "AwaitingPort", 0, &DeviceMachine::OnShared, NULL };
227
228/* Running one of the machine's timers, m_DelayKind says which */
231
232/* Device gone, a canceled controller request still has to complete */
234 { NULL, "IoctlAfterDetach", 0, &DeviceMachine::OnShared, NULL, HubEventDiscards };
235
236/* Device gone, a timer that could not be stopped still has to fire */
238 { NULL, "TimerAfterDetach", 0, &DeviceMachine::OnShared, NULL, HubEventDiscards };
239
240/* Controller disables the device and its default endpoint */
242 { NULL, "DisablingDevice", SM_STATE_CRITICAL_ONLY,
244
245/* Sets the USB PD charging policy on the device */
247 { NULL, "SettingPdCharging", SM_STATE_CRITICAL_ONLY,
249
252{
254 return SmHandled();
255}
256
259{
260 switch (m_DelayKind)
261 {
264 break;
265
268 break;
269
272 break;
273
276 break;
277
280 break;
281
284 break;
285 }
286
287 return SmHandled();
288}
289
293 _In_ DSM_NEXT Next)
294{
296 return Wait(&Delaying, Next);
297}
298
301{
303 return SmHandled();
304}
305
308{
310 return SmHandled();
311}
312
313/* Disable the device in the controller, delete it at passive level, then run After */
316 _In_ DSM_THEN After)
317{
318 m_AfterDelete = After;
320}
321
325{
326 if (Event != DsmEvent::ControllerIoctlDone)
327 return SmUnhandled();
328
330}
331
334{
337 return (this->*m_AfterDelete)();
338}
339
340/* Controller enables the device and its default endpoint */
342 { NULL, "EnablingDevice", SM_STATE_CRITICAL_ONLY,
344
345/* Asked the port machine to reset the port */
348
349/* Controller learns the device was reset */
351 { NULL, "NotifyingReset", SM_STATE_CRITICAL_ONLY,
353
354/* First 8 bytes of the device descriptor at address zero */
356 { NULL, "ReadingFirstDescriptor", SM_STATE_CRITICAL_ONLY,
358
361{
363 return SmHandled();
364}
365
368{
370 return SmHandled();
371}
372
375{
377 return SmHandled();
378}
379
382{
384 return SmHandled();
385}
386
387/* Push a sub machine that starts in a shared wait */
390 _In_ const State* Target,
391 _In_ DSM_NEXT Next)
392{
393 m_Next = Next;
394 return SmCall(Target);
395}
396
397/* Delete the default endpoint and the device at passive level, then run After */
400 _In_ DSM_THEN After)
401{
402 m_AfterDelete = After;
404}
405
406/* SUB MACHINE ENDINGS ********************************************************/
407
410{
411 return EndWith(DsmEvent::Failed);
412}
413
416{
417 return EndWith(DsmEvent::PortDetached);
418}
419
422{
423 return EndWith(m_HubEvent);
424}
425
426/* A hub stop, hub suspend or detach ends the sub machine with that event */
430{
431 switch (Event)
432 {
433 case DsmEvent::PortDetached:
434 case DsmEvent::HubStopping:
435 case DsmEvent::HubSuspending:
436 return EndWith(Event);
437
438 default:
439 return SmUnhandled();
440 }
441}
442
443/* Hub stop or suspend came during a port reset; the reset result is moot */
447{
448 switch (Event)
449 {
450 case DsmEvent::PortDetached:
451 return EndWith(DsmEvent::PortDetached);
452
453 case DsmEvent::PortResetDone:
454 case DsmEvent::PortResetTimeout:
455 case DsmEvent::PortResetAbortedForSuspend:
456 case DsmEvent::PortFault:
457 return EndWith(m_HubEvent);
458
459 default:
460 return SmUnhandled();
461 }
462}
463
464/* Stop the running timer, then end with Event once it can no longer fire */
468{
469 if (Event == DsmEvent::PortDetached)
470 {
471 if (StopTimer())
472 return EndWith(DsmEvent::PortDetached);
473
475 }
476
478 if (StopTimer())
479 return EndWith(Event);
480
482}
483
487{
488 if (Event != DsmEvent::TimerFired)
489 return SmUnhandled();
490
491 return EndWith(DsmEvent::PortDetached);
492}
493
497{
498 switch (Event)
499 {
500 case DsmEvent::PortDetached:
502
503 case DsmEvent::TimerFired:
504 return EndWith(m_HubEvent);
505
506 default:
507 return SmUnhandled();
508 }
509}
510
511/* Push a sub machine that starts with code run at passive level */
514 _In_ DSM_THEN Then)
515{
516 m_Then = Then;
517 return SmCall(&PassiveStep);
518}
519
520/* ONE SHOT REQUESTS **********************************************************/
521
522/* Runs the code m_Then names in a new frame, for sub machines that start with code */
524 { NULL, "Starting", 0, NULL, &DeviceMachine::EnterStarting };
525
526/* A control transfer or controller request the machine waits for, m_Start sends it */
529
530/* Same, letting nothing but completions through */
532 { NULL, "RequestingCritical", SM_STATE_CRITICAL_ONLY,
534
535/* Same, inside a sub machine its caller may leave at any time */
537 { NULL, "RequestingYielding", SM_STATE_YIELDS_TO_CALLER,
539
540/* Canceled a control transfer; the sub machine ends with m_HubEvent once it completes */
542 { NULL, "CancelingTransfer", SM_STATE_CRITICAL_ONLY,
544
547{
548 return (this->*m_Then)();
549}
550
553 _In_ DSM_THEN Then)
554{
555 m_Then = Then;
556 return SmCall(&Starting);
557}
558
561{
562 (this->*m_Start)();
563 return SmHandled();
564}
565
566/* Send a request with Start and wait in Target; Next gets the completion */
569 _In_ const State* Target,
570 _In_ DSM_ACTION Start,
571 _In_ DSM_NEXT Next)
572{
573 m_Start = Start;
574 return Wait(Target, Next);
575}
576
579 _In_ const State* Target,
580 _In_ DSM_ACTION Start,
581 _In_ DSM_NEXT Next)
582{
583 m_Start = Start;
584 return CallWait(Target, Next);
585}
586
589{
591 return SmHandled();
592}
593
594/* Detach, hub stop or hub suspend during a transfer: cancel it, then end the sub machine */
598{
601}
602
606{
607 if ((Event != DsmEvent::TransferDone) && (Event != DsmEvent::TransferFailed))
608 return SmUnhandled();
609
610 return EndWith(m_HubEvent);
611}
612
613/* Asked the port machine to suspend the port */
616
617/* Asked the port machine to resume the port */
620
623{
625 return SmHandled();
626}
627
630{
632 return SmHandled();
633}
634
635/* Waiting with hub events dropped, the device is going away */
637 { NULL, "IgnoringHub", 0, &DeviceMachine::OnShared, NULL, HubEventDiscards };
638
639/* The controller handles a client streams request; then back to m_ReturnTo */
641 { NULL, "ForwardingStreams", SM_STATE_CRITICAL_ONLY | SM_STATE_NEEDS_PASSIVE,
643
646 _In_ const State* ReturnTo)
647{
648 m_ReturnTo = ReturnTo;
650}
651
654{
656 return SmHandled();
657}
658
662{
663 if (Event != DsmEvent::ControllerRequestDone)
664 return SmUnhandled();
665
666 if (m_ReturnTo == NULL)
667 return (this->*m_Resume)();
668
669 return SmTransition(m_ReturnTo);
670}
671
672/* Controller disables every endpoint of the current configuration */
674 { NULL, "DisablingEndpoints", SM_STATE_CRITICAL_ONLY,
676
679{
681 return SmHandled();
682}
683
684/* Waiting for the port machine inside a sub machine its caller may leave */
686 { NULL, "AwaitingPortYielding", SM_STATE_YIELDS_TO_CALLER, &DeviceMachine::OnShared, NULL };
687
688/* Same as RequestingCritical, for requests that must be sent at passive level */
690 { NULL, "RequestingCriticalPassive", SM_STATE_CRITICAL_ONLY | SM_STATE_NEEDS_PASSIVE,
692
693/* A controller request started by a query is running; nothing else may interrupt */
695 { NULL, "WaitingForController", SM_STATE_CRITICAL_ONLY, &DeviceMachine::OnShared, NULL };
static _Out_opt_ PULONGLONG Start
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
unsigned char BOOLEAN
Definition: actypes.h:127
SM_RESULT EnterSettingPdCharging()
Definition: devsm.cpp:307
BOOLEAN m_EndpointsConfigured
Definition: devsm.h:1840
SM_RESULT EndWithHubEvent()
Definition: devsm.cpp:421
BOOLEAN m_ChildForgotten
Definition: devsm.h:1841
ULONG DeviceKind()
Definition: hubchild.cpp:301
VOID DeleteDefaultEndpoint()
Definition: devhcd.cpp:558
VOID ReferenceDevice()
Definition: hubchild.cpp:268
VOID QueuePassiveWork()
Definition: hubchild.cpp:280
HubChild * m_Device
Definition: devsm.h:1832
SM_RESULT EnterPassiveStep()
Definition: devsm.cpp:202
static const State Requesting
Definition: devsm.h:229
static const State AwaitingPort
Definition: devsm.h:222
BOOLEAN m_ReenumForceReset
Definition: devsm.h:1847
SM_RESULT EndDetachedOnTimer(_In_ DsmEvent Event)
Definition: devsm.cpp:485
static const State Starting
Definition: devsm.h:228
SM_RESULT CallWait(_In_ const State *Target, _In_ DSM_NEXT Next)
Definition: devsm.cpp:389
VOID DisableDeviceInController()
Definition: devhcd.cpp:587
BOOLEAN m_DetachEndsReset
Definition: devsm.h:1848
static const State ResumingPort
Definition: devsm.h:236
VOID Initialize(_In_ HubChild *Device)
Definition: devsm.cpp:96
SM_RESULT EnterSuspendingPort()
Definition: devsm.cpp:622
DSM_THEN m_Resume
Definition: devsm.h:1845
VOID StartSuperSpeedPostResetTimer()
Definition: hubchild.cpp:352
SM_RESULT Wait(_In_ const State *Target, _In_ DSM_NEXT Next)
Definition: devsm.cpp:167
SM_RESULT EndDetached()
Definition: devsm.cpp:415
SM_RESULT EndFailed()
Definition: devsm.cpp:409
VOID RequestPortDisable()
Definition: hubport.cpp:638
DSM_THEN m_AfterDisable
Definition: devsm.h:1844
static const State DisablingEndpoints
Definition: devsm.h:239
VOID CancelTransfer()
Definition: devreq.cpp:426
static const State SettingPdCharging
Definition: devsm.h:244
SM_RESULT Then(_In_ DSM_THEN Next)
static const State WaitingForController
Definition: devsm.h:232
VOID StartPostResetTimer()
Definition: hubchild.cpp:340
VOID DeleteDeviceInController()
Definition: devhcd.cpp:568
SM_RESULT EnterNotifyingReset()
Definition: devsm.cpp:374
BOOLEAN StopTimer()
Definition: hubchild.cpp:295
static const State IoctlAfterDetach
Definition: devsm.h:241
VOID SmQueuePassive()
Definition: devsm.cpp:143
VOID RequestPortReset()
Definition: hubport.cpp:662
SM_RESULT DeleteDeviceThen()
Definition: devsm.cpp:333
VOID ArmPostAddressTimer()
Definition: hubchild.cpp:358
static const State TimerAfterDetach
Definition: devsm.h:242
static const State RequestingYielding
Definition: devsm.h:231
VOID RequestPortSuspend()
Definition: hubport.cpp:644
SM_RESULT EnterEnablingDevice()
Definition: devsm.cpp:360
DSM_NEXT m_AfterReenum
Definition: devsm.h:1849
VOID StartLongPostResetTimer()
Definition: hubchild.cpp:346
SM_RESULT DisableAndDelete(_In_ DSM_THEN After)
Definition: devsm.cpp:315
VOID ReadFirstDescriptor()
Definition: devreq.cpp:409
static const State SuspendingPort
Definition: devsm.h:235
DsmEvent m_Result
Definition: devsm.h:1837
SM_RESULT EnterRequesting()
Definition: devsm.cpp:560
BOOLEAN KindWithin(_In_ ULONG Allowed)
A device with no version or speed known yet passes for any version or speed.
Definition: devsm.cpp:159
VOID StartRetryTimer()
Definition: hubchild.cpp:333
static const State AwaitingAttach
Definition: devsm.h:327
SM_RESULT EndWith(_In_ DsmEvent Result)
Definition: devsm.cpp:186
VOID SetPdChargingPolicy()
Definition: devreq.cpp:969
SM_RESULT EndAfterTimer(_In_ DsmEvent Event)
Definition: devsm.cpp:466
SM_RESULT EnterReadingFirstDescriptor()
Definition: devsm.cpp:381
SM_RESULT CancelTransferAndEnd(_In_ DsmEvent Event)
Definition: devsm.cpp:596
SM_RESULT Request(_In_ const State *Target, _In_ DSM_ACTION Start, _In_ DSM_NEXT Next)
Definition: devsm.cpp:568
VOID RequestPortResume()
Definition: hubport.cpp:650
DSM_NEXT m_AfterPurge
Definition: devsm.h:1855
BOOLEAN m_ContextGone
Definition: devsm.h:1851
static const State DisablingDevice
Definition: devsm.h:243
DSM_THEN m_Then
Definition: devsm.h:1834
SM_RESULT CallStep(_In_ DSM_THEN Then)
Definition: devsm.cpp:552
SM_RESULT CallAtPassive(_In_ DSM_THEN Then)
Definition: devsm.cpp:513
static const State IgnoringHub
Definition: devsm.h:237
DSM_DELAY m_DelayKind
Definition: devsm.h:1856
static const State Delaying
Definition: devsm.h:223
HubChild * Device() const
Definition: devsm.h:166
BOOLEAN m_FailedPoweredUp
Definition: devsm.h:1839
static const State CancelingTransfer
Definition: devsm.h:234
static const State DisablingPort
Definition: devsm.h:221
static const State ForwardingStreams
Definition: devsm.h:238
static const State EnablingDevice
Definition: devsm.h:224
SM_RESULT EnterCancelingTransfer()
Definition: devsm.cpp:588
SM_RESULT OnForwardingStreams(_In_ DsmEvent Event)
Definition: devsm.cpp:660
BOOLEAN SmCancelTimer()
Definition: devsm.cpp:149
BOOLEAN m_ConfigFullLength
Definition: devsm.h:1858
DSM_THEN m_AfterDelete
Definition: devsm.h:1835
DsmEvent m_HubEvent
Definition: devsm.h:1838
DSM_NEXT m_Next
Definition: devsm.h:1833
static const State NotifyingReset
Definition: devsm.h:226
static const State ReadingFirstDescriptor
Definition: devsm.h:227
SM_RESULT EndOnHubOrDetach(_In_ DsmEvent Event)
Definition: devsm.cpp:428
SM_RESULT EnterStarting()
Definition: devsm.cpp:546
SM_RESULT EnterDisablingEndpoints()
Definition: devsm.cpp:678
static const State ResettingPort
Definition: devsm.h:225
VOID NotifyDeviceReset()
Definition: devhcd.cpp:837
static const State Ending
Definition: devsm.h:218
DSM_ACTION m_Start
Definition: devsm.h:1857
BOOLEAN m_FromConfigured
Definition: devsm.h:1850
static const State RequestingCriticalPassive
Definition: devsm.h:233
SM_RESULT ForwardStreams(_In_ const State *ReturnTo)
Definition: devsm.cpp:645
SM_RESULT EnterResumingPort()
Definition: devsm.cpp:629
SM_RESULT EnterForwardingStreams()
Definition: devsm.cpp:653
BOOLEAN m_PortMayResume
Definition: devsm.h:1843
SM_RESULT EndOnResetForHub(_In_ DsmEvent Event)
Definition: devsm.cpp:445
SM_RESULT OnShared(_In_ DsmEvent Event)
Definition: devsm.cpp:195
SM_RESULT EnterDisablingPort()
Definition: devsm.cpp:251
static const SM_EVENT_INFO EventInfo[]
Definition: devsm.h:171
static const State AwaitingPortYielding
Definition: devsm.h:240
BOOLEAN m_Unregistered
Definition: devsm.h:1842
SM_RESULT EnterResettingPort()
Definition: devsm.cpp:367
static const State PassiveStep
Definition: devsm.h:217
SM_RESULT AtPassive(_In_ DSM_THEN Then)
Definition: devsm.cpp:177
VOID DisableAllEndpoints()
Definition: devhcd.cpp:1031
SM_RESULT EnterDelaying()
Definition: devsm.cpp:258
SM_RESULT CallRequest(_In_ const State *Target, _In_ DSM_ACTION Start, _In_ DSM_NEXT Next)
Definition: devsm.cpp:578
static const State RequestingCritical
Definition: devsm.h:230
SM_RESULT Delay(_In_ DSM_DELAY Kind, _In_ DSM_NEXT Next)
Definition: devsm.cpp:291
VOID SmReference()
Definition: devsm.cpp:131
SM_RESULT EndForHubOnTimer(_In_ DsmEvent Event)
Definition: devsm.cpp:495
SM_RESULT EndOnTransferCanceled(_In_ DsmEvent Event)
Definition: devsm.cpp:604
SM_RESULT EnterEnding()
Definition: devsm.cpp:208
VOID EnableDeviceInController()
Definition: devhcd.cpp:578
DSM_NEXT m_AfterProgram
Definition: devsm.h:1853
const State * m_ReturnTo
Definition: devsm.h:1836
BOOLEAN CancelStateTimer()
Definition: hubchild.cpp:289
SM_RESULT DeleteThen(_In_ DSM_THEN After)
Definition: devsm.cpp:399
VOID ArmDuplicateDeviceTimer()
Definition: hubchild.cpp:364
VOID ForwardToController()
Definition: devhcd.cpp:1369
VOID SmDereference()
Definition: devsm.cpp:137
DSM_NEXT m_AfterConfigure
Definition: devsm.h:1852
BOOLEAN m_D3Cold
Definition: devsm.h:1854
DSM_REENUM m_ReenumKind
Definition: devsm.h:1846
VOID DereferenceDevice()
Definition: hubchild.cpp:274
SM_RESULT DeleteOnceDisabled(_In_ DsmEvent Event)
Definition: devsm.cpp:323
SM_RESULT EnterDisablingDevice()
Definition: devsm.cpp:300
VOID SmInitialize(_In_ const State *Initial)
Definition: smengine.h:349
static SM_RESULT SmTransition(_In_ const State *Target)
Definition: smengine.h:194
static SM_RESULT SmReturn(_In_ DsmEvent Ev)
Definition: smengine.h:217
static SM_RESULT SmCall(_In_ const State *Start)
Definition: smengine.h:209
static SM_RESULT SmUnhandled()
Definition: smengine.h:188
static const DsmEvent HubEventDiscards[]
Definition: devsm.cpp:215
enum _DSM_DELAY DSM_DELAY
DsmEvent
Definition: devsm.h:15
@ DsmDelayPostResetLong
Definition: devsm.h:126
@ DsmDelayDuplicate
Definition: devsm.h:129
@ DsmDelayEnumRetry
Definition: devsm.h:124
@ DsmDelayPostResetSuperSpeed
Definition: devsm.h:127
@ DsmDelayPostReset
Definition: devsm.h:125
@ DsmDelayPostAddress
Definition: devsm.h:128
@ DsmReenumUnconfigured
Definition: devsm.h:136
_Check_return_ _In_ DXGK_EVENT_TYPE _In_ ULONG Event
Definition: dispmprt.h:1287
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
Definition: hubucx.h:258
macro TEXTAREA section xr p2align endm macro DATAAREA section dw endm macro RODATAAREA section dr endm macro XDATAAREA section dr p2align endm macro PDATAAREA section dr p2align endm macro DCRVA Symbol rva Symbol endm macro EXPORT Attribute global Name endm macro IMPORT Kind
Definition: kxarm64.h:143
#define _In_
Definition: no_sal2.h:158
PACPI_METHOD_ARGUMENT Next
Definition: slotdev.cpp:96
#define SM_STATE_YIELDS_TO_CALLER
Definition: smengine.h:42
#define SM_STATE_NEEDS_PASSIVE
Definition: smengine.h:40
@ SmEventRequest
Definition: smengine.h:25
@ SmEventCompletion
Definition: smengine.h:24
@ SmEventCritical
Definition: smengine.h:27
#define SM_STATE_CRITICAL_ONLY
Definition: smengine.h:41
One state. Handler gets every event the state sees.
Definition: smengine.h:93
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_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
Definition: wsk.h:409