Compartilhar via


NdisMSendComplete function

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.

NdisMSendComplete returns the packet and final status of a completed send request for which the driver previously returned NDIS_STATUS_PENDING.

Syntax

VOID NdisMSendComplete(
  _In_ NDIS_HANDLE  MiniportAdapterHandle,
  _In_ PNDIS_PACKET Packet,
  _In_ NDIS_STATUS  Status
);

Parameters

  • MiniportAdapterHandle [in]
    Specifies the handle originally input to MiniportInitialize.

  • Packet [in]
    Pointer to the protocol-allocated packet originally input to MiniportSend.

  • Status [in]
    Specifies the final status of the transmit request that has just been completed.

Return value

None

Remarks

The NDIS library queues incoming send packets on behalf of serialized miniports so that such miniports can deal with one device-transmit operation at a time. (A miniport driver can, however, transmit several packets per operation, depending on the capabilities of its NIC.) NDIS serializes the submission of incoming packet arrays to each serialized miniport's MiniportSendPackets function, and it serializes the submission of packets to each miniport's MiniportSend function. NDIS queues incoming send requests in FIFO order when it cannot pass on each such request immediately because the underlying serialized NIC driver is already busy.

Deserialized miniports, including all connection-oriented miniports, are responsible for accepting all send requests whenever their Miniport(Co)Send(Packets) functions are called. If necessary, a deserialized driver queues incoming send packets until the driver has sufficient resources to transmit the data over the wire. A deserialized miniport driver completes all incoming sends asynchronously with calls to NdisMSendComplete.

If a serialized miniport driver's MiniportSendPackets function sets the Status in the out-of-band data block for a packet to NDIS_STATUS_PENDING or if its MiniportSend function returns NDIS_STATUS_PENDING for an incoming packet, that miniport driver must eventually call NdisMSendComplete with the original packet to indicate which send request it has completed. While the status of such a send packet is pending, the miniport driver retains ownership of that packet descriptor and all the protocol-allocated resources associated with the packet descriptor.

A call to NdisMSendComplete causes NDIS to call the ProtocolSendComplete function of the driver that initiated the request with its call to NdisCoSendPackets, NdisSendPackets, or NdisSend. The underlying miniport's call to NdisMSendComplete releases ownership of the given packet descriptor and associated resources to the protocol driver that originally allocated them.

If the MiniportSend(Packets) function of a serialized driver returns a status other than NDIS_STATUS_PENDING for a given packet, the miniport driver never calls NdisMSendComplete with that packet. The return from MiniportSend(Packets) releases ownership of such a packet. Consequently, a serialized miniport driver must not call NdisMSendComplete with any packet for which its MiniportSend(Packets) function did not return NDIS_STATUS_PENDING. Any send packet for which a serialized NIC driver returns something other than NDIS_STATUS_PENDING should be considered inaccessible by that miniport driver as soon as its MiniportSend(Packets) function returns control.

A miniport's call to NdisMSendComplete does not necessarily mean that a particular packet has been transmitted over the wire. Usually, such a packet has been transmitted except, possibly, by the driver of a NIC in which packets can be queued in the hardware.

Miniport drivers that declared their devices of type NdisMediumWan in response to a preceding OID_GEN_MEDIA_SUPPORTED or OID_GEN_MEDIA_IN_USE request call NdisMWanSendComplete rather than NdisMSendComplete.

A miniport driver must release any spin lock that it is holding before calling NdisMSendComplete.

Serialized callers of NdisMSendComplete must run at IRQL = DISPATCH_LEVEL. Deserialized callers of NdisMSendComplete must run at IRQL <= DISPATCH_LEVEL.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisMSendNetBufferListsCompleteinstead.Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

See Remarks section

See also

MiniportInitialize

MiniportSend

MiniportSendPackets

NdisCoSendPackets

NdisMSendResourcesAvailable

NdisMWanSendComplete

NDIS_PACKET

NDIS_PACKET_OOB_DATA

NdisSend

NdisSendPackets

NDIS_SET_PACKET_STATUS

ProtocolSendComplete

 

 

Send comments about this topic to Microsoft