ProtocolReceiveComplete

VOID
    ProtocolReceiveComplete(

        IN NDIS_HANDLE  ProtocolBindingContext
        );

ProtocolReceiveComplete is a required driver function in any protocol that might bind itself to an underlying NIC driver that does not make receive indications with NdisMIndicateReceivePacket. ProtocolReceiveComplete completes postprocessing of one or more preceding receive indications.

Parameters

ProtocolBindingContext
Specifies the handle to a protocol-allocated context area in which the protocol driver maintains per-binding runtime state. The driver supplied this handle when it called NdisOpenAdapter.

Comments

ProtocolReceiveComplete performs postprocessing, such as notifying interested clients of processed data received from a remote node, after one or more calls to the driver’s ProtocolReceive function.

When an underlying miniport calls NdisM..IndicateReceiveComplete, NDIS calls the ProtocolReceiveComplete function(s) of bound protocol(s). NDIS always calls ProtocolReceiveComplete after one or more calls to the driver’s ProtocolReceive function, regardless of whether any particular packet(s) are accepted by bound protocols.

An underlying miniport need not make calls to NdisM..IndicateReceive in one-to-one correspondence with its calls to NdisM..IndicateReceiveComplete. ProtocolReceiveComplete is re-entrant because the underlying NIC driver sometimes must wait to call NdisM..IndicateReceiveComplete until no receive operations are in progress.

After ProtocolReceiveComplete is called, the underlying NIC driver can make another receive indication before ProtocolReceiveComplete returns control, so ProtocolReceiveComplete can execute concurrently with the driver’s ProtocolReceive function in SMP machines.

The ProtocolReceiveComplete function of an NDIS intermediate driver cannot simply forward completion indications to still higher-level protocols. Such an attempt can cause a deadlock. Instead, such a driver must call NdisIMSwitchToMiniport to forward the indication from the appropriate context. If NdisIMSwitchToMiniport returns FALSE, the driver must call NdisIMQueueMiniportCallback and forward the indication from a protocol-supplied MiniportCallback function.

By default, ProtocolReceiveComplete runs at IRQL PASSIVE_LEVEL in an arbitrary thread context.

See Also

NdisIMQueueMiniportCallback, NdisIMSwitchToMiniport, NdisMArcIndicateReceiveComplete, NdisMEthIndicateReceiveComplete, NdisMFddiIndicateReceiveComplete, NdisMIndicateReceivePacket, NdisMTrIndicateReceiveComplete, NdisMWanIndicateReceiveComplete, ProtocolReceive, ProtocolReceivePacket