|
ReactOS 0.4.17-dev-1281-g065abb3
|
#include <xferring.h>

Static Public Member Functions | |
| static NTSTATUS | Create (_In_ XhciEndpoint *Endpoint, _In_ WDFOBJECT Parent, _In_ ULONG StreamId, _Out_ XhciTransferRing **Ring) |
| static XhciTransferRing * | FromQueue (_In_ WDFQUEUE Queue) |
| static BOOLEAN | OnUntargetedTransferEvent (_In_ XhciController *Controller, _In_ const XHCI_TRB *Event) |
| static ULONG | UrbProcessorIndex (_In_ PURB Urb) |
| static USBD_STATUS | UsbdStatusFromCompletionCode (_In_ ULONG CompletionCode) |
| static NTSTATUS | NtStatusFromUsbdStatus (_In_ USBD_STATUS UsbdStatus) |
| static XhciTransferRing * | ReferenceLiveRing (_In_ XhciController *Controller, _In_ const XhciUsbDevice *Device, _In_ ULONG Dci) |
One transfer ring, stored as its WDFQUEUE context; the type specific state follows in m_Type.
Definition at line 28 of file xferring.h.
| XhciTransferRing::_IRQL_requires_ | ( | PASSIVE_LEVEL | ) |
| XhciTransferRing::_IRQL_requires_ | ( | PASSIVE_LEVEL | ) |
| XhciTransferRing::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
| XhciTransferRing::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
| XhciTransferRing::_IRQL_requires_max_ | ( | DISPATCH_LEVEL | ) |
| VOID XhciTransferRing::AllowReclaimOnCancel | ( | ) |
Definition at line 730 of file xferring.cpp.
Referenced by XhciEndpointMachine::NotifyRingsReclaimOnCancel().
| XhciDmaBuffer * XhciTransferRing::BorrowBounceBuffer | ( | ) |
0x200 byte buffer from the double buffer cache, or a new one; NULL on failure.
Definition at line 1014 of file xferring.cpp.
Referenced by XhciControlRing::PrepareTransfer().
| VOID XhciTransferRing::BuildLinkTrb | ( | _Out_ PXHCI_TRB | Trb, |
| _In_ BOOLEAN | FirstOfTd, | ||
| _In_ BOOLEAN | InDataStage | ||
| ) | const |
Zeroed link TRB with type, cycle, chain and interrupter target set; the caller adds pointer and TC.
Definition at line 1090 of file xferring.cpp.
| XhciMapState XhciTransferRing::ChangeMapState | ( | _In_ BOOLEAN | FromAny, |
| _In_ XhciMapState | From, | ||
| _In_ XhciMapState | To | ||
| ) |
Interlocked map state change, unconditional when FromAny; returns the old state.
Definition at line 1048 of file xferring.cpp.
| VOID XhciTransferRing::Cleanup | ( | ) |
Definition at line 340 of file xferring.cpp.
| VOID XhciTransferRing::ConsumePendingEvents | ( | ) |
Definition at line 741 of file xferring.cpp.
Referenced by XhciEndpointMachine::NotifyRingsDrainEvents().
|
static |
PASSIVE_LEVEL
Referenced by XhciEndpoint::Initialize().
| ULONG64 XhciTransferRing::DequeuePointerValue | ( | ) | const |
Enqueue pointer with DCS, plus SCT 1 for a stream ring (context and Set TR Dequeue value).
Definition at line 670 of file xferring.cpp.
Referenced by XhciEndpoint::CloseStreams(), XhciEndpoint::ControlResetDone(), XhciEndpoint::DequeueAfterReset(), XhciEndpoint::DequeueAfterStop(), XhciEndpoint::EndpointDequeuePointer(), XhciEndpoint::OpenStreams(), XhciEndpointMachine::ReconfigureForReset(), and XhciEndpoint::ResetDropDone().
| VOID XhciTransferRing::DereferenceLive | ( | ) |
| BOOLEAN XhciTransferRing::DoorbellRungSinceFill | ( | ) | const |
Definition at line 763 of file xferring.cpp.
Referenced by XhciEndpointMachine::DoorbellRungSinceFill().
| ULONG64 XhciTransferRing::EnqueuePointer | ( | ) | const |
Definition at line 664 of file xferring.cpp.
Referenced by DequeuePointerValue(), XhciControlRing::LocateTrb(), and XhciEndpoint::StreamRingEmpty().
Makes sure the free pool holds Count segments; Async may return STATUS_PENDING.
Definition at line 853 of file xferring.cpp.
Referenced by _IRQL_requires_(), and TakeSegments().
|
static |
| BOOLEAN XhciTransferRing::HasQueuedWork | ( | ) | const |
Definition at line 775 of file xferring.cpp.
| VOID XhciTransferRing::InitializeRing | ( | ) |
Zeroes the current segment and resets enqueue and cycle state.
Definition at line 648 of file xferring.cpp.
Referenced by _IRQL_requires_max_(), XhciEndpoint::ControlResetDone(), XhciEndpoint::DequeueAfterStop(), XhciEndpointMachine::ReconfigureForReset(), and XhciEndpoint::ResetDropDone().
| BOOLEAN XhciTransferRing::IsBulkOrInterrupt | ( | ) | const |
Definition at line 327 of file xferring.cpp.
Referenced by IsLikelyDuplicate(), OnPipeHalted(), OnTransferEvent(), OnUntargetedTransferEvent(), and StoppedEventReceived().
| BOOLEAN XhciTransferRing::IsControl | ( | ) | const |
Definition at line 321 of file xferring.cpp.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), AllowReclaimOnCancel(), Cleanup(), ConsumePendingEvents(), DoorbellRungSinceFill(), HasQueuedWork(), OnTransferEvent(), OnUntargetedTransferEvent(), RecoverTransfers(), ResumeRingFill(), and SuspendRingFill().
| BOOLEAN XhciTransferRing::IsIsoch | ( | ) | const |
Definition at line 334 of file xferring.cpp.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), AllowReclaimOnCancel(), Cleanup(), ConsumePendingEvents(), DoorbellRungSinceFill(), HasQueuedWork(), OnClientPipeReset(), OnTransferEvent(), RecoverTransfers(), ResumeRingFill(), and SuspendRingFill().
Stream duplicate heuristic for ED = 0 events nobody claimed (bulk only).
Definition at line 843 of file xferring.cpp.
Referenced by XhciEndpoint::OnTransferEvent().
| VOID XhciTransferRing::MakeLive | ( | ) |
|
static |
Definition at line 1237 of file xferring.cpp.
Referenced by XhciIsochRing::Finalize().
| VOID XhciTransferRing::OnClientPipeReset | ( | ) |
Definition at line 714 of file xferring.cpp.
Referenced by XhciEndpointMachine::NotifyRingsClientReset().
| VOID XhciTransferRing::OnPipeHalted | ( | ) |
Definition at line 706 of file xferring.cpp.
Referenced by XhciEndpointMachine::NotifyRingsHalted().
TRUE when this ring recognized the event (the endpoint gave it to this ring).
Definition at line 787 of file xferring.cpp.
Referenced by XhciEndpoint::OnTransferEvent(), and OnUntargetedTransferEvent().
|
static |
Interrupter fast path: finds the ring by slot and DCI; the type module then checks the Event Data value.
Definition at line 803 of file xferring.cpp.
Referenced by XhciRouteTransferEvent().
Definition at line 1113 of file xferring.cpp.
Referenced by TdSize(), and XhciControlRing::WriteTd().
| WDFQUEUE XhciTransferRing::Queue | ( | ) | const |
Definition at line 315 of file xferring.cpp.
Referenced by _IRQL_requires_(), XhciEndpoint::Initialize(), XhciEndpoint::OpenStreams(), XhciEndpointMachine::PurgeStreamQueues(), XhciEndpointMachine::RestartStreamQueues(), XhciEndpoint::StreamsDisableDone(), and XhciEndpoint::StreamsEnableDone().
| VOID XhciTransferRing::RecoverTransfers | ( | ) |
Definition at line 752 of file xferring.cpp.
Referenced by XhciEndpointMachine::NotifyRingsReclaim().
|
static |
Finds the non stream ring of Device and Dci and takes an event reference on it.
Definition at line 419 of file xferring.cpp.
Referenced by OnUntargetedTransferEvent().
| VOID XhciTransferRing::ResumeRingFill | ( | ) |
Definition at line 684 of file xferring.cpp.
Referenced by XhciEndpointMachine::ResumeRingFill().
| VOID XhciTransferRing::RetireLive | ( | ) |
Definition at line 400 of file xferring.cpp.
Referenced by Cleanup().
| VOID XhciTransferRing::ReturnBounceBuffer | ( | _In_ XhciDmaBuffer * | Buffer | ) |
Definition at line 1039 of file xferring.cpp.
Referenced by XhciControlRing::ReleaseResources().
| VOID XhciTransferRing::ReturnSegments | ( | _Inout_ PLIST_ENTRY | List, |
| _In_ BOOLEAN | ToHead | ||
| ) |
Returns segments to the pool; the caller holds m_Lock.
Definition at line 989 of file xferring.cpp.
| VOID XhciTransferRing::RingDoorbell | ( | ) |
Rings this ring's doorbell (DCI and stream id) and records that it was rung.
Definition at line 1175 of file xferring.cpp.
Referenced by XhciControlRing::WriteTd().
| ULONG64 XhciTransferRing::SegmentBase | ( | ) | const |
Definition at line 658 of file xferring.cpp.
Referenced by EnqueuePointer(), XhciControlRing::LocateTrb(), XhciControlRing::OnTrbEvent(), and XhciEndpoint::StreamRingEmpty().
| VOID XhciTransferRing::StoppedEventReceived | ( | ) |
Definition at line 722 of file xferring.cpp.
Referenced by XhciEndpointMachine::NotifyRingsStoppedEvent().
| VOID XhciTransferRing::SuspendRingFill | ( | ) |
Definition at line 695 of file xferring.cpp.
Referenced by XhciEndpointMachine::SuspendRingFill().
| NTSTATUS XhciTransferRing::TakeSegments | ( | _In_ ULONG | Count, |
| _Inout_ PLIST_ENTRY | List | ||
| ) |
Moves Count pool segments to the head of List. Same results as EnsureFreeSegments.
Definition at line 950 of file xferring.cpp.
| ULONG XhciTransferRing::TdSize | ( | _In_ ULONG | PacketCount, |
| _In_ ULONG | BytesMappedSoFar, | ||
| _In_ BOOLEAN | LastTrbOfTd | ||
| ) | const |
TD Size field (xHCI 4.11.2.4) for a TRB, given bytes mapped so far including it.
Definition at line 1126 of file xferring.cpp.
Referenced by XhciControlRing::WriteTd().
| VOID XhciTransferRing::UpdateInterrupterTarget | ( | ) |
Recomputes the 10 bit interrupter target for work issued on this processor.
Definition at line 1147 of file xferring.cpp.
Referenced by XhciControlRing::BuildControlTd(), and UpdateInterrupterTarget().
Same, for the processor index UCX stamped into the URB; XHCI_URB_NO_PROCESSOR means the current one.
Definition at line 1154 of file xferring.cpp.
Processor index UCX stamped into the first ULONG of the URB's HCD area.
Definition at line 1168 of file xferring.cpp.
Referenced by XhciControlRing::BuildControlTd(), XhciBulkRing::NextTdSlot(), and XhciIsochRing::NextTdSlot().
|
static |
Code 0 (no hardware result) gives the "not set" value 0xFFFFFFFF for the caller to replace.
Definition at line 1184 of file xferring.cpp.
Referenced by XhciIsochRing::CompleteTd().
| XhciBulkRing XhciTransferRing::Bulk |
Definition at line 199 of file xferring.h.
| XhciControlRing XhciTransferRing::Control |
Definition at line 198 of file xferring.h.
Referenced by BuildLinkTrb().
| XhciIsochRing XhciTransferRing::Isoch |
Definition at line 200 of file xferring.h.
| WDFDPC XhciTransferRing::m_CompletionDpc |
Definition at line 176 of file xferring.h.
Referenced by _IRQL_requires_(), and XhciControlRing::QueueCompletion().
| XhciController* XhciTransferRing::m_Controller |
Definition at line 170 of file xferring.h.
Referenced by _IRQL_requires_(), BorrowBounceBuffer(), XhciControlRing::BuildControlTd(), BuildLinkTrb(), Cleanup(), EnsureFreeSegments(), OnTransferEvent(), XhciControlRing::OnTrbEvent(), PacketCount(), ReferenceLiveRing(), XhciControlRing::ReleaseResources(), ReturnSegments(), TdSize(), UpdateInterrupterTarget(), and XhciControlRing::WriteTd().
| ULONG XhciTransferRing::m_Cycle |
Producer cycle state
Definition at line 192 of file xferring.h.
Referenced by _IRQL_requires_(), BuildLinkTrb(), DequeuePointerValue(), InitializeRing(), and XhciControlRing::WriteTd().
| XhciUsbDevice* XhciTransferRing::m_Device |
Definition at line 171 of file xferring.h.
Referenced by _IRQL_requires_(), XhciControlRing::OnEventDataEvent(), ReferenceLiveRing(), and RingDoorbell().
| BOOLEAN XhciTransferRing::m_DoorbellRung |
Since the last ResumeRingFill
Definition at line 180 of file xferring.h.
Referenced by XhciControlRing::WriteTd().
| LIST_ENTRY XhciTransferRing::m_DoubleBuffers |
Definition at line 194 of file xferring.h.
Referenced by _IRQL_requires_(), BorrowBounceBuffer(), Cleanup(), and ReturnBounceBuffer().
| ULONG XhciTransferRing::m_DoubleBufferSize |
Definition at line 184 of file xferring.h.
Referenced by _IRQL_requires_(), and BorrowBounceBuffer().
| XhciEndpoint* XhciTransferRing::m_Endpoint |
Definition at line 172 of file xferring.h.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), XhciControlRing::Abort(), XhciControlRing::BuildControlTd(), ChangeMapState(), Cleanup(), EnsureFreeSegments(), XhciControlRing::OnEventDataEvent(), XhciControlRing::OnTrbEvent(), PacketCount(), ReferenceLiveRing(), RingDoorbell(), TakeSegments(), TdSize(), and XhciControlRing::WriteTd().
| ULONG XhciTransferRing::m_EnqueueIndex |
Definition at line 190 of file xferring.h.
Referenced by EnqueuePointer(), InitializeRing(), XhciControlRing::InitTransfer(), and XhciControlRing::WriteTd().
Definition at line 227 of file xferring.h.
Referenced by DereferenceLive(), and RetireLive().
| BOOLEAN XhciTransferRing::m_ForwardProgressQueue |
Definition at line 231 of file xferring.h.
| LIST_ENTRY XhciTransferRing::m_FreeSegments |
Definition at line 193 of file xferring.h.
Referenced by _IRQL_requires_(), Cleanup(), EnsureFreeSegments(), ReturnSegments(), and TakeSegments().
| WDFWORKITEM XhciTransferRing::m_GrowthItem |
Definition at line 233 of file xferring.h.
Referenced by _IRQL_requires_(), and EnsureFreeSegments().
| BOOLEAN XhciTransferRing::m_GrowthQueued |
Definition at line 230 of file xferring.h.
Referenced by EnsureFreeSegments().
| ULONG XhciTransferRing::m_GrowthWanted |
Definition at line 232 of file xferring.h.
Referenced by EnsureFreeSegments().
| ULONG XhciTransferRing::m_InterrupterTarget |
Definition at line 179 of file xferring.h.
Referenced by BuildLinkTrb(), UpdateInterrupterTarget(), and XhciControlRing::WriteTd().
| ULONG XhciTransferRing::m_LastIndex |
Segment size / 16 - 1
Definition at line 191 of file xferring.h.
Referenced by _IRQL_requires_(), InitializeRing(), XhciControlRing::LocateTrb(), and XhciControlRing::WriteTd().
| BOOLEAN XhciTransferRing::m_Live |
Definition at line 228 of file xferring.h.
Referenced by MakeLive(), and RetireLive().
| LIST_ENTRY XhciTransferRing::m_LiveLink |
Definition at line 226 of file xferring.h.
Referenced by _IRQL_requires_(), MakeLive(), ReferenceLiveRing(), and RetireLive().
| KSPIN_LOCK XhciTransferRing::m_Lock |
Guards the segment fields, pools and type state
Definition at line 177 of file xferring.h.
Referenced by _IRQL_requires_(), XhciControlRing::Abort(), BorrowBounceBuffer(), XhciControlRing::BuildControlTd(), Cleanup(), EnsureFreeSegments(), XhciControlRing::OnEventDataEvent(), XhciControlRing::OnTrbEvent(), ReturnBounceBuffer(), TakeSegments(), and XhciControlRing::WriteTd().
| ULONG XhciTransferRing::m_MapRegisterCount |
Definition at line 186 of file xferring.h.
Referenced by _IRQL_requires_().
XhciMapState
Definition at line 178 of file xferring.h.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), and ChangeMapState().
| ULONG XhciTransferRing::m_MaxStageSize |
Definition at line 185 of file xferring.h.
Referenced by _IRQL_requires_(), and XhciControlRing::PrepareTransfer().
| WDFQUEUE XhciTransferRing::m_Queue |
Definition at line 175 of file xferring.h.
Referenced by _IRQL_requires_(), and Queue().
| PMDL XhciTransferRing::m_ReservedMdl |
Definition at line 181 of file xferring.h.
Referenced by Cleanup(), XhciControlRing::PrepareTransfer(), and XhciControlRing::ReleaseResources().
| XhciDmaBuffer* XhciTransferRing::m_Segment |
Current segment
Definition at line 188 of file xferring.h.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), Cleanup(), InitializeRing(), and SegmentBase().
| ULONG XhciTransferRing::m_SegmentSize |
Definition at line 183 of file xferring.h.
Referenced by _IRQL_requires_(), EnsureFreeSegments(), and InitializeRing().
| ULONG XhciTransferRing::m_StreamId |
Definition at line 173 of file xferring.h.
Referenced by _IRQL_requires_(), _IRQL_requires_max_(), Cleanup(), DequeuePointerValue(), EnsureFreeSegments(), ReferenceLiveRing(), RingDoorbell(), and TakeSegments().
| ULONG XhciTransferRing::m_TransferType |
bmAttributes & 3
Definition at line 174 of file xferring.h.
Referenced by _IRQL_requires_(), IsBulkOrInterrupt(), IsControl(), IsIsoch(), and OnUntargetedTransferEvent().
| PXHCI_TRB XhciTransferRing::m_Trbs |
Definition at line 189 of file xferring.h.
Referenced by _IRQL_requires_(), Cleanup(), InitializeRing(), XhciControlRing::LocateTrb(), and XhciControlRing::WriteTd().
| union { ... } XhciTransferRing::m_Type |
| BOOLEAN XhciTransferRing::m_TypeReady |
Definition at line 229 of file xferring.h.
Referenced by _IRQL_requires_(), and Cleanup().