NDIS-Supplied DMA-Related Functions (NDIS 5.1)
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
A miniport driver calls NDIS functions for direct memory access (DMA) operations between the host and the NIC. For example, miniport drivers allocate and manage virtual memory buffers in the host for DMA transfers. The following table summarizes functions provided by the NDIS Library that allow the drivers to allocate, construct, and inspect such buffers.
The following DMA-related functions are supplied by NDIS:
- NdisMAllocateMapRegisters
Allocates map registers for use with bus-master DMA devices.
- NdisMAllocateSharedMemory
Allocates memory to be shared between the system and a bus-master DMA NIC. It is called during driver initialization at IRQL = PASSIVE_LEVEL.
- NdisMAllocateSharedMemoryAsync
Called at raised IRQL, such as in a miniport driver's MiniportHandleInterrupt function to allocate shared memory for a bus-master DMA NIC.
- NdisMCompleteBufferPhysicalMapping
Releases the map registers used by a previous call to NdisMStartBufferPhysicalMapping for a bus-master DMA operation. Called only by drivers that call NdisMAllocateMapRegisters during DMA initialization.
- NdisMCompleteDmaTransfer
Indicates to the NDIS Library that a subordinate DMA operation has completed.
- NdisMDeregisterDmaChannel
Releases a miniport driver's claim on its DMA channel.
- NdisFlushBuffer
Called by the driver before sending data to the NIC or transferring data from the NIC to ensure coherence between cache memory and host physical memory during bus-master DMA operations.
- NdisMFreeMapRegisters
Frees map registers for bus-master DMA that were previously allocated by NdisMAllocateMapRegisters.
- NdisMFreeSharedMemory
Frees memory that was previously allocated by NdisMAllocateSharedMemory or NdisMAllocateSharedMemoryAsync.
- NdisMGetDmaAlignment
Returns the alignment requirements of the DMA system for the NIC. A miniport driver can use this function to determine alignment requirements for DMA buffers that it allocates.
- NdisMInitializeScatterGatherDma
Reserves system resources for use with DMA devices.
- NdisMReadDmaCounter
Reads the current value of the system DMA controller counter.
- NdisMRegisterDmaChannel
Sets up a DMA channel for future subordinate DMA operations.
- NdisMSetupDmaTransfer
Sets up the host system DMA controller for a subordinate DMA transfer.
- NdisMStartBufferPhysicalMapping
Creates a physical address mapping for a bus-master DMA operation. Called only by drivers that call NdisMAllocateMapRegisters during DMA initialization.
NdisMUpdateSharedMemory
This function is obsolete for Windows Vista and later.Ensures that data to be read from a shared memory region is up-to-date during bus-master DMA operations.