Hardware Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize

NdisFlushBuffer function

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.

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

Syntax


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

Parameters

Buffer [in]

Pointer to a buffer description mapping a buffer from which or into which data is transferred as a bus-master DMA operation.

WriteToDevice [in]

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.

Return value

None

Remarks

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.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use KeFlushIoBuffers instead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

MiniportHandleInterrupt
NdisMAllocateSharedMemory
NdisMUpdateSharedMemory

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft