DMA_OPERATIONS
The DMA_OPERATIONS structure provides a table of pointers to functions that control the operation of a DMA controller.
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;
// version 2 operations
PCALCULATE_SCATTER_GATHER_LIST_SIZE CalculateScatterGatherList;
PBUILD_SCATTER_GATHER_LIST BuildScatterGatherList;
PBUILD_MDL_FROM_SCATTER_GATHER_LIST BuildMdlFromScatterGatherList;
} DMA_OPERATIONS, *PDMA_OPERATIONS ;
Members
- Size
- Specifies the size, in bytes, of the DMA_OPERATIONS structure.
- PutDmaAdapter
- Pointer to a system-defined routine to free a DMA_ADAPTER structure. For further information, see PutDmaAdapter.
- AllocateCommonBuffer
- Pointer to a system-defined routine to allocate a physically contiguous DMA buffer. For further information, see AllocateCommonBuffer.
- FreeCommonBuffer
- Pointer to a system-defined routine to free a physically contiguous DMA buffer previously allocated by AllocateCommonBuffer. For further information, see FreeCommonBuffer.
- AllocateAdapterChannel
- Pointer to a system-defined routine to allocate a channel for DMA operations. For further information, see AllocateAdapterChannel.
- FlushAdapterBuffers
- Pointer to a system-defined routine to flush data from the system or bus-master adapter's internal cache after a DMA operation. For further information, see FlushAdapterBuffers.
- FreeAdapterChannel
- Pointer to a system-defined routine to free a channel previously allocated for DMA operations by AllocateAdapterChannel. For further information, see FreeAdapterChannel.
- FreeMapRegisters
- Pointer to a system-defined routine to free map registers allocated for DMA operations. For further information, see FreeMapRegisters.
- MapTransfer
- Pointer to a system-defined routine to begin a DMA operation. For further information, see MapTransfer.
- GetDmaAlignment
- Pointer to a system-defined routine to obtain the DMA alignment requirements of the controller. For further information, see GetDmaAlignment.
- ReadDmaCounter
- Pointer to a system-defined routine to obtain the current transfer count for a DMA operation. For further information, see ReadDmaCounter.
- GetScatterGatherList
- Pointer to a system-defined routine that allocates map registers and creates a scatter/gather list for DMA. On Windows 98 and Windows Me, this value is NULL. For further information, see GetScatterGatherList.
- PutScatterGatherList
- Pointer to a system-defined routine that frees map registers and a scatter/gather list after a DMA operation is complete. On Windows 98 and Windows ME, this value is NULL. For further information, see PutScatterGatherList.
- CalculateScatterGatherList
- Pointer to a system-defined routine that determines the buffer size needed to hold a scatter/gather list for a given buffer. This member is only available in version 2 of DMA_OPERATIONS. For further information, see CalculateScatterGatherList.
- BuildScatterGatherList
- 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 only available in version 2 of DMA_OPERATIONS. For further information, see BuildScatterGatherList.
- BuildMdlFromScatterGatherList
- Pointer to a system-defined routine that builds an MDL corresponding to a scatter/gather list. This member is only available in version 2 of DMA_OPERATIONS. For further information, see BuildMdlFromScatterGatherList.
Headers
Defined in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
Comments
All members of this structure, with the exception of Size, are pointers to functions that drivers use to undertake DMA operations for their device. Drivers obtain these pointers by calling IoGetDmaAdapter. The version of DMA_OPERATIONS returned depends on the Version member of the DEVICE_DESCRIPTION structure passed to IoGetDmaAdapter. If Version is DEVICE_DESCRPTION_VERSION or DEVICE_DESCRIPTION_VERSION1, then version 1 of this structure is returned. If Version is DEVICE_DESCRIPTION_VERSION2, then version 2 of this structure is returned. Version 2 of DMA_OPERATIONS is available only on Windows XP and later.
See Also
- AllocateAdapterChannel, AllocateCommonBuffer, BuildMdlFromScatterGatherList, BuildScatterGatherList, CalculateScatterGatherList, FreeAdapterChannel, FreeCommonBuffer, FreeMapRegisters, FlushAdapterBuffers, GetDmaAlignment, GetScatterGatherList, IoGetDmaAdapter, MapTransfer, PutDmaAdapter, PutScatterGatherList, ReadDmaCounter