5.3.1 WAN-Specific Queries

MiniportQueryInformation is called to determine WAN-specific capabilities and current status. In a WAN miniport this function is the same as in a standard miniport NIC driver, except that the WAN driver recognizes WAN-specific OIDs.

If the WAN driver completes NdisMQueryInformation asynchronously by returning a status of NDIS_STATUS_PENDING, it must complete the query later by calling NdisMQueryInformationComplete. The WAN driver controls the buffers pointed to by InformationBuffer, BytesWritten, and BytesNeeded until the request completes. If the InformationBufferLength is insufficient for the information required by the OID, the WAN driver should fail the request and set BytesNeeded to the number of bytes that the OID requires.

No other requests will be submitted to the WAN driver until the current query request has been completed.

The NDISWAN driver does not pass all OIDs through to a WAN miniport. For instance, the NDISWAN driver will intercept all queries with the following OIDs:

OID_GEN_CURRENT_PACKET_FILTER
OID_GEN_PROTOCOL_OPTIONS
OID_802_5_CURRENT_FUNCTIONAL
OID_802_3_MULTICAST_LIST
OID_FDDI_LONG_MULTICAST_LIST
OID_FDDI_SHORT_MULTICAST_LIST

However, a WAN NIC driver must recognize and respond properly to the WAN OIDs summarized next.

OID_WAN_MEDIUM_SUBTYPE

This OID is queried to determine the media subtypes supported by a WAN miniport NIC driver. The WAN miniport’s MiniportQueryInformation function should return one of the following subtypes as enumerated in NDIS_WAN_MEDIUM_SUBTYPE:

OID_WAN_GET_INFO

This OID is queried to determine a range of information about the operating characteristics of a WAN miniport. The structure of this OID is documented in the Network Driver Reference. The information returned by the WAN miniport includes:

Parameter

Contents

MaxFrameSize

The driver sets this to the maximum frame size in bytes it can send and receive. Typically this is 1500 but driver should handle 32 bytes larger than its anticipated maximum. The value does not include the driver’s own framing overhead or the PPP HDLC overhead.

MaxTransmit

The default maximum number of outstanding packets the WAN miniport can handle on a line. The NDISWAN driver will insure that the miniport does not exceed that number, that is, NDISWAN will hold send packets if the maximum is reached unless the miniport has reset the maximum in a subsequent line-up indication. The miniport can change this value dynamically and on a per-line basis by setting the SendWindow member in line-up indications to a nonzero value.

HeaderPadding

The amount of required buffer space, in bytes, at the beginning of the largest packet.

TailPadding

The amount of required buffer space, in bytes, at the end of the largest packet.

Endpoints

The maximum number of links this adapter can support. This is an adapter-specific characteristic.

MemoryFlags

Zero if the adapter is not a DMA device. If the adapter supports DMA, this flag can be set to NDIS_MEMORY_NONCACHED and/or NDIS_MEMORY_CONTIGUOUS.

HighestAcceptableAddress

If the WAN miniport’s adapter supports DMA, set this flag to NDIS_PHYSICAL_ADDRESS_CONST (-1,-1), otherwise, if the adapter supports DMA and up to 24-bit addresses, set this flag to NDIS_PHYSICAL_ADDRESS_CONST (0x1000000,0). Subsequently, memory within the specified range will be allocated for all the packets to be transmitted by the NIC. Thus, memory can just be DMAed directly to the NIC instead of having to be double-buffered through a CPU-memory copy.

FramingBits

The driver sets bits that specify the types of framing the driver supports.

OID_WAN_PERMANENT_ADDRESS

The WAN miniport is queried for the address of the NIC that is encoded in the hardware.

OID_WAN_CURRENT_ADDRESS

The WAN miniport is queried for the address the NIC is currently using.

The WAN miniport NIC driver should return a unique address for each adapter. The address is presented to the protocols as an Ethernet address. The least significant bit of the first byte must not be a 1, or it could be interpreted as an Ethernet multicast address. If the vendor has an assigned Ethernet vendor code, they should be used to assure that the address does not conflict with another vendor's address.

OID_WAN_GET_LINK_INFO

The WAN miniport returns all the parameter values that were set on a previous NDIS_WAN_SET_LINK_INFO call. If NDIS_WAN_SET_LINK_INFO has not yet been called, the WAN miniport should return the current state of the link. If the link is not up or does not exist, an error NDIS_STATUS_INVALID_DATA should be returned.

The OID specifies the following types of link information.

Parameter

Contents

MiniportLinkContext

Returns the handle the miniport returned in an NDIS_LINE_UP indication.

MaxSendFrameSize

The largest buffer the WAN miniport driver will receive. A driver can fail any packets given to its MiniportWanSend function if the size of the packet exceeds this size.

MaxRecvFrameSize

The largest packet, excluding padding, that will be accepted by the driver from the network. Larger packets may be dropped.

HeaderPadding

The amount of padding, in bytes, in the head of the frame.

TailPadding

The amount of padding at the tail of the frame.

SendFramingBits

A bit mask that describes what types of framing should be sent. Must be identical to RecvFramingBits.

RecvFramingBits

A bit mask that describes what type of framing should be received.

SendCompressionBits

Reserved.

RecvCompressionBits

Reserved.

SendACCM

Specific to asynchronous media types. If present, specifies the ASCII character to be used for byte stuffing on sends.

RecvACCM

Specific to asynchronous media types. Specifies the ASCII character to be used for byte stuffing on receives.