3.1.3.3  Choosing a Send Function

A miniport NIC driver can handle sends in either of two ways:

1.By supplying a MiniportSendPackets function

In this case, the miniport receives more than one packet in a single call, passed as an array of pointers to packets to send to its adapter.

2.By supplying a MiniportSend function

In this case, a miniport receives a single packet at its MiniportSend function for sending to its adapter.

A miniport NIC driver developer can choose to support one or the other but not both of these functions, that is, when it calls NdisMRegisterMiniport, it supplies either a MiniportSend or a MiniportSendPackets handler but not both. The choice is based on whether the miniport’s NIC can handle multipacket sends, in which case, the performance of the driver is better than if it handles single packets.

If a miniport NIC driver supplies both entry points in NDIS_MINIPORT_CHARACTERISTICS, NDIS will always call MiniportSendPackets to pass send requests to the miniport.

To recapitulate, a miniport NIC driver must decide whether it will accept several send packets or only one packet per send request. If it can accept several send packets, it registers a SendPacketsHandler with NdisMRegisterMiniport. Otherwise, the miniport registers a SendHandler.

Generally, a miniport provides a MiniportSendPackets function if either of the following are true:

·The NIC has hardware support that can achieve enhanced performance by transmitting several packets at a time; that is, a busmaster DMA device with a ring. For such a NIC, the miniport can set up the ring with some number of packets and transmit them in a single operation.

·Although the driver’s NIC can only send one packet at a time, improved performance can be attained by queuing several packets internally to the driver and avoiding the latency of additional calls to MiniportSend incurred when packets are sent one at a time.