DMA_OPERATIONS structure (wdm.h)

The DMA_OPERATIONS structure provides a table of pointers to functions that control the operation of a DMA controller.

Syntax

typedef struct _DMA_OPERATIONS {
  ULONG                                   Size;
  PPUT_DMA_ADAPTER                        PutDmaAdapter;
  PALLOCATE_COMMON_BUFFER                 AllocateCommonBuffer;
  PFREE_COMMON_BUFFER                     FreeCommonBuffer;
  PALLOCATE_ADAPTER_CHANNEL               AllocateAdapterChannel;
  PFLUSH_ADAPTER_BUFFERS                  FlushAdapterBuffers;
  PFREE_ADAPTER_CHANNEL                   FreeAdapterChannel;
  PFREE_MAP_REGISTERS                     FreeMapRegisters;
  PMAP_TRANSFER                           MapTransfer;
  PGET_DMA_ALIGNMENT                      GetDmaAlignment;
  PREAD_DMA_COUNTER                       ReadDmaCounter;
  PGET_SCATTER_GATHER_LIST                GetScatterGatherList;
  PPUT_SCATTER_GATHER_LIST                PutScatterGatherList;
  PCALCULATE_SCATTER_GATHER_LIST_SIZE     CalculateScatterGatherList;
  PBUILD_SCATTER_GATHER_LIST              BuildScatterGatherList;
  PBUILD_MDL_FROM_SCATTER_GATHER_LIST     BuildMdlFromScatterGatherList;
  PGET_DMA_ADAPTER_INFO                   GetDmaAdapterInfo;
  PGET_DMA_TRANSFER_INFO                  GetDmaTransferInfo;
  PINITIALIZE_DMA_TRANSFER_CONTEXT        InitializeDmaTransferContext;
  PALLOCATE_COMMON_BUFFER_EX              AllocateCommonBufferEx;
  PALLOCATE_ADAPTER_CHANNEL_EX            AllocateAdapterChannelEx;
  PCONFIGURE_ADAPTER_CHANNEL              ConfigureAdapterChannel;
  PCANCEL_ADAPTER_CHANNEL                 CancelAdapterChannel;
  PMAP_TRANSFER_EX                        MapTransferEx;
  PGET_SCATTER_GATHER_LIST_EX             GetScatterGatherListEx;
  PBUILD_SCATTER_GATHER_LIST_EX           BuildScatterGatherListEx;
  PFLUSH_ADAPTER_BUFFERS_EX               FlushAdapterBuffersEx;
  PFREE_ADAPTER_OBJECT                    FreeAdapterObject;
  PCANCEL_MAPPED_TRANSFER                 CancelMappedTransfer;
  PALLOCATE_DOMAIN_COMMON_BUFFER          AllocateDomainCommonBuffer;
  PFLUSH_DMA_BUFFER                       FlushDmaBuffer;
  PJOIN_DMA_DOMAIN                        JoinDmaDomain;
  PLEAVE_DMA_DOMAIN                       LeaveDmaDomain;
  PGET_DMA_DOMAIN                         GetDmaDomain;
  PALLOCATE_COMMON_BUFFER_WITH_BOUNDS     AllocateCommonBufferWithBounds;
  PALLOCATE_COMMON_BUFFER_VECTOR          AllocateCommonBufferVector;
  PGET_COMMON_BUFFER_FROM_VECTOR_BY_INDEX GetCommonBufferFromVectorByIndex;
  PFREE_COMMON_BUFFER_FROM_VECTOR         FreeCommonBufferFromVector;
  PFREE_COMMON_BUFFER_VECTOR              FreeCommonBufferVector;
  PCREATE_COMMON_BUFFER_FROM_MDL          CreateCommonBufferFromMdl;
} *PDMA_OPERATIONS, DMA_OPERATIONS;

Members

Size

The size, in bytes, of this DMA_OPERATIONS structure.

PutDmaAdapter

A pointer to a system-defined routine to free a DMA_ADAPTER structure. For more information, see PutDmaAdapter.

AllocateCommonBuffer

A pointer to a system-defined routine to allocate a physically contiguous DMA buffer. For more information, see AllocateCommonBuffer.

FreeCommonBuffer

A pointer to a system-defined routine to free a physically contiguous DMA buffer previously allocated by AllocateCommonBuffer. For more information, see FreeCommonBuffer.

AllocateAdapterChannel

A pointer to a system-defined routine to allocate a channel for DMA operations. For more information, see AllocateAdapterChannel.

FlushAdapterBuffers

