Microsoft Windows CE 3.0  

MiniportSend

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

MiniportSendtransfers a protocol-supplied packet over the network.

NDIS_STATUS
MiniportSend(
IN NDIS_HANDLE
MiniportAdapterContext, 
IN PNDIS_PACKET
Packet, 
IN UINT
Flags
);

Parameters

MiniportAdapterContext
Specifies the handle to a miniport-allocated context area in which the driver maintains per-network adapter state, set up by MiniportInitialize.
Packet
Points to a packet descriptor specifying the data to be transmitted.
Flags
Specifies the packet flags, if any, set by the protocol.

Return Values

MiniportSendcan return one of the following values:

NDIS_STATUS_SUCCESS
The driver (or its network adapter) has accepted the packet data for transmission, so MiniportSendis returning the packet, which NDIS will return to the protocol.
NDIS_STATUS_PENDING
The driver will complete the packet asynchronously with a call to NdisMSendComplete.
NDIS_STATUS_RESOURCES
The driver (or network adapter) currently has insufficient resources available to process the given packet so NDIS should queue the send packet for a resubmission when the driver next calls NdisMSendResourcesAvailableor NdisMSendComplete.
NDIS_STATUS_FAILURE
The given packet was invalid or unacceptable to the network adapter.

Comments

MiniportSendcan safely access the packet and all buffer descriptors chained to the packet until the given packet is complete. If MiniportSendreturns a status other than NDIS_STATUS_PENDING or NDIS_STATUS_RESOURCES, the request is considered complete and ownership of the packet descriptor and all memory associated with the packet reverts to the allocating protocol.

If MiniportSendreturns NDIS_STATUS_PENDING, the driver subsequently must signal completion of the request by calling NdisMSendComplete. When MiniportSendreturns NDIS_STATUS_RESOURCES, the NDIS library reflects this status to the protocol as NDIS_STATUS_PENDING.

When this function returns a packet with NDIS_STATUS_RESOURCES, the next packet submitted to MiniportSendis the same packet it just returned to NDIS. Consequently, MiniportSendcan optimize by retaining information about such a returned packet if the driver currently has sufficient resources to store the information. NDIS assumes MiniportSendis ready to accept that packet as soon as the driver calls NdisMSendResourcesAvailableor NdisMSendComplete, whichever occurs first.

Each protocol driver must pass packet descriptors to NdisSendthat are fully set up to be passed by the underlying driver's MiniportSendfunction to its network adapter. That is, the protocol is responsible for determining what is required, based on the medium type selected by the miniport to which the protocol bound itself. However, a protocol can supply net packets mapped by the chained buffer descriptors that are shorter than the minimum for the selected medium, which MiniportSendmust pad if its medium imposes a minimum-length requirement on transmits.

Any NDIS intermediate driver that layers itself betwen a higher-level protocol and an underlying network adapter driver has the same responsibility as any protocol driver to set up packets according to the requirements of the underlying miniport and its selected medium. Such an intermediate driver must repackage each incoming send packet in a fresh packet descriptor that was allocated by the intermediate driver.

MiniportSendcan use only the eight-byte area at MiniportReservedwithin the NDIS_PACKETstructure for its own purposes. Consequently, an NDIS intermediate driver that forwards send requests to an underlying network adapter driver must repackage the packets input to its MiniportSendfunction in fresh packet descriptors, which the intermediate driver allocates from packet pool, so that the underlying miniport has a MiniportReservedarea it can use.

MiniportSendcan call NdisQueryPacketto 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, NdisQueryBuffer, or NdisQueryBufferOffsetto extract information about individual buffers containing the data to be transmitted.

The Flagsparameter can provide information about a send that is not contained in the packet data itself. Currently, there are no system-defined flags, but a pair of closely coupled protocol and miniport drivers can pass information in this parameter, which MiniportSendcan retrieve with NdisGetPacketFlags. However, such a pair of drivers can communetwork adapterate more information, such as timestamps and packet priority, in the NDIS_PACKET_OOB_DATA block associated with each packet descriptor.

If the underlying driver's MiniportQueryInformationfunction set the NDIS_MAC_OPTION_NO_LOOPBACK flag when the NDIS library queried the OID_GEN_MAC_OPTIONS, the miniport must not attempt to loop back any packets. The NDIS library provides software loopback support for such a driver.

MiniportSendcan be pre-empted by an interrupt.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MiniportInitialize, MiniportQueryInformation, NdisGetFirstBufferFromPacket, NdisGetPacketFlags, NdisMSendComplete, NdisMSendResourcesAvailable, NdisQueryBuffer, NdisQueryBufferOffset, NdisQueryPacket, NdisSend