64 "EventInfo must have one entry per PortEvent");
118 { &
Off,
"OffSuperSpeedDisabled", 0,
122 { &
Off,
"OffSuspendedUsb3", 0,
195 if (
Event == PortEvent::DeviceGone)
338 PortEvent::ResumeRequest, PortEvent::DisableRequest, PortEvent::CycleRequest,
339 PortEvent::SuspendRequest, PortEvent::ResetRequest, PortEvent::HibernateRequest
343 PortEvent::WarmResetRequest, PortEvent::HibernateRequest, PortEvent::ResetRequest,
344 PortEvent::CycleRequest, PortEvent::ResumeRequest, PortEvent::DeviceGone,
345 PortEvent::SetU1Timeout, PortEvent::SuspendRequest, PortEvent::DisableRequest,
346 PortEvent::SetU2Timeout, PortEvent::DisableSuperSpeedRequest
431 if (
Change == PortEvent::ChangeOverCurrent)
434 if (
Change == PortEvent::ChangeOverCurrentCleared)
445 if ((
Change != PortEvent::ChangeOverCurrentCleared) && !
m_Usb3)
456 if (
Change == PortEvent::ChangeOverCurrent)
459 if (
Change == PortEvent::ChangeOverCurrentCleared)
509 case PortEvent::ErrorIgnore:
512 case PortEvent::ChangeNeedsHubReset:
517 case PortEvent::ErrorCycle:
520 case PortEvent::ErrorDisableAndCycle:
524 case PortEvent::ChangeConnect:
525 case PortEvent::ChangeOverCurrent:
526 case PortEvent::ChangeOverCurrentCleared:
530 SM_BREAK(
"Port error response not valid here");
545 case PortEvent::ErrorIgnore:
548 case PortEvent::ErrorEnabledWhileReset:
551 case PortEvent::ChangeNeedsHubReset:
554 case PortEvent::ErrorCycle:
559 case PortEvent::ErrorDisableAndCycle:
564 case PortEvent::ChangeConnect:
565 case PortEvent::ChangeOverCurrent:
566 case PortEvent::ChangeOverCurrentCleared:
570 SM_BREAK(
"Port error response not valid here");
677 case PortEvent::HubResumed:
678 case PortEvent::HubResumedWithReset:
681 case PortEvent::HubStarted:
686 case PortEvent::HubResumedInS0:
689 case PortEvent::HubResetting:
693 case PortEvent::PortCleanup:
707 case PortEvent::HubResumed:
708 case PortEvent::HubResumedWithReset:
714 case PortEvent::HubStarted:
717 case PortEvent::HubResumedInS0:
720 case PortEvent::HubResetting:
725 case PortEvent::CycleRequest:
729 case PortEvent::PortCleanup:
743 case PortEvent::HubResumed:
744 case PortEvent::HubResumedWithReset:
745 case PortEvent::HubStarted:
746 case PortEvent::HubResumedInS0:
750 case PortEvent::HubResetting:
754 case PortEvent::PortCleanup:
768 case PortEvent::HubResumed:
769 case PortEvent::HubResumedInS0:
772 case PortEvent::HubStarted:
773 case PortEvent::HubResumedWithReset:
776 case PortEvent::HubResetting:
780 case PortEvent::PortCleanup:
801 case PortEvent::HubResumedInS0:
804 case PortEvent::HubStopping:
807 case PortEvent::HubResumed:
808 case PortEvent::HubResumedWithReset:
814 case PortEvent::CycleRequest:
818 case PortEvent::PortCleanup:
837 if (
Event == PortEvent::DeviceGone)
static _Out_opt_ PULONGLONG Start
VOID ReattachBootDevice()
static const State CleaningUp
VOID UpdateHubPower(_In_ BOOLEAN Idle)
VOID DropInterruptReference()
static const State ResetRequestWait
static const State TimerFlush
PortEvent ErrorResponseDuringReset()
static const State OffEmpty
static const State DisablingForCycleTimed
BOOLEAN OldDevicePresent()
static const State DisablingForCycle
@ FollowOverCurrentCleared
SM_RESULT DetachThen(_In_ PortEvent Change)
SM_RESULT DetachTimed(_In_ PortEvent Change)
SM_RESULT OnOff(_In_ PortEvent Event)
static const State Returning
static const State DebouncingUsb2
VOID SmStateChanged()
The innermost frame that does not yield to its caller decides whether the port holds the hub awake.
static const State HubResetTimerWait
static const State AttachFailedWait
SM_RESULT FailToHubReset()
static const State ResumingAttached
PortEvent m_SuspendReport
BOOLEAN BootDeviceReturning()
static const State ErrorRestarting
BOOLEAN AllowsHubSuspend(_In_ const State *Target) const
SM_RESULT OnOffResetNeeded(_In_ PortEvent Event)
BOOLEAN DeviceConnected()
SM_RESULT PowerDown(_In_ const State *Target)
BOOLEAN SuperSpeedBlocked()
static const State HubResetWait
static const State ResumeAckWait
SM_RESULT OnOffSuspended(_In_ PortEvent Event)
SM_RESULT ResumeSucceeded()
SM_RESULT TimedHubReset()
SM_RESULT TakeInterruptForReset(_In_ const State *Start, _In_ const State *Refused)
static const State OffResetNeeded
VOID SmOnDequeue(_In_ PortEvent Event)
SM_RESULT EnterReturning()
VOID ForceResetOnEnumeration()
static const State OffSuperSpeedDisabled
SM_RESULT ReleaseAndStopTimer()
SM_RESULT ResetSucceeded()
SM_RESULT EnterOffSuspended()
SM_RESULT OnOffSuperSpeedDisabled(_In_ PortEvent Event)
static const State OffAttached
static const State DisablingSuperSpeed
OLD_DEVICE_KIND m_OldDevice
BOOLEAN TakeInterruptReference()
static const State Enabled
PortEvent m_D3FlushReturn
static const State SystemResuming
SM_RESULT CheckConnection()
VOID DropHubResetReference()
static const State Deleted
static const State OverCurrentWait
static const State ResetEnabledWait
SM_RESULT StartOverCurrentWait()
VOID TakePortPowerReference()
SM_RESULT OnOffAttached(_In_ PortEvent Event)
BOOLEAN m_AttachForcedReset
VOID TellDevice(_In_ PSM_DEVICE_NOTICE Notice)
static const State Suspended
SM_RESULT ResetHubThen(_In_ const State *Target)
static const State OffInitial
SM_RESULT OnOffEmpty(_In_ PortEvent Event)
SM_RESULT PowerUp(_In_ const State *Target)
@ OldDeviceResetInProgress
static const State AttachedDisabled
SM_RESULT EnterOffEmpty()
SM_RESULT HandleConnectedFault(_In_ const State *Stay)
Handles a 2.0 port status that makes no sense for an attached port.
SM_RESULT CheckOldDevice(_In_ OLD_DEVICE_KIND Kind)
static const State OffSuspendedUsb3
static const State PoweringPort
SM_RESULT EnterCleaningUp()
SM_RESULT ReattachOrCreate(_In_ OLD_DEVICE_KIND Kind)
SM_RESULT OnCleaningUp(_In_ PortEvent Event)
VOID DropPortPowerReference()
static const State StartingAttached
VOID StartTimer(_In_ PSM_TIMER Timer)
static const State OldDeviceWait
SM_RESULT DeviceArrived(_In_ OLD_DEVICE_KIND Kind)
Drops requests the previous device left behind, then reattaches or creates a device.
TIMER_FOLLOW_UP m_AfterTimer
static const State SsLinkDisabled
SM_RESULT ReturnFromFrame(_In_ PortEvent Event)
PortEvent ErrorResponse()
static const State DebouncingUsb3
SM_RESULT TimedError(_In_ const State *Stay, _In_ BOOLEAN DuringReset)
SM_RESULT ResetTransferFailed()
SM_RESULT StopTimerThen(_In_ TIMER_FOLLOW_UP FollowUp)
SM_RESULT FollowTimer(_In_ TIMER_FOLLOW_UP FollowUp)
BOOLEAN m_ReconnectFlushOnStop
static const State HubResetIssued
static const SM_EVENT_INFO EventInfo[]
static const State Disconnected
static const State OffSuspendedUsb2
VOID ForgetDetachedDevice()
BOOLEAN m_DrainReturnsEmpty
static const State StartingEmpty
VOID Initialize(_In_ HubPort *Port, _In_ BOOLEAN SuperSpeed)
static const State ResumingDisabled
VOID SmDiscardQueued(_In_ PortEvent Ev)
VOID SmInitialize(_In_ const State *Initial)
static SM_RESULT SmTransition(_In_ const State *Target)
static SM_RESULT SmReturn(_In_ PortEvent Ev)
static SM_RESULT SmHandled()
static SM_RESULT SmUnhandled()
const State * SmFrame(_In_ ULONG Index) const
_Check_return_ _In_ DXGK_EVENT_TYPE _In_ ULONG Event
#define UNREFERENCED_PARAMETER(P)
static const PortEvent StatusAndRemoved[]
static const PortEvent GoneOnly[]
static const PortEvent OffAttachedDrops[]
static BOOLEAN NTAPI PsmHasFlag(_In_ const PortMachine::State *Target, _In_ ULONG Flag)
static const PortEvent RemovedAndStopped[]
static const PortEvent IdleRequests[]
@ DisableSuperSpeedRequest
#define PSM_STATE_IDLE_USB3
#define PSM_STATE_IDLE_USB2
#define SM_STATE_TAKES_REQUESTS
#define SM_BREAK(Message)
#define SM_STATE_YIELDS_TO_CALLER
One state. Handler gets every event the state sees.