A pointer to a system-defined routine to flush data from the system or bus-master adapter's internal cache after a DMA operation. For more information, see FlushAdapterBuffers.

FreeAdapterChannel

A pointer to a system-defined routine to free a channel previously allocated for DMA operations by AllocateAdapterChannel. For more information, see FreeAdapterChannel.

FreeMapRegisters

A pointer to a system-defined routine to free map registers allocated for DMA operations. For more information, see FreeMapRegisters.

MapTransfer

A pointer to a system-defined routine to begin a DMA operation. For more information, see MapTransfer.

GetDmaAlignment

A pointer to a system-defined routine to obtain the DMA alignment requirements of the controller. For more information, see GetDmaAlignment.

ReadDmaCounter

A pointer to a system-defined routine to obtain the current transfer count for a DMA operation. For more information, see ReadDmaCounter.

GetScatterGatherList

A pointer to a system-defined routine that allocates map registers and creates a scatter/gather list for DMA. For more information, see GetScatterGatherList.

PutScatterGatherList

A pointer to a system-defined routine that frees map registers and a scatter/gather list after a DMA operation is complete. For more information, see PutScatterGatherList.

CalculateScatterGatherList

A pointer to a system-defined routine that determines the buffer size needed to hold the scatter/gather list that describes an I/O data buffer. This member is available only in versions 2 and later of DMA_OPERATIONS. For more information, see CalculateScatterGatherList.

BuildScatterGatherList

A pointer to a system-defined routine that allocates map registers and creates a scatter/gather list for DMA in a driver-supplied buffer. This member is available only in versions 2 and later of DMA_OPERATIONS. For more information, see BuildScatterGatherList.

BuildMdlFromScatterGatherList

A pointer to a system-defined routine that builds an MDL corresponding to a scatter/gather list. This member is available only in versions 2 and later of DMA_OPERATIONS. For more information, see BuildMdlFromScatterGatherList.

GetDmaAdapterInfo

A pointer to a system-defined routine that describes the capabilities of a bus-master DMA device or a system DMA controller. GetDmaAdapterInfo is available only in version 3 of DMA_OPERATIONS. For more information, see GetDmaAdapterInfo.

GetDmaTransferInfo

A pointer to a system-defined routine that describes the allocation requirements for a scatter/gather list. This routine replaces CalculateScatterGatherList. GetDmaTransferInfo is available only in version 3 of DMA_OPERATIONS. For more information, see GetDmaTransferInfo.

InitializeDmaTransferContext

A pointer to a system-defined routine that initializes an opaque DMA transfer context. The operating system stores the internal status of a DMA transfer in this context. InitializeDmaTransferContext is available only in version 3 of DMA_OPERATIONS. For more information, see InitializeDmaTransferContext.

AllocateCommonBufferEx

A pointer to a system-defined routine that allocates memory for a common buffer and maps this memory so that it can accessed both by the processor and by a DMA device. AllocateCommonBufferEx is available only in version 3 of DMA_OPERATIONS. For more information, see AllocateCommonBufferEx.

AllocateAdapterChannelEx

A pointer to a system-defined routine that allocates the resources required for a DMA transfer and then calls the driver-supplied AdapterControl routine to initiate the DMA transfer. AllocateAdapterChannelEx is available only in version 3 of DMA_OPERATIONS. For more information, see AllocateAdapterChannelEx.

ConfigureAdapterChannel

A pointer to a system-defined routine enables a custom function that is implemented by the DMA controller. ConfigureAdapterChannel is available only in version 3 of DMA_OPERATIONS. For more information, see ConfigureAdapterChannel.

CancelAdapterChannel

A pointer to a system-defined routine that tries to cancel a pending request to allocate a DMA channel. CancelAdapterChannel is available only in version 3 of DMA_OPERATIONS. For more information, see CancelAdapterChannel.

MapTransferEx

A pointer to a system-defined routine that sets up map registers to map the physical addresses in a scatter/gather list to the logical addresses that are required to do a DMA transfer. MapTransferEx is available only in version 3 of DMA_OPERATIONS. For more information, see MapTransferEx.

GetScatterGatherListEx

A pointer to a system-defined routine that allocates resources required for a DMA transfer, builds a scatter/gather list, and then calls the driver-supplied AdapterListControl routine to initiate the DMA transfer. GetScatterGatherListEx is available only in version 3 of DMA_OPERATIONS. For more information, see GetScatterGatherListEx. This routine is a wrapper of AllocateAdapterChannelEx and MapTransferEx.

BuildScatterGatherListEx

