Previous Next

MiniportCoSendPackets

The MiniportCoSendPackets is required for connection-oriented miniports. MiniportCoSendPackets is called to transfer some number of packets, specified as an array of pointers, over the network.

VOID 
  MiniportCoSendPackets(
    IN NDIS_HANDLE  MiniportVcContext,
    IN PPNDIS_PACKET  PacketArray,
    IN UINT  NumberOfPackets
    );

Parameters

MiniportVcContext
Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains its per-VC state. The miniport driver supplied this handle to NDIS from its MiniportCoCreateVc function.
PacketArray
Pointer to the initial element in a packet array, with each element specifying the address of a packet descriptor for a packet to be transmitted, along with an associated out-of-band data block containing information such as the packet priority, an optional timestamp, and the per-packet status to be set by MiniportCoSendPackets.
NumberOfPackets
Specifies the number of pointers to packet descriptors at PacketArray.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

MiniportCoSendPackets is called by NDIS in response to a request by a bound protocol driver to send a ordered list of data packets across the network.

MiniportCoSendPackets should transmit each packet in any given array sequentially. MiniportCoSendPackets can call NdisQueryPacket to extract information, such as the number of buffer descriptors chained to the packet and the total size in bytes of the requested transfer. It can call NdisGetFirstBufferFromPacket, NdisGetFirstBufferFromPacketSafe, NdisQueryBuffer, NdisQueryBufferSafe, or NdisQueryBufferOffset to extract information about individual buffers containing the data to be transmitted.

MiniportCoSendPackets can retrieve protocol-supplied out-of-band information associated with each packet by using the appropriate NDIS_GET_PACKET_XXX macros.

MiniportCoSendPackets can use only the eight-byte area at MiniportReserved within the NDIS_PACKET structure for its own purposes.

The NDIS library ignores the OOB block in all packet descriptors it submits to MiniportCoSendPackets and assumes that every connection-oriented miniport driver is a deserialized driver that will complete each input packet descriptor asynchronously with NdisMCoSendComplete. Consequently, such a deserialized driver's MiniportCoSendPackets function usually ignores the Status member of the NDIS_PACKET_OOB_DATA block, but it can set this member to the same status as it subsequently passes to NdisMCoSendComplete.

Rather than relying on NDIS to queue and resubmit send packets whenever MiniportCoSendPackets has insufficient resources to transmit the given packets, a deserialized miniport driver manages its own internal packet queuing. Such a driver is responsible for holding incoming send packets in its internal queue until they can be transmitted over the network and for preserving the protocol-determined ordering of packet descriptors incoming to its MiniportCoSendPackets function. A deserialized miniport driver must complete each incoming send packet with NdisMCoSendComplete, and it cannot call NdisMSendResourcesAvailable.

A deserialized miniport driver should never pass STATUS_INSUFFICIENT_RESOURCES to NdisMCoSendComplete with a protocol-allocated packet descriptor that was originally submitted to its MiniportCoSendPackets function. Such a returned status effectively fails the send operation requested by the protocol, and NDIS would return the packet descriptor and all associated resources to the protocol that originally allocated it.

MiniportCoSendPackets can be called at any IRQL <= DISPATCH_LEVEL. Consequently, MiniportCoSendPackets function is responsible for synchronizing access to its internal queue(s) of packet descriptors with the driver's other MiniportXxx functions that also access the same queue(s).

See Also

MiniportCoCreateVc, MiniportCoRequest, MiniportInitialize, NdisAllocatePacket, NdisCoSendPackets, NdisGetBufferPhysicalArraySize, NdisGetFirstBufferFromPacket, NdisGetFirstBufferFromPacketSafe, NdisGetNextBuffer, NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO, NDIS_GET_PACKET_TIME_TO_SEND, NdisMCoSendComplete, NdisMoveMemory, NdisMoveToMappedMemory, NdisMSendResourcesAvailable, NdisMSetupDmaTransfer, NdisMStartBufferPhysicalMapping, NDIS_OOB_DATA_FROM_PACKET, NDIS_PACKET, NDIS_PACKET_OOB_DATA, NdisQueryBuffer, NdisQueryBufferOffset, NdisQueryBufferSafe, NdisQueryPacket, NdisZeroMemory