Sending Packets from a Connection-Oriented Protocol Driver (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

A connection-oriented protocol driver can transmit one or more packets with the NdisCoSendPacketsfunction, passing in a pointer to an array of pointers to one or more packet descriptors.

When a protocol driver calls NdisCoSendPacketsto transmit one or more packets, send operations are always asynchronous. The protocol driver relinquishes ownership of the packet resources that it allocated until NDIS returns each packet descriptor and the final status of the send for that packet to ProtocolCoSendComplete.

As a consequence, on return from NdisCoSendPackets, a protocol driver never reads the Statusmember in the OOB block associated with a packet descriptor. The protocol driver cannot learn the status of its send request in this manner because the Statusmember is in use by NDIS. NDIS uses the Statusmember to track the progress of an in-transition send request and it is volatile until NDIS returns the packet descriptor to ProtocolCoSendComplete. A protocol driver always obtains the status of a transmit request from the Statusparameter passed to ProtocolCoSendComplete.

A protocol driver can request the transmission of an array of packets of different priorities by arranging the packets it receives from clients. The protocol driver should place the highest priority packets at the beginning of the array. NDIS always preserves the order of packets in any array passed to NdisCoSendPackets.

NDIS does not attempt to examine and make queuing decisions based on any of the OOB data associated with the packet descriptors given to NdisCoSendPackets. Unless a protocol driver can determine the manner in which the underlying miniport driver handles packet priorities or the TimeToSendtime stamps, the protocol driver should proceed as if the underlying miniport driver transmits all packets in the order in which it receives them. Consequently, a protocol driver should order the packet arrays it sends according to the order in which those packets should be transmitted over the network.

 

 

Send comments about this topic to Microsoft