![]() |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function releases ownership of one or more packets after a protocol has consumed the received data.
VOID NdisReturnPackets( IN PNDIS_PACKET* PacketsToReturn, IN UINT NumberOfPackets );
Parameters
Remarks
An NDIS intermediate driver should call this function as soon as possible after its ProtocolReceivePacketfunction has returned control. Otherwise, both the underlying driver that supports multipacket receive indications and the bound protocol driver that processes them suffer a performance degradation.
When an underlying NIC driver runs low on available packet pool for receive indications or its NIC runs low on empty receive buffers, the miniport can force the NDIS library to call every bound protocol driver's ProtocolReceivefunction with a single packet descriptor at a time until the miniport has regained ownership of its packet descriptors and the NIC has receive buffers available for incoming net packets. A ProtocolReceivefunction cannot begin postprocessing a packet of received data and forwarding the processed data to clients until the driver's ProtocolReceiveCompletefunction is called.
For a packet descriptor passed in to its ProtocolReceivePacketfunction, a highest-level protocol driver can process its copy of received data and forward the processed data to clients immediately because the protocol can control how long it retains ownership of the resources allocated by the indicating driver. Assuming a highest-level protocol driver does not manipulate the data that it indicates to its clients, the protocol can even set up the range of data within the receive buffer of interest to its client, and make a receive indication to its client(s) by forwarding the input packet descriptor to those clients.
If an intermediate protocol driver's ProtocolReceivePacketfunction returns a nonzero reference count to an input packet descriptor, that driver must call this function one or more times. When it has called this function with a particular packet descriptor as many times as the value returned by ProtocolReceivePacket, the NDIS library returns the packet descriptor to the driver that made the indication. For a highest-level protocol that forwards an input packet descriptor to its clients, those clients return the packet descriptor to the NDIS driver that allocated it by making calls to the TdiReturnChainedReceivesfunction.
A protocol driver can rely on NDIS to manage the reference count for every receive packet passed to ProtocolReceivePacket. When the reference count for a packet descriptor originally set to the return from ProtocolReceivePacketgoes to 0, the NDIS library calls the indicating driver's MiniportReturnPacketfunction with the released packet descriptor.
This function cannot be called from ProtocolReceivePacket.
A driver that calls this function runs at IRQL <= DISPATCH_LEVEL.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.0 and later | Ndis.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
NdisAllocatePacket, NdisFreePacket, NdisMIndicateReceivePacket
Last updated on Tuesday, July 13, 2004