NDIS_WAN_PACKET

typedef struct _NDIS_WAN_PACKET {

LIST_ENTRY WanPacketQueue;

PUCHAR CurrentBuffer;

ULONG CurrentLength;

PUCHAR StartBuffer;

PUCHAR EndBuffer;

PVOID ProtocolReserved1;

PVOID ProtocolReserved2;

PVOID ProtocolReserved3;

PVOID ProtocolReserved4;

PVOID MacReserved1;

PVOID MacReserved2;

PVOID MacReserved3;

PVOID MacReserved4;

} NDIS_WAN_PACKET, *PNDIS_WAN_PACKET;

NDIS_WAN_PACKET defines the packet passed to the MiniportWanSend functions of WAN NIC drivers.

Members

WanPacketQueue

Specifies the head of the send packet queue, used by MiniportWanSend while the miniport is processing this packet.

CurrentBuffer

Specifies the base virtual address within the given buffer at which the net packet to be transmitted starts.

CurrentLength

Specifies the number of bytes of network packet data.

StartBuffer

Specifies the base virtual address for the given buffer, including padding.

EndBuffer

Specifies the virtual address for the end of the given buffer, including padding.

ProtocolReservedX

Specifies members reserved for use by protocols.

MacReservedX

Specifies members that the miniport can use for its own purposes.

Comments

When a protocol calls NdisSend with an NDIS_PACKET-type transmit request for an underlying WAN NIC driver, NDISWAN transforms the given packet into a packet formatted as this structure before calling the underlying driver's MiniportWanSend function.

The StartBuffer and EndBuffer pointers specify a discrete virtual range. CurrentBuffer and CurrentLength specify a proper subrange of the range specified by StartBuffer and EndBuffer. Consequently, one of the following formulas yields the number of bytes of header or tail padding, if any, for the buffer passed in this structure to MiniportWanSend:

·HeaderPadding = CurrentBuffer - StartBuffer

·TailPadding = EndBuffer - (CurrentBuffer + CurrentLength)

NDISWAN always gives the underlying NIC driver at least as much header and tail padding as the driver returned in response to the OID_WAN_GET_INFO query during initialization.

MiniportWanSend can manipulate the buffer data in any manner. Until it completes a given send packet, either by returning a status other than NDIS_STATUS_PENDING from MiniportWanSend or by calling NdisMWanSendComplete, the NIC driver retains ownership of the given packet and of everything it specifies except the ProtocolReservedX members.

For more information about WAN-specific and about all system-defined OIDs, see Chapter 5.

See Also

MiniportQueryInformation, MiniportWanSend, NdisMWanSendComplete, NdisSend