Completing a DMA Transfer
Note The NetDMA interface is not supported in Windows 8 and later.
The NetDMA interface provides two methods for a NetDMA provider to complete a dynamic memory access (DMA) transfer:
Completion status reporting
The DMA engine writes the physical address of the last descriptor that was processed and the status of the transfer operation to a memory location.
Interrupts
The DMA engine generates an interrupt when the processing is complete for a descriptor.
These two completion methods can be used together, separately, or there can be no completion action taken. Combinations of the NET_DMA_STATUS_UPDATE_ON_COMPLETION and NET_DMA_INTERRUPT_ON_COMPLETION flags in the ControlFlags member of the NET_DMA_DESCRIPTOR structure specify the completion method for each DMA descriptor.
If the NET_DMA_STATUS_UPDATE_ON_COMPLETION flag is set, the CompletionVirtualAddress and CompletionPhysicalAddress members in the NET_DMA_CHANNEL_PARAMETERS structure reference a completion status value. The completion status value at the specified address is a 64-bit combination of the physical address of the most recent DMA descriptor that was processed and additional status information. If the NET_DMA_STATUS_UPDATE_ON_COMPLETION flag is set, the DMA engine updates the completion status value when it completes the processing of each descriptor. If the NET_DMA_STATUS_UPDATE_ON_COMPLETION flag is cleared, CompletionVirtualAddress and CompletionPhysicalAddress are not used.
The physical address of the DMA descriptor must be aligned to 64-bit boundaries. Therefore, the lower six bits of the physical address are available for other information. The DMA engine uses these bits to indicate status values, including NetDmaTransferStatusActive, NetDmaTransferStatusIdle, NetDmaTransferStatusSuspend, or NetDmaTransferStatusHalted.
If the NET_DMA_INTERRUPT_ON_COMPLETION flag is set, the DMA engine generates an interrupt for the DMA channel after it processes the DMA descriptor. When this flag is cleared, the DMA engine does not generate an interrupt.
If an interrupt is requested, the NetDMA provider driver calls the NetDmaIsr function in its interrupt service routing (ISR) and provides the physical address of the last completed DMA descriptor. For more information about using interrupts, see Managing NetDMA Interrupts.