ReactOS  0.4.15-dev-3324-gda4e15f
FxDmaEnabler Class Reference

#include <fxdmaenabler.hpp>

Inheritance diagram for FxDmaEnabler:
Collaboration diagram for FxDmaEnabler:

Public Member Functions

 FxDmaEnabler (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 ~FxDmaEnabler ()
 
virtual BOOLEAN Dispose (VOID)
 
_Must_inspect_result_ NTSTATUS Initialize (__in PWDF_DMA_ENABLER_CONFIG Config, __inout FxDeviceBase *Device)
 
_Must_inspect_result_ NTSTATUS ConfigureSystemAdapter (__in PWDF_DMA_SYSTEM_PROFILE_CONFIG Config, __in WDF_DMA_DIRECTION ConfigDirection)
 
VOID AllocateCommonBuffer (__in size_t Length, __deref_out_opt PVOID *BufferVA, __out PHYSICAL_ADDRESS *BufferPA)
 
VOID FreeCommonBuffer (__in size_t Length, __in PVOID BufferVA, __in PHYSICAL_ADDRESS BufferPA)
 
_Must_inspect_result_ NTSTATUS PowerUp (VOID)
 
_Must_inspect_result_ NTSTATUS PowerDown (VOID)
 
VOID RevokeResources (VOID)
 
VOID InitializeTransferContext (__out PVOID Context, __in WDF_DMA_DIRECTION Direction)
 
__inline size_t GetMaximumLength (VOID)
 
__inline size_t GetAlignment (VOID)
 
__inline WDFDMAENABLER GetHandle (VOID)
 
__inline WDFDEVICE GetDeviceHandle (VOID)
 
__inline size_t GetMaxSGElements (VOID)
 
__inline VOID SetMaxSGElements (__in size_t MaximumSGElements)
 
__inline WDF_DMA_PROFILE GetProfile (VOID)
 
__inline BOOLEAN SupportsChainedMdls (VOID)
 
__inline BOOLEAN IsBusMaster (VOID)
 
__inline BOOLEAN IsPacketBased ()
 
__inline FxDmaDescriptionGetDmaDescription (__in WDF_DMA_DIRECTION Direction)
 
__inline FxDmaDescriptionGetWriteDmaDescription (VOID)
 
__inline FxDmaDescriptionGetReadDmaDescription (VOID)
 
BOOLEAN UsesDmaV3 (VOID)
 
USHORT GetTransferContextSize (VOID)
 
- Public Member Functions inherited from FxNonPagedObject
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
virtual ~FxNonPagedObject (VOID)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL PreviousIrql)
 
 _Releases_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Unlock(__in __drv_restoresIRQL KIRQL PreviousIrql)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID LockAtDispatch(VOID)
 
 _Requires_lock_held_ (this->m_NPLock.m_Lock) _Releases_lock_(this -> m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID UnlockFromDispatch(VOID)
 
- Public Member Functions inherited from FxObject
PVOID GetCOMWrapper ()
 
void SetCOMWrapper (__drv_aliasesMem PVOID Wrapper)
 
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxObject (VOID)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType Type)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize=0)
 
VOID operator delete (__in PVOID Memory)
 
VOID SetNoContextHeader (VOID)
 
PVOID __inline GetObjectHandle (VOID)
 
__inline FxContextHeaderGetContextHeader (VOID)
 
__inline PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
WDFTYPE GetType (VOID)
 
USHORT GetObjectSize (VOID)
 
LONG GetRefCnt (VOID)
 
FxTagTrackerGetTagTracker (VOID)
 
CfxDeviceGetDevice (VOID)
 
CfxDeviceBaseGetDeviceBase (VOID)
 
VOID SetDeviceBase (__in CfxDeviceBase *DeviceBase)
 
__inline VOID CallCleanup (VOID)
 
