Bewerken

Delen via


NdisMFreeNetBufferSGList function (ndis.h)

Caution

For ARM and ARM64 processors, we strongly recommend that NDIS driver writers use WDF DMA or WDM DMA instead of NDIS Scatter/Gather DMA.

For more information about WDF DMA, see Handling DMA Operations in KMDF Drivers.

For more information about WDM DMA, see the DMA-related child topics of Managing Input/Output for Drivers.

Bus-master miniport drivers call the NdisMFreeNetBufferSGList function to free scatter/gather list resources that were allocated by calling the NdisMAllocateNetBufferSGList function.

Syntax

void NdisMFreeNetBufferSGList(
  [in] NDIS_HANDLE          NdisMiniportDmaHandle,
  [in] PSCATTER_GATHER_LIST pSGL,
  [in] PNET_BUFFER          NetBuffer
);

Parameters

[in] NdisMiniportDmaHandle

A handle to a context area that NDIS uses to manage a DMA resource. The caller obtained this handle by calling the NdisMRegisterScatterGatherDma function.

[in] pSGL

A pointer to a miniport driver scatter/gather list buffer.

[in] NetBuffer

A pointer to the NET_BUFFER structure associated with the specified scatter/gather list buffer.

Return value

None

Remarks

Bus-master miniport drivers must call the NdisMFreeNetBufferSGList function to free a scatter/gather list. A miniport driver typically calls NdisMFreeNetBufferSGList from its MiniportInterruptDPC function while it is handling a send complete interrupt or at any time that the driver no longer requires the scatter/gather list. Do not call NdisMFreeNetBufferSGList while the driver or hardware is still accessing the memory that is described by the NET_BUFFER structure that is associated with the scatter/gather list.

Miniport drivers can free the buffer that was specified in the ScatterGatherListBuffer parameter of the NdisMAllocateNetBufferSGList function after NdisMFreeNetBufferSGList returns.

Before accessing received data, miniport drivers must call NdisMFreeNetBufferSGList to flush the memory cache.

Requirements

Requirement Value
Minimum supported client Supported in NDIS 6.0 and later.
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL DISPATCH_LEVEL
DDI compliance rules Irql_Gather_DMA_Function(ndis)

See also

MiniportInterruptDPC

NDIS Scatter/Gather DMA

NET_BUFFER

NdisMAllocateNetBufferSGList

NdisMRegisterScatterGatherDma