Partager via


NdisMIndicateReceiveNetBufferLists (Compact 7)

3/12/2014

Miniport drivers call this 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

  • NetBufferLists
    A linked list of NET_BUFFER_LIST structures that the miniport driver allocated.
  • PortNumber
    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
    The number of NET_BUFFER_LIST structures that are in the linked list of structures at NetBufferLists.
  • ReceiveFlags
    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.
    • 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 the NET_BUFFER_LIST structures in the list at NetBufferLists have the same protocol type (EtherType).
    • NDIS_RECEIVE_FLAGS_SINGLE_VLAN
      Specifies that all the NET_BUFFER_LIST structures in the list at NetBufferLists belong to the same VLAN.
    • NDIS_RECEIVE_FLAGS_PERFECT_FILTERED
      Specifies that all the NET_BUFFER_LIST structures in the list at NetBufferLists include only data that matches the packet filter and multicast list that are assigned to the miniport adapter.

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 so that NDIS can return the NET_BUFFER_LIST structures to the correct miniport driver.

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 correctly initialize the NET_BUFFER_LIST structures, attached NET_BUFFER structures, and any attached MDLs.

Requirements

Header

ndis.h

See Also

Reference

NDIS Send and Receive Functions for Miniport Drivers
MiniportInitializeEx
NET_BUFFER
NET_BUFFER_LIST