ULONG __inline AddRef (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG Release (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG AddRefOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG ReleaseOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual _Must_inspect_result_ NTSTATUS QueryInterface (__in FxQueryInterfaceParams *Params)
 
VOID MarkTraceState (VOID)
 
BOOLEAN __inline IsTraceState (VOID)
 
VOID __inline TraceDroppedEvent (__in FxObjectDroppedEvent Event)
 
VOID MarkPassiveDispose (__in FxObjectLockState State=ObjectLock)
 
VOID MarkPassiveCallbacks (__in FxObjectLockState State=ObjectLock)
 
VOID MarkForceDisposeThread (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsPassiveCallbacks (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsPassiveDispose (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsForceDisposeThread (__in BOOLEAN AcquireLock=TRUE)
 
VOID MarkCommitted (VOID)
 
BOOLEAN IsCommitted (VOID)
 
VOID MarkDisposeOverride (__in FxObjectLockState State=ObjectLock)
 
VOID MarkNoDeleteDDI (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsNoDeleteDDI (VOID)
 
_Must_inspect_result_ NTSTATUS Commit (__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
 
VOID DeleteFromFailedCreate (VOID)
 
VOID ClearEvtCallbacks (VOID)
 
BOOLEAN EarlyDispose (VOID)
 
virtual VOID DeleteObject (VOID)
 
_Must_inspect_result_ NTSTATUS AssignParentObject (__in FxObject *ParentObject)
 
_Must_inspect_result_ NTSTATUS AddContext (__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
 
_Must_inspect_result_ NTSTATUS RemoveParentAssignment (VOID)
 
_Must_inspect_result_ FxObjectGetParentObjectReferenced (__in PVOID Tag)
 
BOOLEAN IsDisposed (VOID)
 

Public Attributes

FxTransactionedEntry m_TransactionLink
 
FxDmaDescription m_SimplexAdapterInfo
 
FxDmaDescription m_DuplexAdapterInfo [FxDuplexDmaDescriptionTypeMax]
 
NPAGED_LOOKASIDE_LIST Lookaside
 
struct {
   NPAGED_LOOKASIDE_LIST   Lookaside
 
ScatterGatherProfile
 
PSCATTER_GATHER_LIST List
 
struct {
   PSCATTER_GATHER_LIST   List
 
SystemProfile
 

Protected Attributes

PDEVICE_OBJECT m_FDO
 
PDEVICE_OBJECT m_PDO
 
union {
   FxDmaDescription   m_SimplexAdapterInfo
 
   FxDmaDescription   m_DuplexAdapterInfo [FxDuplexDmaDescriptionTypeMax]
 
}; 
 
WDF_DMA_PROFILE m_Profile
 
BOOLEAN m_IsAdded: 1
 
BOOLEAN m_IsConfigured: 1
 
BOOLEAN m_IsBusMaster: 1
 
BOOLEAN m_IsScatterGather: 1
 
BOOLEAN m_IsDuplexTransfer: 1
 
BOOLEAN m_IsSGListAllocated: 1
 
ULONG m_CommonBufferAlignment
 
ULONG m_MaximumLength
 
ULONG m_MaxSGElements
 
size_t m_SGListSize
 
union {
   struct {
      NPAGED_LOOKASIDE_LIST   Lookaside
 
   }   ScatterGatherProfile
 
   struct {
      PSCATTER_GATHER_LIST   List
 
   }   SystemProfile
 
m_SGList
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 

Private Member Functions

_Must_inspect_result_ NTSTATUS ConfigureBusMasterAdapters (__in PDEVICE_DESCRIPTION DeviceDescription, __in PWDF_DMA_ENABLER_CONFIG Config)
 
_Must_inspect_result_ NTSTATUS ConfigureDmaAdapter (__in PDEVICE_DESCRIPTION DeviceDescription, __in WDF_DMA_DIRECTION ConfigDirection)
 
_Must_inspect_result_ NTSTATUS InitializeResources (__inout FxDmaDescription *AdapterInfo)
 
VOID ReleaseResources (VOID)
 
VOID FreeResources (__inout FxDmaDescription *AdapterInfo)
 

Private Attributes

FxEvtDmaEnablerFillCallback m_EvtDmaEnablerFill
 
FxEvtDmaEnablerFlushCallback m_EvtDmaEnablerFlush
 
FxEvtDmaEnablerEnableCallback m_EvtDmaEnablerEnable
 
FxEvtDmaEnablerDisableCallback m_EvtDmaEnablerDisable
 
FxEvtDmaEnablerSelfManagedIoStartCallback m_EvtDmaEnablerSelfManagedIoStart
 
FxEvtDmaEnablerSelfManagedIoStopCallback m_EvtDmaEnablerSelfManagedIoStop
 
BOOLEAN m_DmaEnablerFillFailed
 
BOOLEAN m_DmaEnablerEnableFailed
 
BOOLEAN m_DmaEnablerSelfManagedIoStartFailed
 

Friends

class FxDmaTransactionBase
 
class FxDmaPacketTransaction
 
class FxDmaScatterGatherTransaction
 
class FxDmaSystemTransaction
 

Additional Inherited Members

- Static Public Member Functions inherited from FxObject
static FxObject_FromDisposeEntry (__in PSINGLE_LIST_ENTRY Entry)
 
static FxObject_GetObjectFromHandle (__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
 
static PVOID __inline _ToHandle (__in FxObject *Object)
 
static VOID __inline _ReferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static VOID __inline _DereferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static PVOID _GetDebugBase (__in FxObject *Object)
 
static PFX_POOL_HEADER _CleanupPointer (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
 
static _Must_inspect_result_ NTSTATUS _GetEffectiveLock (__in FxObject *Object, __in_opt IFxHasCallbacks *Callbacks, __in BOOLEAN AutomaticLocking, __in BOOLEAN PassiveCallbacks, __out FxCallbackLock **CallbackLock, __out_opt FxObject **CallbackLockObject)
 
static _Must_inspect_result_ NTSTATUS _ObjectQuery (_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
 
- Protected Member Functions inherited from FxObject
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
FxObjectDebugExtensionGetDebugExtension (VOID)
 
BOOLEAN IsDebug (VOID)
 
VOID AllocateTagTracker (__in WDFTYPE Type)
 
virtual VOID SelfDestruct (VOID)
 
PVOID __inline GetObjectHandleUnchecked (VOID)
 
VOID __inline DestroyChildren (VOID)
 
VOID DeleteEarlyDisposedObject (VOID)
 
- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 

Detailed Description

Definition at line 66 of file fxdmaenabler.hpp.

Constructor & Destructor Documentation

◆ FxDmaEnabler()

FxDmaEnabler::FxDmaEnabler ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 30 of file fxdmaenabler.cpp.

32  :
33  FxNonPagedObject(FX_TYPE_DMA_ENABLER, sizeof(FxDmaEnabler), FxDriverGlobals)
34 {
37 
38  //
39  // Transaction link into list of FxDmaEnabler pointers maintained by
40  // FxDevice's pnp package.
41  //
43 
44  m_FDO = NULL;
45  m_PDO = NULL;
51  m_SGListSize = 0;
52 
53  m_IsAdded = FALSE;
54 
61 
65 
66  RtlZeroMemory(&m_SGList, sizeof(m_SGList));
67 
69 }
FxNonPagedObject(__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
FxTransactionedEntry m_TransactionLink
BOOLEAN m_DmaEnablerFillFailed
ULONG m_MaxSGElements
#define WDF_DMA_ENABLER_UNLIMITED_FRAGMENTS
FxEvtDmaEnablerSelfManagedIoStopCallback m_EvtDmaEnablerSelfManagedIoStop
BOOLEAN m_IsScatterGather
VOID SetTransactionedObject(__in FxObject *Object)
FxEvtDmaEnablerEnableCallback m_EvtDmaEnablerEnable
BOOLEAN m_IsSGListAllocated
ULONG m_CommonBufferAlignment
union FxDmaEnabler::@4584 m_SGList
FxEvtDmaEnablerFillCallback m_EvtDmaEnablerFill
#define FALSE
Definition: types.h:117
PDEVICE_OBJECT m_PDO
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
Definition: fxobject.hpp:1101
PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_START m_Method
PDEVICE_OBJECT m_FDO
BOOLEAN m_DmaEnablerEnableFailed
BOOLEAN m_DmaEnablerSelfManagedIoStartFailed
size_t m_SGListSize
FxEvtDmaEnablerSelfManagedIoStartCallback m_EvtDmaEnablerSelfManagedIoStart
FxEvtDmaEnablerDisableCallback m_EvtDmaEnablerDisable
PFN_WDF_DMA_ENABLER_FLUSH m_Method
PFN_WDF_DMA_ENABLER_DISABLE m_Method
PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_STOP m_Method
FxEvtDmaEnablerFlushCallback m_EvtDmaEnablerFlush
BOOLEAN m_IsAdded
PFN_WDF_DMA_ENABLER_ENABLE m_Method
FxDmaDescription m_DuplexAdapterInfo[FxDuplexDmaDescriptionTypeMax]
#define NULL
Definition: types.h:112
BOOLEAN m_IsDuplexTransfer
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
FxDmaDescription m_SimplexAdapterInfo
PFN_WDF_DMA_ENABLER_FILL m_Method

◆ ~FxDmaEnabler()

FxDmaEnabler::~FxDmaEnabler ( )

Definition at line 71 of file fxdmaenabler.cpp.

72 {
73  if (m_IsSGListAllocated) {
74  if (m_IsScatterGather) {
75  //
76  // Scatter Gather profile - cleanup the lookaside list
77  //
78  ExDeleteNPagedLookasideList(&m_SGList.ScatterGatherProfile.Lookaside);
79 
80  } else if (!m_IsBusMaster) {
81  //
82  // System profile (not busmastering) - cleanup the preallocated
83  // SG list
84  //
85  ExFreePool(m_SGList.SystemProfile.List);
86 
87  } else {
88  //
89  // Packet profile. No special cleanup to do.
90  //
91 
92  }
93 
94 #if DBG
95  RtlZeroMemory(&m_SGList, sizeof(m_SGList));
96 #endif
98  }
99 }
BOOLEAN m_IsScatterGather
BOOLEAN m_IsSGListAllocated
union FxDmaEnabler::@4584 m_SGList
#define FALSE
Definition: types.h:117
BOOLEAN m_IsBusMaster
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Member Function Documentation

◆ AllocateCommonBuffer()

VOID FxDmaEnabler::AllocateCommonBuffer ( __in size_t  Length,
__deref_out_opt PVOID BufferVA,
__out PHYSICAL_ADDRESS BufferPA 
)

Definition at line 1053 of file fxdmaenabler.cpp.

1058 {
1059  ULONG result;
1060  PDMA_ADAPTER adapterObject;
1062 
1063  *BufferVA = NULL;
1064  BufferPA->QuadPart = 0;
1065 
1068  "WDFDMAENABLER %p AllocateCommonBuffer: could cast value %I64d to a "
1069  "ULONG", GetHandle(), Length);
1071  return;
1072  }
1073 
1074  //
1075  // It doesn't matter which channel we use for allocating common buffers
1076  // because the addressing capability of all the channels of this DMA enablers
1077  // are same.
1078  //
1079  adapterObject = GetReadDmaDescription()->AdapterObject;
1080 
1081  *BufferVA = adapterObject->DmaOperations->
1082  AllocateCommonBuffer( adapterObject,
1083  result,
1084  BufferPA,
1085  TRUE /* CacheEnabled */ );
1086 }
__inline FxDmaDescription * GetReadDmaDescription(VOID)
#define RtlSizeTToULong
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
GLuint64EXT * result
Definition: glext.h:11304
#define TRUE
Definition: types.h:120
struct _DMA_OPERATIONS * DmaOperations
Definition: iotypes.h:2295
#define TRACINGDMA
Definition: dbgtrace.h:71
__inline WDFDMAENABLER GetHandle(VOID)
VOID AllocateCommonBuffer(__in size_t Length, __deref_out_opt PVOID *BufferVA, __out PHYSICAL_ADDRESS *BufferPA)
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
PDMA_ADAPTER AdapterObject
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
FxVerifierDbgBreakPoint(pFxDriverGlobals)

Referenced by FxCommonBuffer::AllocateCommonBuffer().

◆ ConfigureBusMasterAdapters()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::ConfigureBusMasterAdapters ( __in PDEVICE_DESCRIPTION  DeviceDescription,
__in PWDF_DMA_ENABLER_CONFIG  Config 
)
private

Definition at line 606 of file fxdmaenabler.cpp.

610 {
611  ULONG alignment;
613 
614  //
615  // Initialize map register management
616  //
617  DeviceDescription->MaximumLength = m_MaximumLength;
618 
619  if (m_IsDuplexTransfer) {
622 
623  if (!NT_SUCCESS(status)) {
624  goto End;
625  }
626 
629  } else {
630  //
631  // Direction is ignored in this case.
632  //
633 
636  }
637 
638  if (!NT_SUCCESS(status)) {
639  goto End;
640  }
641 
642  //
643  // Allocate a scatter gather lookaside list if we need one.
644  //
645 
646  if (m_IsScatterGather) {
647  size_t sgLookasideListSize;
648 
649  sgLookasideListSize = 0;
650 
651  if (m_IsDuplexTransfer) {
652  FxDmaDescription *readDmaDesc = GetReadDmaDescription();
653  FxDmaDescription *writeDmaDesc = GetWriteDmaDescription();
654 
655  alignment = readDmaDesc->AdapterObject->DmaOperations->
656  GetDmaAlignment(readDmaDesc->AdapterObject);
657 
658  //
659  // GetDmaAlignment returns alignment in terms of bytes
660  // while we treat alignment as a mask (which is how it is set
661  // in _DEVICE_OBJECT as well.
662  // For example, for byte alignment GetDmaAlignment returns 1 while
663  // the alignment mask is 0x00000000
664  //
665  // For < 1.11 drivers we keep the same behaviour as before for
666  // compatibility.
667  //
668  if (GetDriverGlobals()->IsVersionGreaterThanOrEqualTo(1, 11) &&
669  alignment > 0) {
670  alignment -= 1;
671  }
672 
674  alignment);
675 
676  //
677  // We will create a lookaside list based on the larger of the read &
678  // write SGListSize. It's done this way so that we can allocate
679  // sglist buffer when the dma-transaction object is created, where
680  // we don't know the direction of DMA transfer, and make the
681  // transaction initialize call fail-proof.
682  //
683  sgLookasideListSize = FxSizeTMax(
684  readDmaDesc->PreallocatedSGListSize,
685  writeDmaDesc->PreallocatedSGListSize
686  );
687  } else {
688 
689  FxDmaDescription *simplexDmaDesc = &m_SimplexAdapterInfo;
690 
691  alignment = simplexDmaDesc->AdapterObject->DmaOperations->
692  GetDmaAlignment(simplexDmaDesc->AdapterObject);
693 
694  //
695  // GetDmaAlignment returns alignment in terms of bytes
696  // while we treat alignment as a mask (which is how it is set
697  // in _DEVICE_OBJECT as well.
698  // For example, for byte alignment GetDmaAlignment returns 1 while
699  // the alignment mask is 0x00000000
700  //
701  // For < 1.11 drivers we keep the same behaviour as before for
702  // compatibility.
703  //
704  if (GetDriverGlobals()->IsVersionGreaterThanOrEqualTo(1, 11) &&
705  alignment > 0) {
706  alignment -= 1;
707  }
708 
710  alignment);
711 
712  sgLookasideListSize = simplexDmaDesc->PreallocatedSGListSize;
713  }
714 
715  //
716  // Initialize a LookasideList for ScatterGather list
717  //
720 
721  m_SGListSize = sgLookasideListSize;
722 
723  ExInitializeNPagedLookasideList( &m_SGList.ScatterGatherProfile.Lookaside,
724  NULL, // Allocate OPTIONAL
725  NULL, // Free OPTIONAL
726  0, // Flag - Reserved. Must be zero.
727  m_SGListSize,
729  0 ); // Depth - Reserved. Must be zero.
730 
732  }
733  }
734 
735  //
736  // The DMA enabler is configured now.
737  //
738 
740 
741 End:
742 
743  return status;
744 }
__inline FxDmaDescription * GetReadDmaDescription(VOID)
#define TRUE
Definition: types.h:120
BOOLEAN m_IsConfigured
LONG NTSTATUS
Definition: precomp.h:26
size_t PreallocatedSGListSize
BOOLEAN m_IsScatterGather
struct _DMA_OPERATIONS * DmaOperations
Definition: iotypes.h:2295
BOOLEAN m_IsSGListAllocated
ULONG m_CommonBufferAlignment
union FxDmaEnabler::@4584 m_SGList
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:430
#define FALSE
Definition: types.h:117
PDEVICE_OBJECT m_FDO
__inline size_t FxSizeTMax(__in size_t A, __in size_t B)
Definition: fxglobals.h:987
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
#define ASSERT(a)
Definition: mode.c:44
size_t m_SGListSize
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ULONG m_MaximumLength
__inline FxDmaDescription * GetWriteDmaDescription(VOID)
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
ULONG AlignmentRequirement
Definition: env_spec_w32.h:420
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
PDMA_ADAPTER AdapterObject
_Must_inspect_result_ NTSTATUS ConfigureDmaAdapter(__in PDEVICE_DESCRIPTION DeviceDescription, __in WDF_DMA_DIRECTION ConfigDirection)
#define NULL
Definition: types.h:112
BOOLEAN m_IsDuplexTransfer
unsigned int ULONG
Definition: retypes.h:1
static SERVICE_STATUS status
Definition: service.c:31
FxDmaDescription m_SimplexAdapterInfo
Definition: ps.c:97

Referenced by Initialize().

◆ ConfigureDmaAdapter()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::ConfigureDmaAdapter ( __in PDEVICE_DESCRIPTION  DeviceDescription,
__in WDF_DMA_DIRECTION  ConfigDirection 
)
private

Definition at line 748 of file fxdmaenabler.cpp.

752 {
753  FxDmaDescription *dmaDesc;
755 
756  //
757  // Select the adapter to configure.
758  //
759 
761 
762  //
763  // Copy the device-description we have built up so far
764  // into the read and write dma description field. These
765  // settings are common to both channels.
766  //
769  sizeof(DEVICE_DESCRIPTION));
770 
771  //
772  // Then initialize resources that are private to read and write.
773  //
774 
775  status = InitializeResources(dmaDesc);
776  return status;
777 }
__inline FxDmaDescription * GetDmaDescription(__in WDF_DMA_DIRECTION Direction)
_Must_inspect_result_ NTSTATUS InitializeResources(__inout FxDmaDescription *AdapterInfo)
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:430
DEVICE_DESCRIPTION DeviceDescription
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ PWDF_DMA_SYSTEM_PROFILE_CONFIG _In_ WDF_DMA_DIRECTION ConfigDirection
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by ConfigureBusMasterAdapters(), and ConfigureSystemAdapter().

◆ ConfigureSystemAdapter()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::ConfigureSystemAdapter ( __in PWDF_DMA_SYSTEM_PROFILE_CONFIG  Config,
__in WDF_DMA_DIRECTION  ConfigDirection 
)

Definition at line 481 of file fxdmaenabler.cpp.

485 {
486  DEVICE_DESCRIPTION deviceDescription;
487 
489 
490  //
491  // Check to make sure this direction isn't currently configured.
492  //
493  if (GetDmaDescription(ConfigDirection)->AdapterObject != NULL) {
495 
497  "WDFDMAENABLER %p, profile %!WDF_DMA_PROFILE! "
498  "Enabler has already been configured for %!WDF_DMA_DIRECTION!, %!STATUS!",
499  GetHandle(), m_Profile,
501  status
502  );
503 
505 
506  return status;
507  }
508 
509  //
510  // Initialize the adapter info from scratch given the Config structure
511  // then copy it to the appropriate channel and do the allocation.
512  //
513  RtlZeroMemory(&deviceDescription, sizeof(DEVICE_DESCRIPTION));
514 
515  deviceDescription.Version = DEVICE_DESCRIPTION_VERSION3;
516  deviceDescription.MaximumLength = m_MaximumLength;
517 
518  deviceDescription.DemandMode = Config->DemandMode;
519  deviceDescription.AutoInitialize = Config->LoopedTransfer;
520 
521  deviceDescription.DmaWidth = Config->DmaWidth;
522 
523  deviceDescription.DeviceAddress = Config->DeviceAddress;
524 
525  //
526  // Pull the remainder of the description from the provided resource.
527  //
528  deviceDescription.InterfaceType = Internal;
529  deviceDescription.DmaChannel = Config->DmaDescriptor->u.Dma.Channel;
530  deviceDescription.DmaRequestLine = Config->DmaDescriptor->u.Dma.Port;
531 
532 
533  //
534  // Run the common adapter configuration.
535  //
537  &deviceDescription,
539  );
540 
541  if (!NT_SUCCESS(status)) {
542  goto End;
543  }
544 
545  //
546  // Allocate a single SGList to pass to MapTransferEx. Since we
547  // only run a single system transfer at a time we can use the same
548  // list for each transfer
549  //
550 
551  {
552  size_t systemSGListSize = 0;
553 
554  if (m_IsDuplexTransfer) {
555 
556  systemSGListSize = max(GetReadDmaDescription()->PreallocatedSGListSize,
557  GetWriteDmaDescription()->PreallocatedSGListSize);
558  } else {
559 
560  systemSGListSize = m_SimplexAdapterInfo.PreallocatedSGListSize;
561  }
562 
563  //
564  // Allocate the SG list.
565  //
566  m_SGList.SystemProfile.List =
568  systemSGListSize,
569  GetDriverGlobals()->Tag);
570 
571  if (m_SGList.SystemProfile.List == NULL) {
575  "Unable to allocate scatter gather list for system DMA "
576  "enabler %p, %!STATUS!",
577  GetHandle(), status
578  );
579  goto End;
580  }
581 
583  m_SGListSize = systemSGListSize;
584  }
585 
586  //
587  // For a simple enabler, both of these calls will return the same
588  // DMA description entry.
589  //
590  if ((GetDmaDescription(
592  )->AdapterObject != NULL) &&
595  )->AdapterObject != NULL)) {
597  }
598 
599 End:
600 
601  return status;
602 }
__inline FxDmaDescription * GetReadDmaDescription(VOID)
__inline FxDmaDescription * GetDmaDescription(__in WDF_DMA_DIRECTION Direction)
#define max(a, b)
Definition: svc.c:63
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
BOOLEAN m_IsConfigured
LONG NTSTATUS
Definition: precomp.h:26
size_t PreallocatedSGListSize
WDF_DMA_PROFILE m_Profile
#define DEVICE_DESCRIPTION_VERSION3
Definition: iotypes.h:2066
BOOLEAN m_IsSGListAllocated
union FxDmaEnabler::@4584 m_SGList
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACINGDMA
Definition: dbgtrace.h:71
__inline WDFDMAENABLER GetHandle(VOID)
size_t m_SGListSize
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOLEAN DemandMode
Definition: iotypes.h:2072
ULONG m_MaximumLength
__inline FxDmaDescription * GetWriteDmaDescription(VOID)
PHYSICAL_ADDRESS DeviceAddress
Definition: iotypes.h:2089
DMA_WIDTH DmaWidth
Definition: iotypes.h:2081
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ PWDF_DMA_SYSTEM_PROFILE_CONFIG _In_ WDF_DMA_DIRECTION ConfigDirection
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
_Must_inspect_result_ NTSTATUS ConfigureDmaAdapter(__in PDEVICE_DESCRIPTION DeviceDescription, __in WDF_DMA_DIRECTION ConfigDirection)
#define NULL
Definition: types.h:112
BOOLEAN m_IsDuplexTransfer
INTERFACE_TYPE InterfaceType
Definition: iotypes.h:2080
struct _SCATTER_GATHER_LIST * PSCATTER_GATHER_LIST
Definition: iotypes.h:2204
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
static SERVICE_STATUS status
Definition: service.c:31
FxVerifierDbgBreakPoint(pFxDriverGlobals)
BOOLEAN AutoInitialize
Definition: iotypes.h:2073
FxDmaDescription m_SimplexAdapterInfo
Definition: ps.c:97

◆ Dispose()

BOOLEAN FxDmaEnabler::Dispose ( VOID  )
virtual

Reimplemented from FxObject.

Definition at line 103 of file fxdmaenabler.cpp.

104 {
106 
107  if (m_IsAdded) {
110  }
111 
112  return TRUE;
113 }
virtual VOID RemoveDmaEnabler(__inout FxDmaEnabler *Enabler)
Definition: fxdevice.hpp:329
#define TRUE
Definition: types.h:120
VOID ReleaseResources(VOID)
#define ASSERT(a)
Definition: mode.c:44
CfxDeviceBase * m_DeviceBase
Definition: fxobject.hpp:328
BOOLEAN m_IsAdded
#define NULL
Definition: types.h:112

◆ FreeCommonBuffer()

VOID FxDmaEnabler::FreeCommonBuffer ( __in size_t  Length,
__in PVOID  BufferVA,
__in PHYSICAL_ADDRESS  BufferPA 
)

Definition at line 1090 of file fxdmaenabler.cpp.

1095 {
1096  PDMA_ADAPTER adapterObject;
1097 
1098  adapterObject = GetReadDmaDescription()->AdapterObject;
1099 
1100  adapterObject->DmaOperations->
1101  FreeCommonBuffer( adapterObject,
1102  (ULONG) Length,
1103  BufferPA,
1104  BufferVA,
1105  TRUE /* CacheEnabled */ );
1106 }
__inline FxDmaDescription * GetReadDmaDescription(VOID)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define TRUE
Definition: types.h:120
struct _DMA_OPERATIONS * DmaOperations
Definition: iotypes.h:2295
VOID FreeCommonBuffer(__in size_t Length, __in PVOID BufferVA, __in PHYSICAL_ADDRESS BufferPA)
PDMA_ADAPTER AdapterObject
unsigned int ULONG
Definition: retypes.h:1

Referenced by FxCommonBuffer::FreeCommonBuffer().

◆ FreeResources()

VOID FxDmaEnabler::FreeResources ( __inout FxDmaDescription AdapterInfo)
private

Definition at line 882 of file fxdmaenabler.cpp.

885 {
886  if (AdapterInfo->AdapterObject != NULL) {
887  AdapterInfo->AdapterObject->DmaOperations->PutDmaAdapter(AdapterInfo->AdapterObject);
888  AdapterInfo->AdapterObject = NULL;
889  }
890 }
#define NULL
Definition: types.h:112

Referenced by ReleaseResources().

◆ GetAlignment()

__inline size_t FxDmaEnabler::GetAlignment ( VOID  )
inline

Definition at line 153 of file fxdmaenabler.hpp.

156  {
158  }
ULONG m_CommonBufferAlignment

Referenced by FxCommonBuffer::FxCommonBuffer().

◆ GetDeviceHandle()

__inline WDFDEVICE FxDmaEnabler::GetDeviceHandle ( VOID  )
inline

Definition at line 171 of file fxdmaenabler.hpp.

174  {
175 
176  return m_DeviceBase->GetHandle();
177  }
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
CfxDeviceBase * m_DeviceBase
Definition: fxobject.hpp:328

◆ GetDmaDescription()

__inline FxDmaDescription* FxDmaEnabler::GetDmaDescription ( __in WDF_DMA_DIRECTION  Direction)
inline

Definition at line 245 of file fxdmaenabler.hpp.

248  {
249  if (m_IsDuplexTransfer) {
251  }
252  else {
253  return &m_SimplexAdapterInfo;
254  }
255  }
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
FxDmaDescription m_DuplexAdapterInfo[FxDuplexDmaDescriptionTypeMax]
BOOLEAN m_IsDuplexTransfer
FxDmaDescription m_SimplexAdapterInfo

Referenced by ConfigureDmaAdapter(), ConfigureSystemAdapter(), InitializeTransferContext(), and UsesDmaV3().

◆ GetHandle()

__inline WDFDMAENABLER FxDmaEnabler::GetHandle ( VOID  )
inline

Definition at line 162 of file fxdmaenabler.hpp.

165  {
166  return (WDFDMAENABLER) GetObjectHandle();
167  }
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603

Referenced by AllocateCommonBuffer(), ConfigureSystemAdapter(), if(), InitializeResources(), PowerDown(), PowerUp(), and FxDmaPacketTransaction::StartTransfer().

◆ GetMaximumLength()

__inline size_t FxDmaEnabler::GetMaximumLength ( VOID  )
inline

Definition at line 140 of file fxdmaenabler.hpp.

143  {
144  //
145  // This value is same for all the channels and equal to the value
146  // provided in the DMA_ENABLER_CONFIG.
147  //
149  }
__inline FxDmaDescription * GetReadDmaDescription(VOID)
DEVICE_DESCRIPTION DeviceDescription

◆ GetMaxSGElements()

__inline size_t FxDmaEnabler::GetMaxSGElements ( VOID  )
inline

Definition at line 181 of file fxdmaenabler.hpp.

184  {
185  return m_MaxSGElements;
186  }
ULONG m_MaxSGElements

Referenced by FxDmaScatterGatherTransaction::_AdapterListControl().

◆ GetProfile()

__inline WDF_DMA_PROFILE FxDmaEnabler::GetProfile ( VOID  )
inline

Definition at line 199 of file fxdmaenabler.hpp.

202  {
203  return m_Profile;
204  }
WDF_DMA_PROFILE m_Profile

◆ GetReadDmaDescription()

__inline FxDmaDescription* FxDmaEnabler::GetReadDmaDescription ( VOID  )
inline

◆ GetTransferContextSize()

USHORT FxDmaEnabler::GetTransferContextSize ( VOID  )
inline

Definition at line 303 of file fxdmaenabler.hpp.

306  {
308  }
BOOLEAN UsesDmaV3(VOID)
#define DMA_TRANSFER_CONTEXT_SIZE_V1
Definition: iotypes.h:2148

◆ GetWriteDmaDescription()

__inline FxDmaDescription* FxDmaEnabler::GetWriteDmaDescription ( VOID  )
inline

Definition at line 260 of file fxdmaenabler.hpp.

263  {
264  if (m_IsDuplexTransfer) {
266  } else {
267  return &m_SimplexAdapterInfo;
268  }
269  }
FxDmaDescription m_DuplexAdapterInfo[FxDuplexDmaDescriptionTypeMax]
BOOLEAN m_IsDuplexTransfer
FxDmaDescription m_SimplexAdapterInfo

Referenced by ConfigureBusMasterAdapters(), ConfigureSystemAdapter(), FxDmaTransactionBase::Initialize(), ReleaseResources(), and FxDmaPacketTransaction::ReserveAdapter().

◆ Initialize()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::Initialize ( __in PWDF_DMA_ENABLER_CONFIG  Config,
__inout FxDeviceBase Device 
)

Definition at line 117 of file fxdmaenabler.cpp.

121 {
123  DEVICE_DESCRIPTION deviceDescription;
125  ULONG mapRegistersAllocated;
126 
127  RtlZeroMemory(&deviceDescription, sizeof(DEVICE_DESCRIPTION));
128 
129  //
130  // Default to version 2 description (except on ARM platforms)
131  //
132 
133 #ifdef _ARM_
134  deviceDescription.Version = DEVICE_DESCRIPTION_VERSION3;
135 #else
136  deviceDescription.Version = DEVICE_DESCRIPTION_VERSION2;
137 #endif
138 
139  //
140  // Make sure the device's list of enablers has been created.
141  //
142 
143  status = Device->AllocateDmaEnablerList();
144  if (!NT_SUCCESS(status)) {
146  "Unable to allocate DmaEnablerList for "
147  "WDFDEVICE %p, %!STATUS!",
148  Device->GetHandle(), status);
149  return status;
150  }
151 
152  //
153  // Retain parent FxDeviceBase object
154  //
156 
157  //
158  // Save the profile.
159  //
160  m_Profile = Config->Profile;
161 
162  //
163  // Invariant parameters vis-a-vis kernel-mode bus-mastering DMA APIs
164  // (overrided below if using system-DMA
165  //
166  deviceDescription.Master = TRUE;
167  deviceDescription.Dma32BitAddresses = TRUE;
168  deviceDescription.InterfaceType = PCIBus;
169 
170  //
171  // Assume enabler is a bus-master
172  //
174 
175  //
176  // Expand the profile into settings.
177  //
178  switch (m_Profile) {
179  //
180  // Packet based profiles.
181  //
182 
183  case WdfDmaProfilePacket:
184  deviceDescription.ScatterGather = FALSE;
185  deviceDescription.Dma64BitAddresses = FALSE;
186  break;
188  deviceDescription.ScatterGather = FALSE;
189  deviceDescription.Dma64BitAddresses = TRUE;
190  break;
191 
192  //
193  // Scatter-gather profiles
194  //
195 
197  deviceDescription.ScatterGather = TRUE;
198  deviceDescription.Dma64BitAddresses = FALSE;
200  break;
202  deviceDescription.ScatterGather = TRUE;
203  deviceDescription.Dma64BitAddresses = FALSE;
206  break;
208  deviceDescription.ScatterGather = TRUE;
209  deviceDescription.Dma64BitAddresses = TRUE;
211  break;
213  deviceDescription.ScatterGather = TRUE;
214  deviceDescription.Dma64BitAddresses = TRUE;
217  break;
218 
219  //
220  // Non-PC System-mode (non-bus-mastering) profiles. These
221  // require DMA v3.
222  //
223 
224  case WdfDmaProfileSystem:
225  deviceDescription.ScatterGather = FALSE;
226  deviceDescription.Master = FALSE;
227  deviceDescription.Dma32BitAddresses = FALSE;
228  deviceDescription.Dma64BitAddresses = FALSE;
229  deviceDescription.Version = DEVICE_DESCRIPTION_VERSION3;
232  break;
234  deviceDescription.ScatterGather = FALSE;
235  deviceDescription.Master = FALSE;
236  deviceDescription.Dma32BitAddresses = FALSE;
237  deviceDescription.Dma64BitAddresses = FALSE;
238  deviceDescription.Version = DEVICE_DESCRIPTION_VERSION3;
242  break;
243 
244  //
245  // Unknown profile.
246  //
247 
248  default:
249  //
250  // Just do quick exit as no resource have been allocated.
251  //
253  }
254 
255  //
256  // Save the maximum length.
257  //
258  m_MaximumLength = (ULONG) Config->MaximumLength;
259 
260  //
261  // An override of address width requires the DMA v3 engine. it also requires
262  // that we explicitly specify the DMA width the controller can support, but
263  // we do that down below.
264  //
265  if (Config->AddressWidthOverride != 0) {
266 
267  //
268  // Address width override is not supported for system mode DMA, since
269  // the HAL runs the DMA controller in that case and it knows the
270  // controller's address limitations better than the driver does.
271  //
272  if (m_IsBusMaster == FALSE) {
276  "AddressWidthOverride set to %d. AddressWidthOverride "
277  "must be zero when using a system DMA profile "
278  "(%!WDF_DMA_PROFILE!) - %!STATUS!",
279  Config->AddressWidthOverride,
280  Config->Profile,
281  status
282  );
284  return status;
285  }
286 
287  if ((deviceDescription.Dma64BitAddresses == FALSE) &&
288  (Config->AddressWidthOverride > 32)) {
292  "AddressWidthOverride set to %d. AddressWidthOverride "
293  "must be <= 32 when using a 32-bit DMA profile "
294  "(%!WDF_DMA_PROFILE!) - %!STATUS!",
295  Config->AddressWidthOverride,
296  Config->Profile,
297  status
298  );
300  return status;
301  }
302 
303  //
304  // Handle the AddressWidthOverride. For Win8 use DMA v3 and pass the
305  // value through to the HAL. For Win7 downgrade to the next lower
306  // address width.
307  //
309  deviceDescription.Version = DEVICE_DESCRIPTION_VERSION3;
310  deviceDescription.DmaAddressWidth = Config->AddressWidthOverride;
311  }
312  else {
313 
314  NT_ASSERTMSGW(L"Ensure driver is not doing something earlier that "
315  L"would require DMA v3 before we downgrade them to "
316  L"DMA v2",
317  (deviceDescription.Version == DEVICE_DESCRIPTION_VERSION2));
318 
319  if (Config->AddressWidthOverride < 64) {
320  deviceDescription.Dma64BitAddresses = FALSE;
321  }
322 
323  if (Config->AddressWidthOverride < 32) {
324  deviceDescription.Dma32BitAddresses = FALSE;
325  }
326 
327  //
328  // DMA V2 can't handle an address width restriction smaller than
329  // 24 bits (ISA DMA). DMA V3 will fail that also - return the same
330  // error here that DMA V3 would have.
331  //
332  if (Config->AddressWidthOverride < 24) {
335  "AddressWidthOverride of less than 24 bits is not supported"
336  );
337  return STATUS_UNSUCCESSFUL;
338  }
339  else if ((Config->AddressWidthOverride != 64) &&
340  (Config->AddressWidthOverride != 32)) {
341 
342  //
343  // Log a warning about downgrading DMA if we are actually
344  // downgrading. if the caller uses a 64-bit DMA
345  // profile with an override of 64, or 32-bit with an override
346  // of 32 then silently let it go through.
347  //
348 
351  "DMA AddressWidthOverride requires Windows version 6.2 or "
352  "higher. Windows cannot support %d bit DMA is falling back to "
353  "the next lower supported width (%d-bit)",
354  Config->AddressWidthOverride,
355  (deviceDescription.Dma32BitAddresses ? 32 : 24)
356  );
357  }
358  }
359  }
360 
361  //
362  // Allow for a specific version override (and fail if
363  // that override is inconsistent with the settings). On Win7 this will
364  // fail when we get the DMA adapter.
365  //
366  if (Config->WdmDmaVersionOverride != 0) {
367 
368  if (Config->WdmDmaVersionOverride < deviceDescription.Version) {
370 
371  //
372  // Driver is asking for a lower version of the DMA engine than the
373  // config settings imply it needs. Fail with invalid parameter.
374  //
375 
377  "WdmDmaVersionOverride set to %d, conflicts with required version of %d, "
378  "%!STATUS!",
379  Config->WdmDmaVersionOverride,
380  deviceDescription.Version,
381  status
382  );
383 
385  return status;
386  }
387 
388  deviceDescription.Version = Config->WdmDmaVersionOverride;
389  }
390 
391  //
392  // Propagate some settings from the old engine's location to the new ones.
393  //
394  if (deviceDescription.Version >= DEVICE_DESCRIPTION_VERSION3) {
395 
396  if (deviceDescription.DmaAddressWidth == 0) {
397 
398  if (deviceDescription.Dma64BitAddresses) {
399  deviceDescription.DmaAddressWidth = 64;
400  } else if (deviceDescription.Dma32BitAddresses) {
401  deviceDescription.DmaAddressWidth = 32;
402  } else {
403  //
404  // Assume ISA access width.
405  //
406 
407  deviceDescription.DmaAddressWidth = 24;
408  }
409  }
410  }
411 
412  //
413  // Get the FDO
414  //
416  ASSERT(m_FDO != NULL);
417 
418  //
419  // Get the PDO. PDO may be NULL in the miniport case, but on
420  // x86 that will still allow for DMA (IoGetDmaAdapter special
421  // cases that on x86). On amd64 the attempt to get the DMA
422  // adapter later will fail cleanly.
423  //
425 
426  mapRegistersAllocated = 0;
427 
428  //
429  // If this device is a bus-master then configure the profile
430  // right now, since we don't need to wait for PrepareHardware
431  // to find out the DMA resource.
432  //
433  if (m_IsBusMaster) {
434  status = ConfigureBusMasterAdapters(&deviceDescription, Config);
435  if (!NT_SUCCESS(status)) {
436  goto End;
437  }
438  }
439 
440  //
441  // Retain the Power event callbacks.
442  //
443  m_EvtDmaEnablerFill.m_Method = Config->EvtDmaEnablerFill;
444  m_EvtDmaEnablerFlush.m_Method = Config->EvtDmaEnablerFlush;
445  m_EvtDmaEnablerEnable.m_Method = Config->EvtDmaEnablerEnable;
446  m_EvtDmaEnablerDisable.m_Method = Config->EvtDmaEnablerDisable;
447  m_EvtDmaEnablerSelfManagedIoStart.m_Method = Config->EvtDmaEnablerSelfManagedIoStart;
448  m_EvtDmaEnablerSelfManagedIoStop.m_Method = Config->EvtDmaEnablerSelfManagedIoStop;
449 
450  //
451  // Add this DmaEnabler to the parent device's list of dma enablers.
452  //
454  m_IsAdded = TRUE;
455 
456  //
457  // update hardware info for Telemetry
458  //
459  if (m_IsBusMaster) {
461  }
462 
463  //
464  // Success:
465  //
467 
468 End:
469  //
470  // If errors then clean-up resources accumulated.
471  //
472  if (!NT_SUCCESS(status)) {
474  }
475 
476  return status;
477 }
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
#define TRUE
Definition: types.h:120
virtual VOID AddDmaEnabler(__inout FxDmaEnabler *Enabler)
Definition: fxdevice.hpp:317
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
FxEvtDmaEnablerSelfManagedIoStopCallback m_EvtDmaEnablerSelfManagedIoStop
BOOLEAN m_IsScatterGather
FxEvtDmaEnablerEnableCallback m_EvtDmaEnablerEnable
WDF_DMA_PROFILE m_Profile
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define DEVICE_DESCRIPTION_VERSION3
Definition: iotypes.h:2066
FxEvtDmaEnablerFillCallback m_EvtDmaEnablerFill
#define FALSE
Definition: types.h:117
#define TRACINGDMA
Definition: dbgtrace.h:71
PDEVICE_OBJECT m_PDO
VOID ReleaseResources(VOID)
PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_START m_Method
PDEVICE_OBJECT m_FDO
BOOLEAN Dma32BitAddresses
Definition: iotypes.h:2074
BOOLEAN Dma64BitAddresses
Definition: iotypes.h:2077
PFX_DRIVER_GLOBALS pFxDriverGlobals
MdDeviceObject __inline GetPhysicalDevice(VOID)
Definition: fxdevice.hpp:228
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxEvtDmaEnablerSelfManagedIoStartCallback m_EvtDmaEnablerSelfManagedIoStart
BOOLEAN ScatterGather
Definition: iotypes.h:2071
_Must_inspect_result_ NTSTATUS ConfigureBusMasterAdapters(__in PDEVICE_DESCRIPTION DeviceDescription, __in PWDF_DMA_ENABLER_CONFIG Config)
ULONG m_MaximumLength
virtual VOID SetDeviceTelemetryInfoFlags(_In_ FxDeviceInfoFlags Flag)
Definition: fxdevice.hpp:341
BOOLEAN m_IsBusMaster
FxEvtDmaEnablerDisableCallback m_EvtDmaEnablerDisable
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static const WCHAR L[]
Definition: oid.c:1250
PFN_WDF_DMA_ENABLER_FLUSH m_Method
PFN_WDF_DMA_ENABLER_DISABLE m_Method
CfxDeviceBase * m_DeviceBase
Definition: fxobject.hpp:328
PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_STOP m_Method
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACE_LEVEL_WARNING
Definition: storswtr.h:28
FxEvtDmaEnablerFlushCallback m_EvtDmaEnablerFlush
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
BOOLEAN m_IsAdded
PFN_WDF_DMA_ENABLER_ENABLE m_Method
__inline _Must_inspect_result_ BOOLEAN IsOsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: fxglobals.h:1094
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
BOOLEAN m_IsDuplexTransfer
#define DEVICE_DESCRIPTION_VERSION2
Definition: iotypes.h:2065
INTERFACE_TYPE InterfaceType
Definition: iotypes.h:2080
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
FxVerifierDbgBreakPoint(pFxDriverGlobals)
PFN_WDF_DMA_ENABLER_FILL m_Method
#define NT_ASSERTMSGW
Definition: rtlfuncs.h:3312
Definition: ps.c:97

