|
ReactOS 0.4.17-dev-1281-g065abb3
|
#include <hc.h>
Public Types | |
| enum | : ULONG64 { FixFrescoShadow = 0x01 , FixFrescoControl = 0x02 , FixEtronSet = 0x04 , FixEtronClear = 0x08 , FixAsmediaResetDelay = 0x10 } |
| enum class | SystemAction : ULONG { Boot = 0 , ResumeFromSleep = 1 , ResumeFromHibernate = 2 , Sleep = 3 , HybridSleep = 4 , Hibernate = 5 , Shutdown = 6 , None = 7 } |
Static Public Member Functions | |
| static XhciController * | FromDevice (_In_ WDFDEVICE Device) |
| static XhciController * | FromUcx (_In_ UCXCONTROLLER UcxController) |
Private Types | |
| enum class | IdleStatus : ULONG { NotConfigured , NoS0Wake , Configured } |
Private Member Functions | |
| NTSTATUS | CreateWdfObjects () |
| VOID | PopulateErrata () |
| VOID | QueryErrataDatabase (_In_ BOOLEAN AtAddDevice) |
| VOID | ReadRegistryErrata () |
| VOID | SetInternalFlags () |
| VOID | ReadVerifierFlags () |
| VOID | ConfigureS0Idle () |
| VOID | SetIdleTimeout (_In_ ULONG Milliseconds) |
| VOID | EvaluateDsm (_In_ ULONG Function) |
| VOID | EvaluatePrmi () |
| VOID | UpdateRegistryCounters () |
| VOID | RunFirmwareCommands () |
| NTSTATUS | StartController () |
| NTSTATUS | RunD0Pass (_In_ BOOLEAN Restore) |
| VOID | InitFrameSnapshot () |
| _IRQL_requires_max_ (DISPATCH_LEVEL) VOID QueueRecovery(_In_ ULONG Actions | |
| VOID | BootRecovery (_In_ ULONG Actions) |
| VOID | RunRecovery (_In_ ULONG Actions) |
| _IRQL_requires_max_ (DISPATCH_LEVEL) VOID SetGone(_In_ BOOLEAN ReportToPnp) | |
| _IRQL_requires_max_ (DISPATCH_LEVEL) VOID DisableController() | |
| VOID | InternalReset () |
| ULONG64 | NowMs () const |
Lives in the UCXCONTROLLER context and embeds every module object.
Internal fixes keyed by PCI id, bits of m_InternalFlags.
| Enumerator | |
|---|---|
| FixFrescoShadow | |
| FixFrescoControl | |
| FixEtronSet | |
| FixEtronClear | |
| FixAsmediaResetDelay | |
Definition at line 103 of file hc.h.
|
strongprivate |
| Enumerator | |
|---|---|
| NotConfigured | |
| NoS0Wake | |
| Configured | |
Definition at line 207 of file hc.h.
|
strong |
Tracked system power action.
| Enumerator | |
|---|---|
| Boot | |
| ResumeFromSleep | |
| ResumeFromHibernate | |
| Sleep | |
| HybridSleep | |
| Hibernate | |
| Shutdown | |
| None | |
Definition at line 120 of file hc.h.
| XhciController::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
32 bit frame number, Increment microframes ahead.
|
private |
| XhciController::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
Port connect state for the power engine.
| XhciController::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
Root hub PDO reached D0: switch to the short idle timeout.
|
private |
| XhciController::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
Any IRQL up to DISPATCH_LEVEL; the work runs on the recovery work item.
|
private |
| XhciController::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
DPRINT1 a hardware verifier condition; breaks in when that flag is enabled.
Definition at line 1971 of file hc.cpp.
|
private |
Definition at line 761 of file hc.cpp.
Referenced by Initialize().
|
private |
Definition at line 850 of file hc.cpp.
Referenced by Initialize().
| NTSTATUS XhciController::D0Entry | ( | _In_ WDF_POWER_DEVICE_STATE | PreviousState | ) |
Definition at line 1357 of file hc.cpp.
Referenced by XhciEvtDeviceD0Entry().
| NTSTATUS XhciController::D0EntryPostInterruptsEnabled | ( | _In_ WDF_POWER_DEVICE_STATE | PreviousState | ) |
Definition at line 1574 of file hc.cpp.
Referenced by XhciEvtDeviceD0EntryPostInterruptsEnabled().
| VOID XhciController::D0Exit | ( | _In_ WDF_POWER_DEVICE_STATE | TargetState | ) |
Definition at line 1613 of file hc.cpp.
Referenced by XhciEvtDeviceD0Exit().
| VOID XhciController::D0ExitPreInterruptsDisabled | ( | ) |
Definition at line 1604 of file hc.cpp.
Referenced by XhciEvtDeviceD0ExitPreInterruptsDisabled().
Definition at line 686 of file hc.cpp.
Referenced by ConfigureS0Idle(), D0Entry(), and D0Exit().
|
private |
Definition at line 723 of file hc.cpp.
Referenced by D0ExitPreInterruptsDisabled().
| VOID XhciController::FdoCleanup | ( | ) |
Definition at line 1229 of file hc.cpp.
Referenced by XhciEvtFdoCleanup().
|
static |
Definition at line 169 of file hc.cpp.
Referenced by XhciEvtDeviceArmWakeFromS0(), XhciEvtDeviceArmWakeFromSx(), XhciEvtDeviceD0Entry(), XhciEvtDeviceD0EntryPostInterruptsEnabled(), XhciEvtDeviceD0Exit(), XhciEvtDeviceD0ExitPreInterruptsDisabled(), XhciEvtDeviceDisarmWakeFromS0(), XhciEvtDeviceDisarmWakeFromSx(), XhciEvtDeviceFilterAddResourceRequirements(), XhciEvtDeviceFilterRemoveResourceRequirements(), XhciEvtDevicePrepareHardware(), XhciEvtDeviceReleaseHardware(), XhciEvtDeviceSelfManagedIoCleanup(), XhciEvtDeviceSelfManagedIoInit(), XhciEvtDeviceUsageNotification(), XhciEvtDeviceWakeFromS0Triggered(), XhciEvtPreprocessInternalIoctl(), and XhciEvtPreprocessSetPower().
|
static |
Definition at line 176 of file hc.cpp.
Referenced by XhciEndpoint::Create(), XhciEvtControllerEnableForwardProgress(), XhciEvtControllerGetCurrentFrameNumber(), XhciEvtControllerQueryUsbCapability(), XhciEvtControllerReset(), and XhciEvtControllerUsbDeviceAdd().
|
inline |
Definition at line 58 of file hc.h.
Referenced by XhciRootHub::AcknowledgeResume(), XhciRegisters::ApplyD0Workarounds(), XhciUsbDevice::ApplyUpdate(), XhciRegisters::BiosHandoff(), XhciEndpoint::BuildContext(), XhciTransferRing::BuildLinkTrb(), XhciUsbDevice::BuildSlotContext(), XhciRootHub::ClearUsb20PortFeature(), ConfigureS0Idle(), XhciRegisters::ContiguousFrameId(), XhciRootHub::D0Entry(), D0Entry(), D0EntryPostInterruptsEnabled(), XhciRootHub::D0Exit(), D0Exit(), D0ExitPreInterruptsDisabled(), XhciEndpointMachine::DelaysFirstStop(), XhciEndpoint::DequeueAfterStop(), XhciInterrupters::FilterResourceRequirements(), Initialize(), XhciEndpoint::Initialize(), XhciRootHub::IsHiddenDebugPort(), XhciEndpointMachine::NeedsContextRebuildAfterStop(), XhciEndpointMachine::OnPrimaryInterrupterOnly(), XhciEndpoint::OnTransferEvent(), XhciRegisters::ParseCapabilities(), XhciCommandRing::PlaceLocked(), XhciInterrupters::Prepare(), XhciRegisters::ProgramSsicPortUnused(), XhciRootHub::QueryTunnelState(), QueryUsbCapability(), XhciRegisters::Read64(), XhciUsbDevice::Reset(), XhciEndpoint::ResetStreamTransferLength(), XhciRegisters::RestoreVendorBits(), XhciRootHub::ResuspendResumedPorts(), XhciTransferRing::ReturnSegments(), XhciRegisters::SaveVendorBits(), XhciInterrupters::SecondaryCountFor(), SelfManagedIoInit(), SetPortWake(), XhciRootHub::SetUsb20PortFeature(), XhciRootHub::SetUsb30LinkState(), XhciRootHub::SetWakeEnables(), XhciEndpoint::StreamTransferLength(), XhciUsbDevice::WantsTunnelStateDsm(), and XhciRegisters::Write64().
|
private |
Definition at line 1805 of file hc.cpp.
Referenced by D0Entry().
| NTSTATUS XhciController::Initialize | ( | _In_ WDFDEVICE | Device, |
| _In_ UCXCONTROLLER | Ucx, | ||
| _In_ const XhciIdentity * | Identity | ||
| ) |
Definition at line 905 of file hc.cpp.
|
private |
Definition at line 2113 of file hc.cpp.
Referenced by BootRecovery(), RunRecovery(), and UcxReset().
| BOOLEAN XhciController::IsAccessible | ( | ) | const |
Registers mapped and the controller not marked gone.
Definition at line 193 of file hc.cpp.
Referenced by _IRQL_requires_max_(), XhciUsbDevice::Address(), XhciRegisters::BiosHandoff(), XhciRootHub::ClearPortFeature(), XhciInterrupters::D0Entry(), XhciUsbDevice::Disable(), XhciUsbDevice::Enable(), XhciUsbDevice::EndpointsConfigure(), XhciRootHub::GetPortErrorCount(), XhciRootHub::GetPortStatus(), XhciCommandRing::InitializeRing(), XhciRootHub::InterruptTransfer(), XhciCommandRing::OnTimer(), XhciInterrupters::PostReset(), XhciSlotTable::Program(), XhciCommandRing::Release(), XhciUsbDevice::Reset(), XhciRegisters::ResetController(), XhciRegisters::RestoreState(), XhciRegisters::Run(), XhciRegisters::SaveState(), XhciRootHub::SetPortFeature(), XhciRegisters::Stop(), UcxReset(), XhciUsbDevice::Update(), XhciRegisters::WaitForReady(), and WatchdogTick().
| VOID XhciController::MarkGone | ( | ) |
Definition at line 1924 of file hc.cpp.
Referenced by XhciRootHub::CheckRunning(), XhciRootHub::GetPortStatus(), XhciRootHub::InterruptTransfer(), and XhciCommandRing::OnTimer().
|
private |
Definition at line 1783 of file hc.cpp.
Referenced by InitFrameSnapshot().
|
private |
Definition at line 580 of file hc.cpp.
Referenced by Initialize().
Definition at line 1254 of file hc.cpp.
Referenced by XhciEvtDevicePrepareHardware().
Definition at line 432 of file hc.cpp.
Referenced by PopulateErrata(), and SelfManagedIoInit().
| NTSTATUS XhciController::QueryUsbCapability | ( | _In_ const GUID * | Capability, |
| _In_ ULONG | OutputBufferLength, | ||
| _Out_writes_bytes_opt_(OutputBufferLength) PVOID | OutputBuffer, | ||
| _Out_ PULONG | ResultLength | ||
| ) |
Definition at line 2210 of file hc.cpp.
Referenced by XhciEvtControllerQueryUsbCapability().
|
private |
Definition at line 522 of file hc.cpp.
Referenced by PopulateErrata().
|
private |
Definition at line 596 of file hc.cpp.
Referenced by SelfManagedIoInit().
| VOID XhciController::RecoveryWorker | ( | ) |
Definition at line 2095 of file hc.cpp.
| VOID XhciController::ReleaseHardware | ( | ) |
Definition at line 1312 of file hc.cpp.
Referenced by XhciEvtDeviceReleaseHardware().
|
private |
Definition at line 1536 of file hc.cpp.
Referenced by D0EntryPostInterruptsEnabled().
Definition at line 2024 of file hc.cpp.
Referenced by RecoveryWorker().
| VOID XhciController::SelfManagedIoCleanup | ( | ) |
Definition at line 1722 of file hc.cpp.
Referenced by XhciEvtDeviceSelfManagedIoCleanup().
| VOID XhciController::SelfManagedIoInit | ( | ) |
Definition at line 1668 of file hc.cpp.
Referenced by XhciEvtDeviceSelfManagedIoInit().
| VOID XhciController::SetErrata | ( | _In_ XhciErrata | Bit | ) |
Only bits 0 and 12 may be set after population.
Definition at line 183 of file hc.cpp.
Referenced by XhciRegisters::ParseCapabilities().
Definition at line 737 of file hc.cpp.
|
private |
Definition at line 562 of file hc.cpp.
Referenced by PopulateErrata().
Definition at line 836 of file hc.cpp.
Referenced by XhciEvtDeviceArmWakeFromS0(), and XhciEvtDeviceDisarmWakeFromS0().
|
private |
Definition at line 1483 of file hc.cpp.
Referenced by D0EntryPostInterruptsEnabled(), and InternalReset().
| VOID XhciController::TrackSystemPowerIrp | ( | _In_ PIO_STACK_LOCATION | Stack | ) |
Definition at line 1746 of file hc.cpp.
| VOID XhciController::UcxReset | ( | ) |
Definition at line 2193 of file hc.cpp.
Referenced by XhciEvtControllerReset().
|
private |
Definition at line 1689 of file hc.cpp.
Referenced by SelfManagedIoCleanup().
| VOID XhciController::UsageNotification | ( | _In_ WDF_SPECIAL_FILE_TYPE | Type, |
| _In_ BOOLEAN | InPath | ||
| ) |
Definition at line 1734 of file hc.cpp.
Referenced by XhciEvtDeviceUsageNotification().
| VOID XhciController::WatchdogTick | ( | ) |
Definition at line 1848 of file hc.cpp.
| XhciCommonBuffer XhciController::m_Buffers |
Definition at line 92 of file hc.h.
Referenced by _IRQL_requires_(), XhciTransferRing::BorrowBounceBuffer(), XhciControlRing::BuildControlTd(), XhciEndpoint::Cleanup(), XhciTransferRing::Cleanup(), XhciUsbDevice::Cleanup(), D0Exit(), XhciEndpoint::DefaultUpdateDone(), XhciEndpoint::DisableRings(), XhciTransferRing::EnsureFreeSegments(), XhciEndpoint::FreeDefaultStreams(), XhciSlotTable::FreeTables(), Initialize(), InternalReset(), XhciEndpoint::OpenStreams(), XhciCommandRing::Prepare(), PrepareHardware(), XhciEndpointMachine::ReconfigureAfterStop(), XhciEndpointMachine::ReconfigureForReset(), XhciCommandRing::Release(), ReleaseHardware(), XhciControlRing::ReleaseResources(), XhciEndpoint::ResetConfigureDone(), XhciEndpoint::ResetDropDone(), RunRecovery(), SelfManagedIoCleanup(), SelfManagedIoInit(), XhciUsbDevice::StartReconfigure(), XhciEndpoint::StopAddDone(), XhciEndpoint::StopDropDone(), XhciEndpoint::StreamsDisableDone(), XhciEndpoint::StreamsEnableDone(), and WatchdogTick().
| XhciCommandRing XhciController::m_Commands |
Definition at line 95 of file hc.h.
Referenced by XhciEndpoint::ControlResetDone(), D0EntryPostInterruptsEnabled(), XhciEndpoint::DequeueAfterReset(), XhciEndpoint::DequeueAfterStop(), XhciUsbDevice::EndpointsConfigure(), Initialize(), InternalReset(), PrepareHardware(), XhciEndpointMachine::ReconfigureAfterStop(), XhciEndpointMachine::ReconfigureForReset(), ReleaseHardware(), XhciUsbDevice::Reset(), XhciEndpointMachine::ResetDefaultPipe(), XhciEndpoint::ResetDropDone(), XhciEndpointMachine::ResetEndpoint(), RunD0Pass(), RunRecovery(), XhciEndpointMachine::SendStopCommand(), XhciUsbDevice::StartReconfigure(), XhciEndpoint::StopDropDone(), XhciUsbDevice::SubmitAddressDevice(), XhciUsbDevice::SubmitDisableSlot(), XhciUsbDevice::SubmitEnableSlot(), XhciUsbDevice::SubmitSecondConfigure(), and XhciUsbDevice::Update().
| WDFDEVICE XhciController::m_Device |
Definition at line 85 of file hc.h.
Referenced by BootRecovery(), ConfigureS0Idle(), XhciInterrupters::CreateInterrupt(), D0Exit(), EvaluateDsm(), EvaluatePrmi(), Initialize(), XhciUsbDevice::QueueTunnelStateDsm(), ReadRegistryErrata(), RunRecovery(), SelfManagedIoInit(), SetIdleTimeout(), and UpdateRegistryCounters().
| ULONG64 XhciController::m_Errata |
Definition at line 88 of file hc.h.
Referenced by HasErrata(), PopulateErrata(), QueryErrataDatabase(), ReadRegistryErrata(), and SetErrata().
| ULONG64 XhciController::m_ErrataWord2 |
Definition at line 89 of file hc.h.
Referenced by HasErrata(), PopulateErrata(), and QueryErrataDatabase().
|
private |
Definition at line 265 of file hc.h.
Referenced by InitFrameSnapshot().
|
private |
Definition at line 264 of file hc.h.
Referenced by D0Entry(), and InitFrameSnapshot().
|
private |
Definition at line 262 of file hc.h.
Referenced by IsAccessible().
|
private |
Definition at line 284 of file hc.h.
Referenced by RunRecovery().
| XhciIdentity XhciController::m_Identity |
Who the controller is.
Definition at line 100 of file hc.h.
Referenced by FdoCleanup(), Initialize(), PopulateErrata(), XhciRegisters::ReadFirmwareVersion(), ReadVerifierFlags(), RunFirmwareCommands(), and SetInternalFlags().
|
private |
Definition at line 278 of file hc.h.
Referenced by CreateWdfObjects(), D0Exit(), and ReleaseHardware().
|
private |
Definition at line 273 of file hc.h.
Referenced by ConfigureS0Idle(), D0Entry(), Initialize(), and SetIdleTimeout().
| ULONG64 XhciController::m_InternalFlags |
Definition at line 111 of file hc.h.
Referenced by XhciRegisters::ApplyD0Workarounds(), PopulateErrata(), XhciRegisters::ResetController(), and SetInternalFlags().
| XhciInterrupters XhciController::m_Interrupters |
Definition at line 94 of file hc.h.
Referenced by D0Exit(), D0ExitPreInterruptsDisabled(), Initialize(), InternalReset(), PrepareHardware(), ReleaseHardware(), RunD0Pass(), and XhciTransferRing::UpdateInterrupterTarget().
|
private |
Definition at line 274 of file hc.h.
Referenced by D0Entry(), and SetIdleTimeout().
|
private |
Definition at line 285 of file hc.h.
Referenced by RunRecovery().
| WDF_POWER_DEVICE_STATE XhciController::m_PowerState |
D0 only after a successful D0 entry; the target state from D0 exit start.
Definition at line 117 of file hc.h.
Referenced by D0Entry(), XhciRootHub::D0Exit(), D0Exit(), and Initialize().
|
private |
Definition at line 282 of file hc.h.
Referenced by CreateWdfObjects(), and RecoveryWorker().
|
private |
Definition at line 269 of file hc.h.
Referenced by InternalReset(), and UpdateRegistryCounters().
|
private |
Definition at line 277 of file hc.h.
Referenced by CreateWdfObjects(), D0Exit(), and ReleaseHardware().
|
private |
Definition at line 281 of file hc.h.
Referenced by CreateWdfObjects(), and RecoveryWorker().
|
private |
Definition at line 283 of file hc.h.
Referenced by CreateWdfObjects(), and RecoveryWorker().
| XhciRegisters XhciController::m_Registers |
Definition at line 91 of file hc.h.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), XhciEndpoint::BuildEndpointConfigure(), XhciRootHub::CheckRunning(), D0Entry(), D0Exit(), XhciRootHub::DisableLpmForSlot(), XhciRootHub::FillSpeeds(), XhciRootHub::GetPortErrorCount(), XhciRootHub::GetPortStatus(), InitFrameSnapshot(), XhciEndpoint::Initialize(), XhciCommandRing::InitializeRing(), XhciEndpoint::InputEndpointContext(), InternalReset(), IsAccessible(), XhciRootHub::IsHiddenDebugPort(), XhciCommandRing::OnTimer(), XhciEndpoint::OpenStreams(), XhciTransferRing::PacketCount(), XhciRootHub::ParseProtocol(), XhciRootHub::Prepare(), XhciInterrupters::Prepare(), PrepareHardware(), XhciSlotTable::Program(), XhciCommandRing::PutOnRingLocked(), XhciRootHub::QueryTunnelState(), QueryUsbCapability(), XhciRootHub::ReadPortSc(), ReadVerifierFlags(), XhciEndpointMachine::ReconfigureAfterStop(), XhciEndpointMachine::ReconfigureForReset(), XhciCommandRing::Release(), ReleaseHardware(), XhciCommandRing::RestartStoppedRingLocked(), RunD0Pass(), StartController(), XhciTransferRing::TdSize(), XhciRootHub::UpdatePortReg(), XhciRootHub::UpdatePortScLocked(), and WatchdogTick().
| BOOLEAN XhciController::m_ReservedIoArmed |
Set by UCX through EvtControllerEnableForwardProgress; read by transfer code.
Definition at line 114 of file hc.h.
Referenced by XhciEvtControllerEnableForwardProgress().
|
private |
Definition at line 270 of file hc.h.
Referenced by InternalReset(), RunRecovery(), and WatchdogTick().
|
private |
Definition at line 271 of file hc.h.
Referenced by WatchdogTick().
|
private |
Definition at line 272 of file hc.h.
Referenced by InternalReset().
|
private |
Definition at line 268 of file hc.h.
Referenced by D0Entry(), and UpdateRegistryCounters().
| XhciRootHub XhciController::m_RootHub |
Definition at line 96 of file hc.h.
Referenced by XhciUsbDevice::ApplyUpdate(), D0Entry(), D0EntryPostInterruptsEnabled(), D0Exit(), XhciUsbDevice::Disable(), Initialize(), InternalReset(), PrepareHardware(), ReleaseHardware(), RunRecovery(), SetPortWake(), and XhciEvtDeviceWakeFromS0Triggered().
|
private |
| XhciSlotTable XhciController::m_Slots |
Definition at line 93 of file hc.h.
Referenced by D0Entry(), XhciUsbDevice::ForgetSlot(), Initialize(), InternalReset(), XhciUsbDevice::OnEnableSlotDone(), PrepareHardware(), ReleaseHardware(), RunD0Pass(), and RunRecovery().
|
private |
Definition at line 267 of file hc.h.
Referenced by UsageNotification().
| XhciDmaBuffer* XhciController::m_SplitPadBuffer |
Errata bit 34 pad buffer, NULL when absent.
Definition at line 134 of file hc.h.
Referenced by SelfManagedIoCleanup(), and SelfManagedIoInit().
| SystemAction XhciController::m_SystemAction |
Definition at line 131 of file hc.h.
Referenced by D0Entry(), XhciRootHub::D0Exit(), D0Exit(), Initialize(), and TrackSystemPowerIrp().
| BOOLEAN XhciController::m_TestMode |
Definition at line 204 of file hc.h.
Referenced by Initialize().
|
private |
Definition at line 266 of file hc.h.
Referenced by Initialize(), and NowMs().
| UCXCONTROLLER XhciController::m_Ucx |
Definition at line 87 of file hc.h.
Referenced by BootRecovery(), CreateWdfObjects(), D0Entry(), XhciCommonBuffer::EnablerCleanup(), Initialize(), InternalReset(), RunRecovery(), and UcxReset().
|
private |
Definition at line 261 of file hc.h.
Referenced by ReadVerifierFlags().
| BOOLEAN XhciController::m_WaitWakeQueued |
Definition at line 203 of file hc.h.
Referenced by SetPortWake(), XhciEvtDeviceArmWakeFromSx(), and XhciEvtDeviceDisarmWakeFromSx().
|
private |
Definition at line 276 of file hc.h.
Referenced by CreateWdfObjects(), D0Exit(), InternalReset(), and StartController().
| PDEVICE_OBJECT XhciController::m_WdmDevice |
Definition at line 86 of file hc.h.
Referenced by XhciControlRing::BuildControlTd(), Initialize(), and XhciEndpoint::SendClearStall().