NdisSetupDmaTransfer

VOID
    NdisSetupDmaTransfer(
        OUT PNDIS_STATUS Status,
        IN PNDIS_HANDLE NdisDmaHandle,
        IN PNDIS_BUFFER Buffer,
        IN ULONG Offset,
        IN ULONG Length,
        IN BOOLEAN WriteToDevice
        );

NdisSetupDmaTransfer is called by a NIC driver in preparation for a slave DMA transfer between host and its NIC.

Parameters

Status
Points to a caller-supplied variable in which this function returns the status of the setup transfer operation. Possible values are:

NDIS_STATUS_RESOURCES
NDIS_STATUS_SUCCESS

NdisDmaHandle
Specifies the handle that the NDIS interface library associates with the DMA channel.
Buffer
Points to the DMA buffer descriptor.
Offset
Specifies the DMA buffer offset at which the transfer starts.
Length
Specifies the length, in bytes, of the DMA transfer. The sum of the values of Offset and Length must not be greater than the address of the last byte of Buffer.
WriteToDevice
Specifies TRUE for a download operation or FALSE for an upload operation.

Comments

The NIC driver calls NdisSetupDmaTransfer to set up the host DMA controller for a data transfer. In its call, the driver specifies a buffer that contains the data for a download operation, or that will receive the data for an upload.

After NdisSetupDmaTransfer returns, the NIC driver can program its NIC to initiate the DMA transfer. When the transfer completes, the driver calls NdisCompleteDmaTransfer.

Callers of NdisSetupDmaTransfer run at IRQL <= DISPATCH_LEVEL.

See Also

NdisAllocateDmaChannel, NdisCompleteDmaTransfer, NdisReadDmaCounter