◆ InitializeResources()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::InitializeResources ( __inout FxDmaDescription AdapterInfo)
private

Definition at line 781 of file fxdmaenabler.cpp.

784 {
787 
788  NT_ASSERTMSG("expected caller to set DMA version",
789  AdapterInfo->DeviceDescription.Version != 0);
790 
791  //
792  // Submit IoGetDmaAdapter and retain the DmaAdapter pointer.
793  //
794  AdapterInfo->AdapterObject =
796  &AdapterInfo->DeviceDescription,
797  (PULONG)&AdapterInfo->NumberOfMapRegisters);
798 
799  if (AdapterInfo->AdapterObject == NULL) {
802  "Unable to allocate DmaAdapter object for "
803  "WDFDMAENABLER %p, %!STATUS!",
804  GetHandle(), status);
805  return status;
806  }
807 
808  //
809  // Calculate the size of the SGList.
810  //
811  if (m_IsScatterGather) {
812 
813  //
814  // For scatter gather DMA we ask the HAL how many bytes it needs for
815  // each SGList. The HAL allocates some scratch space of its own in
816  // each SGList, which BuildScatterGatherList depends on.
817  //
818  ULONG mapRegistersCount;
819 
820  status = AdapterInfo->AdapterObject->DmaOperations->
821  CalculateScatterGatherList( AdapterInfo->AdapterObject,
822  NULL, // Optional MDL
823  NULL, // CurrentVa
824  AdapterInfo->NumberOfMapRegisters * PAGE_SIZE,
825  (PULONG) &AdapterInfo->PreallocatedSGListSize,
826  &mapRegistersCount);
827 
828  if (!NT_SUCCESS(status)) {
831  "CalculateScatterGatherList failed for "
832  "WDFDMAENABLER %p, %!STATUS!", GetHandle(), status);
833  return status;
834  }
835 
836  ASSERT(AdapterInfo->NumberOfMapRegisters == mapRegistersCount);
837 
838  } else if (m_IsBusMaster) {
839 
840  //
841  // For packet based DMA we only need a single SGList entry because
842  // the HAL moves all of the data into a single continguous buffer
843  //
844  AdapterInfo->PreallocatedSGListSize = sizeof(SCATTER_GATHER_LIST) +
845  sizeof(SCATTER_GATHER_ELEMENT);
846 
847  } else {
848 
849  //
850  // For system DMA we need a single SGList entry per map-register
851  //
852  AdapterInfo->PreallocatedSGListSize = sizeof(SCATTER_GATHER_LIST) +
853  (sizeof(SCATTER_GATHER_ELEMENT) *
854  AdapterInfo->NumberOfMapRegisters);
855  }
856 
857  ASSERT(AdapterInfo->NumberOfMapRegisters > 1);
858 
859  AdapterInfo->MaximumFragmentLength = FxSizeTMin(m_MaximumLength,
860  ((size_t) (AdapterInfo->NumberOfMapRegisters - 1)) << PAGE_SHIFT);
861 
863  "WDFDMAENABLER %p, profile %!WDF_DMA_PROFILE! "
864  "DmaAdapterObject %p, MapRegisters %d, "
865  "MaximumFragmentLength %I64d ", GetHandle(), m_Profile,
866  AdapterInfo->AdapterObject,
867  AdapterInfo->NumberOfMapRegisters,
868  AdapterInfo->MaximumFragmentLength);
869 
870  if (AdapterInfo->MaximumFragmentLength < m_MaximumLength) {
872  "The maximum transfer length for WDFDMAENABLER %p "
873  "is reduced to %I64d from %I64d due to mapregisters limit",
875  AdapterInfo->MaximumFragmentLength);
876  }
877 
878  return STATUS_SUCCESS;
879 }
#define NT_ASSERTMSG
Definition: rtlfuncs.h:3311
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
PDMA_ADAPTER NTAPI IoGetDmaAdapter(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PDEVICE_DESCRIPTION DeviceDescription, IN OUT PULONG NumberOfMapRegisters)
Definition: pnpdma.c:23
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN m_IsScatterGather
WDF_DMA_PROFILE m_Profile
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACINGDMA
Definition: dbgtrace.h:71
PDEVICE_OBJECT m_PDO
__inline WDFDMAENABLER GetHandle(VOID)
struct _SCATTER_GATHER_LIST SCATTER_GATHER_LIST
Definition: iotypes.h:2204
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ULONG m_MaximumLength
BOOLEAN m_IsBusMaster
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define PAGE_SIZE
Definition: env_spec_w32.h:49
__inline size_t FxSizeTMin(__in size_t A, __in size_t B)
Definition: fxglobals.h:997
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by ConfigureDmaAdapter().

