Previous Next

NdisFlushBuffer

NdisFlushBuffer flushes the memory region described by a given buffer descriptor from all processor caches.

VOID
  NdisFlushBuffer(
    IN PNDIS_BUFFER  Buffer,
    IN BOOLEAN  WriteToDevice
    );

Parameters

Buffer
Pointer to a buffer description mapping a buffer from which or into which data is transferred as a bus-master DMA operation.
WriteToDevice
Specifies TRUE if the NIC driver calls this function to flush a buffer before making a transfer from host memory to the NIC.

If the NIC driver specifies FALSE, it must ensure the buffer begins and ends on a cache-line boundary.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

Drivers of bus-master DMA NICs call NdisFlushBuffer to maintain data integrity in shared memory. Flushing the buffer ensures coherency between the host memory cache and processor physical memory before a DMA transfer to or from the network interface card.

The driver flushes such a buffer when data that it shares with its NIC might be cached. For any transfer between host memory and a bus-master DMA NIC, the miniport driver must flush the buffer before the transfer starts. Such a driver also must ensure that host memory is not accessed until the transfer completes.

Callers of NdisFlushBuffer run at IRQL <= DISPATCH_LEVEL.

See Also

MiniportHandleInterrupt, NdisMAllocateSharedMemory, NdisMUpdateSharedMemory