A pointer to a system-defined routine that builds a scatter/gather list in a caller-allocated buffer, and then calls the driver-supplied AdapterListControl routine to initiate the DMA transfer. BuildScatterGatherListEx is available only in version 3 of DMA_OPERATIONS. For more information, see BuildScatterGatherListEx.

FlushAdapterBuffersEx

A pointer to a system-defined routine that flushes any data that remains in the system DMA controller's internal cache or in a bus-master adapter's internal cache at the end of a DMA transfer. For a device that uses a system DMA controller, this routine cancels the current DMA transfer on the controller if the transfer is not complete. FlushAdapterBuffersEx is available only in version 3 of DMA_OPERATIONS. For more information, see FlushAdapterBuffersEx.

FreeAdapterObject

A pointer to a system-defined routine that releases the specified adapter object after a driver has completed all DMA operations. FreeAdapterObject is available only in version 3 of DMA_OPERATIONS. For more information, see FreeAdapterObject.

CancelMappedTransfer

A pointer to a system-defined routine that cancels a mapped transfer. CancelMappedTransfer is available only in version 3 of DMA_OPERATIONS. For more information, see CancelMappedTransfer.

AllocateDomainCommonBuffer

A pointer to a PALLOCATE_DOMAIN_COMMON_BUFFER callback routine to allocate a domain common buffer. This option is available in Windows 10 and later versions.

FlushDmaBuffer

A pointer to a PFLUSH_DMA_BUFFER callback function that flushes any data remaining in the cache. This option is available in Windows 10 and later versions.

JoinDmaDomain

A pointer to a PJOIN_DMA_DOMAIN callback function that joins the specified DMA domain. This option is available in Windows 10 and later versions.

LeaveDmaDomain

A pointer to a PLEAVE_DMA_DOMAIN callback function that leaves the specified DMA domain. This option is available in Windows 10 and later versions.

GetDmaDomain

A pointer to the PGET_DMA_DOMAIN callback function that gets a handle to the DMA domain. This option is available in Windows 10 and later versions.

AllocateCommonBufferWithBounds

A pointer to a PALLOCATE_COMMON_BUFFER_WITH_BOUNDS callback function that allocates the memory for a common buffer and maps it so that it can be accessed by a master device and the CPU. The common buffer can be bound by an optional minimum and maximum logical address. This option is available starting in Windows 10, version 1803.

AllocateCommonBufferVector

GetCommonBufferFromVectorByIndex

FreeCommonBufferFromVector

FreeCommonBufferVector

CreateCommonBufferFromMdl

A pointer to a PCREATE_COMMON_BUFFER_FROM_MDL callback function that will create a DMA common buffer from an MDL and maps the backing memory so that it can be accessed by a bus-mastering device and the CPU. This optional callback is available starting in Windows Server 2022.

Remarks

All members of this structure, with the exception of Size, are pointers to functions that drivers use to perform DMA operations for their devices. Drivers obtain these pointers by calling the IoGetDmaAdapter routine. The version of the DMA_OPERATIONS structure that this routine returns depends on the Version member of the DEVICE_DESCRIPTION structure that is passed to IoGetDmaAdapter as an input parameter. If Version is DEVICE_DESCRIPTION_VERSION or DEVICE_DESCRIPTION_VERSION1, version 1 of this structure is returned. If Version is DEVICE_DESCRIPTION_VERSION2, version 2 of this structure is returned. Version 2 of DMA_OPERATIONS is available starting with Windows XP. If Version is DEVICE_DESCRIPTION_VERSION3, version 3 of this structure is returned. Version 3 of DMA_OPERATIONS is available starting with Windows 8.

Requirements

Requirement Value
Minimum supported client Supported starting with Windows 2000.
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)

See also

AllocateAdapterChannel

AllocateAdapterChannelEx

AllocateCommonBuffer

AllocateCommonBufferEx

BuildMdlFromScatterGatherList

BuildScatterGatherList

BuildScatterGatherListEx

CalculateScatterGatherList

CancelAdapterChannel

CancelMappedTransfer

ConfigureAdapterChannel

DEVICE_DESCRIPTION

FlushAdapterBuffers

FlushAdapterBuffersEx

FreeAdapterChannel

FreeAdapterObject

FreeCommonBuffer

FreeMapRegisters

GetDmaAdapterInfo

GetDmaAlignment

GetDmaTransferInfo

GetScatterGatherList

GetScatterGatherListEx

InitializeDmaTransferContext

IoGetDmaAdapter

MapTransfer

MapTransferEx

PutDmaAdapter

PutScatterGatherList

ReadDmaCounter