◆ InitializeTransferContext()

VOID FxDmaEnabler::InitializeTransferContext ( __out PVOID  Context,
__in WDF_DMA_DIRECTION  Direction 
)

Definition at line 1109 of file fxdmaenabler.cpp.

1113 {
1115 
1116  NT_ASSERTMSG(
1117  "should not call this routine if enabler is not using DMAv3",
1118  UsesDmaV3()
1119  );
1120 
1121  PDMA_OPERATIONS dmaOperations =
1122  adapter->DmaOperations;
1123 
1124  dmaOperations->InitializeDmaTransferContext(adapter, Context);
1125 }
__inline FxDmaDescription * GetDmaDescription(__in WDF_DMA_DIRECTION Direction)
#define NT_ASSERTMSG
Definition: rtlfuncs.h:3311
return adapter
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
PINITIALIZE_DMA_TRANSFER_CONTEXT InitializeDmaTransferContext
Definition: iotypes.h:2651
BOOLEAN UsesDmaV3(VOID)
PDMA_ADAPTER AdapterObject

Referenced by FxDmaTransactionBase::Initialize(), and FxDmaPacketTransaction::ReserveAdapter().

◆ IsBusMaster()

__inline BOOLEAN FxDmaEnabler::IsBusMaster ( VOID  )
inline

