NdisMIndicateReceiveNetBufferLists function

Miniport drivers call the NdisMIndicateReceiveNetBufferLists function to indicate the receipt of data from the network.

Syntax


VOID NdisMIndicateReceiveNetBufferLists(
  _In_  NDIS_HANDLE MiniportAdapterHandle,
  _In_  PNET_BUFFER_LIST NetBufferLists,
  _In_  NDIS_PORT_NUMBER PortNumber,
  _In_  ULONG NumberOfNetBufferLists,
  _In_  ULONG ReceiveFlags
);

Parameters

MiniportAdapterHandle [in]

The miniport handle that NDIS passed to the MiniportInitializeEx function.

NetBufferLists [in]

A linked list of NET_BUFFER_LIST structures that the miniport driver allocated.

PortNumber [in]

A port number that identifies a miniport adapter port. To assign a miniport adapter port number, call the NdisMAllocatePort function. A zero value identifies the default port of a miniport adapter. Use the default port if the miniport driver has not allocated ports for the specified adapter.

NumberOfNetBufferLists [in]

The number of NET_BUFFER_LIST structures that are in the linked list of structures at NetBufferLists .

ReceiveFlags [in]

Flags that define attributes for the send operation. The flags can be combined with an OR operation. To clear all the flags, set this member to zero. This function supports the following flags:

NDIS_RECEIVE_FLAGS_DISPATCH_LEVEL

Specifies that the current IRQL is DISPATCH_LEVEL. For more information about this flag, see Dispatch IRQL Tracking.

NDIS_RECEIVE_FLAGS_RESOURCES

Specifies that the miniport driver reclaims ownership of the NET_BUFFER_LIST structures and any attached NET_BUFFER structures immediately after the call to NdisMIndicateReceiveNetBufferLists returns.

NDIS_RECEIVE_FLAGS_SINGLE_ETHER_TYPE

Specifies that all of the NET_BUFFER_LIST structures in the list at NetBufferLists have the same protocol type (EtherType).

NDIS_RECEIVE_FLAGS_SINGLE_VLAN

Specifies that all of the NET_BUFFER_LIST structures in the list at NetBufferLists belong to the same VLAN.

NDIS_RECEIVE_FLAGS_PERFECT_FILTERED

Specifies that all of the NET_BUFFER_LIST structures in the list at NetBufferLists include only data that matches the packet filter and multicast address list that are assigned to the miniport adapter.

NDIS_RECEIVE_FLAGS_SINGLE_QUEUE

Specifies that all the NET_BUFFER_LIST structures in the list at NetBufferLists belong to the same VM queue. A miniport driver must set this flag for all receive indications on a queue if the NDIS_RECEIVE_QUEUE_PARAMETERS_PER_QUEUE_RECEIVE_INDICATION flag was set in the Flags member of the NDIS_RECEIVE_QUEUE_PARAMETERS structure when that queue was allocated.

NDIS_RECEIVE_FLAGS_SHARED_MEMORY_INFO_VALID

Specifies that all the NET_BUFFER_LIST structures in the list at NetBufferLists contain shared memory information that is valid. When this flag is set on a received NET_BUFFER_LIST, NDIS treats the shared memory information as valid. When this flag is not set, NDIS and drivers ignore the shared memory information. For example, intermediate drivers that modify packet data can use this flag to determine if data should be copied. Miniport drivers can use the flag to determine how to free the memory that is associated with a VM queue when a queue is deleted.

NDIS_RECEIVE_FLAGS_MORE_NBLS

Reserved.

Return value

None

Remarks

A miniport driver typically calls the NdisMIndicateReceiveNetBufferLists function from its MiniportInterruptDPC function. When a miniport driver calls NdisMIndicateReceiveNetBufferLists, it specifies a list of NET_BUFFER_LIST structures in the NetBufferLists parameter. NDIS passes the NET_BUFFER_LIST structures to the ProtocolReceiveNetBufferLists function of bound protocol drivers.

Miniport drivers must set the SourceHandle member of each NET_BUFFER_LIST structure to the same value as the MiniportAdapterHandle parameter.

If a miniport driver calls NdisMIndicateReceiveNetBufferLists and clears the NDIS_RECEIVE_FLAG_RESOURCES flag in the ReceiveFlags parameter, NDIS returns the indicated NET_BUFFER_LIST structures to the miniport driver's MiniportReturnNetBufferLists function. In this case, the miniport driver must not reclaim the NET_BUFFER_LIST structures until NDIS returns the NET_BUFFER_LIST structures to the miniport driver's MiniportReturnNetBufferLists function.

If a miniport driver calls NdisMIndicateReceiveNetBufferLists and sets the NDIS_RECEIVE_FLAG_RESOURCES flag in the ReceiveFlags parameter, this indicates that the miniport driver must regain ownership of the NET_BUFFER_LIST structures immediately. In this case, NDIS does not call the miniport driver's MiniportReturnNetBufferLists function to return the NET_BUFFER_LIST structures. Instead, NDIS returns the NET_BUFFER_LIST structures to the miniport driver upon return from NdisMIndicateReceiveNetBufferLists. The miniport driver should reclaim the NET_BUFFER_LIST structures immediately after NdisMIndicateReceiveNetBufferLists returns. To reclaim the NET_BUFFER_LIST structures, a miniport driver can call its own MiniportReturnNetBufferLists function.

Setting the NDIS_RECEIVE_FLAG_RESOURCES flag in the ReceiveFlags parameter forces the protocol drivers to copy the network data and release the NET_BUFFER_LIST structures to the miniport driver. Driver writers should design their miniport drivers with enough preallocated NET_BUFFER_LIST structures to avoid unnecessary copying.

The caller of NdisMIndicateReceiveNetBufferLists must properly initialize the NET_BUFFER_LIST structures, attached NET_BUFFER structures, and any attached MDLs.

Requirements

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

Irql_SendRcv_Function

See also

MiniportInitializeEx
MiniportInterruptDPC
MiniportReturnNetBufferLists
NDIS_RECEIVE_QUEUE_PARAMETERS
NdisMAllocatePort
NET_BUFFER
NET_BUFFER_LIST
ProtocolReceiveNetBufferLists

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft