NdisFlushBuffer (Compact 2013)

3/26/2014

This function flushes the memory region described by a specified buffer descriptor from all processor caches.

Syntax

VOID NdisFlushBuffer(
  PNDIS_BUFFER Buffer,
  BOOLEAN WriteToDevice
);

Parameters

  • Buffer
    [in] Pointer to a memory descriptor list structure that maps a buffer from which (or into which) a bus master direct memory access (DMA) network adapter transfers data.
  • WriteToDevice
    [in] Flag that specifies whether the flush operation writes data to shared memory. Specify TRUE to flush the buffer before making a transfer from shared host memory to the network adapter; otherwise, specify FALSE to write back and discard cached data before reading data from shared host memory.

Return Value

None.

Remarks

The buffer must begin and end on a cache-line boundary.

Drivers of bus master DMA network adapters call this function to maintain data integrity in shared memory. Flushing the shared memory buffer ensures coherency between the host memory cache and processor physical memory before the network adapter commences a DMA transfer operation.

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

See Also

Reference

NDIS Shared Memory Interface
NdisMAllocateSharedMemory