◆ IsPacketBased()

__inline BOOLEAN FxDmaEnabler::IsPacketBased ( )
inline

Definition at line 237 of file fxdmaenabler.hpp.

239  {
240  return m_IsScatterGather ? FALSE : TRUE ;
241  }
#define TRUE
Definition: types.h:120
BOOLEAN m_IsScatterGather
#define FALSE
Definition: types.h:117

◆ PowerDown()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::PowerDown ( VOID  )

Definition at line 988 of file fxdmaenabler.cpp.

991 {
993  NTSTATUS localStatus;
995  WDFDMAENABLER handle = GetHandle();
997 
999  "WDFDMAENABLER %p: PowerDown notification", GetHandle());
1000 
1001  do {
1002 
1004 
1006 
1007  if (!NT_SUCCESS(localStatus)) {
1009  status = (NT_SUCCESS(status)) ? localStatus : status;
1010  }
1011  }
1012 
1015  {
1016  localStatus = m_EvtDmaEnablerDisable.Invoke( handle );
1017 
1018  if (!NT_SUCCESS(localStatus)) {
1020  status = (NT_SUCCESS(status)) ? localStatus : status;
1021  }
1022  }
1023 
1027  {
1028  localStatus = m_EvtDmaEnablerFlush.Invoke( handle );
1029 
1030  if (!NT_SUCCESS(localStatus)) {
1032  status = (NT_SUCCESS(status)) ? localStatus : status;
1033  }
1034  }
1035 
1036  } WHILE (0);
1037 
1038  if (!NT_SUCCESS(status)) {
1040  "WDFDMAENABLER %p: PowerDown: "
1041  "%!WdfDmaEnablerCallback! failed %!STATUS!",
1042  GetHandle(), tag, status);
1043  }
1044 
1045  return status;
1046 }
BOOLEAN m_DmaEnablerFillFailed
LONG NTSTATUS
Definition: precomp.h:26
FxEvtDmaEnablerSelfManagedIoStopCallback m_EvtDmaEnablerSelfManagedIoStop
Definition: ecma_167.h:138
NTSTATUS Invoke(__in WDFDMAENABLER Handle)
NTSTATUS Invoke(__in WDFDMAENABLER Handle)
#define FALSE
Definition: types.h:117
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACINGDMA
Definition: dbgtrace.h:71
__inline WDFDMAENABLER GetHandle(VOID)
BOOLEAN m_DmaEnablerEnableFailed
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define WHILE(constant)
Definition: fxmacros.hpp:226
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxEvtDmaEnablerDisableCallback m_EvtDmaEnablerDisable
PFN_WDF_DMA_ENABLER_FLUSH m_Method
PFN_WDF_DMA_ENABLER_DISABLE m_Method
NTSTATUS Invoke(__in WDFDMAENABLER Handle)
PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_STOP m_Method
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
FxEvtDmaEnablerFlushCallback m_EvtDmaEnablerFlush
FxDmaEnablerCallbacks
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ PowerUp()

