A miniport NIC driver indicates one or more packets to interested protocol drivers by calling NdisMIndicateReceivePacket. A pointer to the complete packet is passed up to interested protocol drivers. Each of the packets indicated up must be completed separately. The return status is set in each packet before NdisMIndicateReceivePacket returns. Any packet for which NdisMIndicateReceivePacket returns a pending status is kept by the upper-layer(s) and must be returned later to the miniport’s MiniportReturnPacket function. If NdisMIndicateReceivePacket returns any status but NDIS_STATUS_PENDING, ownership of the packet reverts to the miniport NIC driver.
Ownership of the array containing pointers to the indicated packets reverts to the miniport NIC driver on return from NdisMIndicateReceivePacket, regardless of the return status of any individual packet.
Indicating and transferring received data synchronously
When the NIC receives a data packet over the network, its miniport indicates the packet up by calling NdisM(Arc/Eth/Fddi/Tr)IndicateReceive, depending on the type of network (ARCNET, Ethernet, FDDI, or Token Ring). The miniport indicates up a partial packet or possibly the complete packet if it is small enough. NDIS indicates the packet to all interested protocols. If it is a partial packet, and a protocol is interested in the complete packet, it calls NdisTransferData to transfer the remaining net packet data, passing a protocol-allocated packet descriptor.
NDIS then initiates the transfer of the data to the protocol-allocated buffers chained to the packet descriptor by calling the miniport’s MiniportTransferData function. MiniportTransferData copies the received data frames into the buffers that were passed to MiniportTransferData.
MiniportTransferData is another possibly asynchronous function. If the function completes synchronously, it simply writes the received data into the provided packet and returns a status other than NDIS_STATUS_PENDING.
Indicating and transferring received data asynchronously
If MiniportTransferData is unable to complete the transfer data operation before returning, it returns NDIS_STATUS_PENDING. The miniport must call NdisMTransferDataComplete when the data has been transferred.
Once all incoming data frames have been received by the NIC, the miniport calls NdisM(Arc/Eth/Fddi/Tr)IndicateReceiveComplete. This results in a call to the overlying protocol driver to indicate that post-receive processing can be performed.