5.4.1 Indicating Received Data
A WAN miniport calls NdisMWanIndicateReceive to indicate that a packet has arrived and that the entire packet (there is no lookahead) is available for inspection. When this call is made, NDISWAN indicates the arrival of the packet to the ProtocolReceive handlers of bound higher-level drivers.
Since the entire packet is always passed up, the miniport driver will never receive a transfer-data call (the data is copied by NDISWAN and then passed up to the next higher driver). The entire packet is always passed up due to compression and encryption that might have been applied to the packet. Also, because the link is point-to-point, at least one bound protocol will always want to look at the packet.
The data contained in the header is the same as that received on the NIC. The NIC driver will not remove any headers or trailers from the data it receives. The transmitting driver cannot add padding to the packet.
A WAN miniport calls NdisMWanIndicateReceiveComplete to indicate the end of one or more receive indications so that protocols can postprocess received packets. As a result, NDISWAN calls the ProtocolReceiveComplete handler(s) of bound protocols to notifying each protocol that it can now process the received data. In its receive-complete handler, a protocol need not operate under the severe time constraints that it does in its receive handler.
The protocol should assume that interrupts are enabled during the call to ProtocolReceiveComplete. In an SMP machine, the receive handler and the receive complete handler can be running concurrently on different processors.
Note that a WAN driver need not deliver NdisMWanIndicateReceiveComplete indications in one-to-one correspondence with NdisMWanIndicateReceive indications. It can issue a single receive-complete indication after several receive indications have occurred. For example, a WAN miniport could call NdisMWanIndicateReceiveComplete from its receive handler every ten packets or before exiting the handler, whichever occurs first.