_Must_inspect_result_ NTSTATUS FxDmaEnabler::PowerUp ( VOID  )

Definition at line 929 of file fxdmaenabler.cpp.

932 {
935  WDFDMAENABLER handle = GetHandle();
937 
939  "WDFDMAENABLER %p: PowerUp notification", GetHandle());
940 
941  do {
943 
945 
946  if (!NT_SUCCESS(status)) {
949  break;
950  }
951  }
952 
954 
956 
957  if (!NT_SUCCESS(status)) {
960  break;
961  }
962  }
963 
965 
967 
968  if (!NT_SUCCESS(status)) {
971  break;
972  }
973  }
974 
975  } WHILE (0);
976 
977  if (!NT_SUCCESS(status)) {
979  "WDFDMAENABLER %p: PowerUp: "
980  "%!WdfDmaEnablerCallback! failed %!STATUS!",
981  GetHandle(), tag, status);
982  }
983  return status;
984 }
#define TRUE
Definition: types.h:120
BOOLEAN m_DmaEnablerFillFailed
NTSTATUS Invoke(__in WDFDMAENABLER Handle)
LONG NTSTATUS
Definition: precomp.h:26
Definition: ecma_167.h:138
FxEvtDmaEnablerEnableCallback m_EvtDmaEnablerEnable
FxEvtDmaEnablerFillCallback m_EvtDmaEnablerFill
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACINGDMA
Definition: dbgtrace.h:71
__inline WDFDMAENABLER GetHandle(VOID)
PFN_WDF_DMA_ENABLER_SELFMANAGED_IO_START m_Method
BOOLEAN m_DmaEnablerEnableFailed
PFX_DRIVER_GLOBALS pFxDriverGlobals
BOOLEAN m_DmaEnablerSelfManagedIoStartFailed
#define WHILE(constant)
Definition: fxmacros.hpp:226
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxEvtDmaEnablerSelfManagedIoStartCallback m_EvtDmaEnablerSelfManagedIoStart
NTSTATUS Invoke(__in WDFDMAENABLER Handle)
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
NTSTATUS Invoke(__in WDFDMAENABLER Handle)
FxDmaEnablerCallbacks
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
PFN_WDF_DMA_ENABLER_ENABLE m_Method
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
PFN_WDF_DMA_ENABLER_FILL m_Method
Definition: ps.c:97

◆ ReleaseResources()

VOID FxDmaEnabler::ReleaseResources ( VOID  )
private

Definition at line 893 of file fxdmaenabler.cpp.

896 {
899 
901 
902 }
__inline FxDmaDescription * GetReadDmaDescription(VOID)
BOOLEAN m_IsConfigured
#define FALSE
Definition: types.h:117
__inline FxDmaDescription * GetWriteDmaDescription(VOID)
VOID FreeResources(__inout FxDmaDescription *AdapterInfo)

Referenced by Dispose(), and Initialize().

◆ RevokeResources()

VOID FxDmaEnabler::RevokeResources ( VOID  )

Definition at line 905 of file fxdmaenabler.cpp.

908 {
909  //
910  // Give back any system DMA resources allocated for this device
911  //
912 
913  if (m_IsBusMaster == FALSE)
914  {
915 
916 
917 
918 
919 
920  }
921 }
#define FALSE
Definition: types.h:117
BOOLEAN m_IsBusMaster

◆ SetMaxSGElements()

__inline VOID FxDmaEnabler::SetMaxSGElements ( __in size_t  MaximumSGElements)
inline

Definition at line 190 of file fxdmaenabler.hpp.

193  {
194  m_MaxSGElements = (ULONG) MaximumSGElements;
195  }
ULONG m_MaxSGElements
unsigned int ULONG
Definition: retypes.h:1

◆ SupportsChainedMdls()

__inline BOOLEAN FxDmaEnabler::SupportsChainedMdls ( VOID  )
inline

Definition at line 208 of file fxdmaenabler.hpp.

211  {
212  //
213  // The only case where we don't support chained MDLS is DMAV2
214  // with packet mode.
215  //
216 
217  if ((UsesDmaV3() == false) &&
218  (m_IsBusMaster == TRUE) &&
219  (m_IsScatterGather == FALSE)) {
220  return false;
221  } else {
222  return true;
223  }
224  }
#define TRUE
Definition: types.h:120
BOOLEAN UsesDmaV3(VOID)
BOOLEAN m_IsScatterGather
#define FALSE
Definition: types.h:117
BOOLEAN m_IsBusMaster

◆ UsesDmaV3()

BOOLEAN FxDmaEnabler::UsesDmaV3 ( VOID  )
inline

Definition at line 285 of file fxdmaenabler.hpp.

288  {
290 
291  //
292  // It doesn't matter which direction we use below. Direction is
293  // ignored for the simplex enabler, and will be the same for both
294  // channels in a duplex enabler.
295  //
296 
298 
299  return description->DeviceDescription.Version == DEVICE_DESCRIPTION_VERSION3;
300  }
__inline FxDmaDescription * GetDmaDescription(__in WDF_DMA_DIRECTION Direction)
const char * description
Definition: directx.c:2497
#define DEVICE_DESCRIPTION_VERSION3
Definition: iotypes.h:2066

Referenced by FxDmaPacketTransaction::AcquireDevice(), FxDmaPacketTransaction::AllocateAdapterChannel(), FxDmaScatterGatherTransaction::BuildScatterGatherList(), FxDmaSystemTransaction::CancelMappedTransfer(), FxDmaPacketTransaction::FlushAdapterBuffers(), FxDmaScatterGatherTransaction::GetScatterGatherList(), GetTransferContextSize(), FxDmaTransactionBase::GetTransferInfo(), FxDmaTransactionBase::Initialize(), InitializeTransferContext(), FxDmaPacketTransaction::MapTransfer(), FxDmaPacketTransaction::ReleaseDevice(), FxDmaPacketTransaction::ReserveAdapter(), FxDmaPacketTransaction::StartTransfer(), and SupportsChainedMdls().

Friends And Related Function Documentation

◆ FxDmaPacketTransaction

Definition at line 69 of file fxdmaenabler.hpp.

◆ FxDmaScatterGatherTransaction

Definition at line 70 of file fxdmaenabler.hpp.

◆ FxDmaSystemTransaction

Definition at line 71 of file fxdmaenabler.hpp.

◆ FxDmaTransactionBase

friend class FxDmaTransactionBase
friend

Definition at line 68 of file fxdmaenabler.hpp.

Member Data Documentation

◆ @4583

union { ... }

◆ List

PSCATTER_GATHER_LIST FxDmaEnabler::List

Definition at line 418 of file fxdmaenabler.hpp.

◆ Lookaside

NPAGED_LOOKASIDE_LIST FxDmaEnabler::Lookaside

Definition at line 406 of file fxdmaenabler.hpp.

◆ m_CommonBufferAlignment

ULONG FxDmaEnabler::m_CommonBufferAlignment
protected

Definition at line 371 of file fxdmaenabler.hpp.

Referenced by ConfigureBusMasterAdapters(), FxDmaEnabler(), and GetAlignment().

◆ m_DmaEnablerEnableFailed

BOOLEAN FxDmaEnabler::m_DmaEnablerEnableFailed
private

Definition at line 444 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), PowerDown(), and PowerUp().

◆ m_DmaEnablerFillFailed

BOOLEAN FxDmaEnabler::m_DmaEnablerFillFailed
private

Definition at line 443 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), PowerDown(), and PowerUp().

◆ m_DmaEnablerSelfManagedIoStartFailed

BOOLEAN FxDmaEnabler::m_DmaEnablerSelfManagedIoStartFailed
private

Definition at line 445 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), and PowerUp().

◆ m_DuplexAdapterInfo

◆ m_EvtDmaEnablerDisable

FxEvtDmaEnablerDisableCallback FxDmaEnabler::m_EvtDmaEnablerDisable
private

Definition at line 436 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and PowerDown().

◆ m_EvtDmaEnablerEnable

FxEvtDmaEnablerEnableCallback FxDmaEnabler::m_EvtDmaEnablerEnable
private

Definition at line 435 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and PowerUp().

◆ m_EvtDmaEnablerFill

FxEvtDmaEnablerFillCallback FxDmaEnabler::m_EvtDmaEnablerFill
private

Definition at line 433 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and PowerUp().

◆ m_EvtDmaEnablerFlush

FxEvtDmaEnablerFlushCallback FxDmaEnabler::m_EvtDmaEnablerFlush
private

Definition at line 434 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and PowerDown().

◆ m_EvtDmaEnablerSelfManagedIoStart

FxEvtDmaEnablerSelfManagedIoStartCallback FxDmaEnabler::m_EvtDmaEnablerSelfManagedIoStart
private

Definition at line 437 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and PowerUp().

◆ m_EvtDmaEnablerSelfManagedIoStop

FxEvtDmaEnablerSelfManagedIoStopCallback FxDmaEnabler::m_EvtDmaEnablerSelfManagedIoStop
private

Definition at line 438 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and PowerDown().

◆ m_FDO

◆ m_IsAdded

BOOLEAN FxDmaEnabler::m_IsAdded
protected

Definition at line 343 of file fxdmaenabler.hpp.

Referenced by Dispose(), FxDmaEnabler(), and Initialize().

◆ m_IsBusMaster

BOOLEAN FxDmaEnabler::m_IsBusMaster
protected

◆ m_IsConfigured

BOOLEAN FxDmaEnabler::m_IsConfigured
protected

◆ m_IsDuplexTransfer

◆ m_IsScatterGather

BOOLEAN FxDmaEnabler::m_IsScatterGather
protected

◆ m_IsSGListAllocated

BOOLEAN FxDmaEnabler::m_IsSGListAllocated
protected

◆ m_MaximumLength

ULONG FxDmaEnabler::m_MaximumLength
protected

◆ m_MaxSGElements

◆ m_PDO

PDEVICE_OBJECT FxDmaEnabler::m_PDO
protected

Definition at line 320 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler(), Initialize(), and InitializeResources().

◆ m_Profile

WDF_DMA_PROFILE FxDmaEnabler::m_Profile
protected

◆ m_SGList

◆ m_SGListSize

size_t FxDmaEnabler::m_SGListSize
protected

◆ m_SimplexAdapterInfo

◆ m_TransactionLink

FxTransactionedEntry FxDmaEnabler::m_TransactionLink

Definition at line 314 of file fxdmaenabler.hpp.

Referenced by FxDmaEnabler().

◆ ScatterGatherProfile

struct { ... } FxDmaEnabler::ScatterGatherProfile

◆ SystemProfile

struct { ... } FxDmaEnabler::SystemProfile

The documentation for this class was generated from the following files: