1.2.3 Intermediate Driver Query and Set Operations

An intermediate driver, after it has successfully bound to an underlying NIC and initialized its virtual NIC(s), calls NdisRequest to query the operating characteristics of the underlying NIC driver and to set its internal state, as well as to negotiate such parameters as lookahead buffer size for the binding with the underlying NIC driver, if appropriate.

An intermediate driver can also receive query and set requests at its MiniportQueryInformation and MiniportSetInformation functions, respectively, and either respond to those requests or pass them down to the underlying driver.

The Network Driver Reference contains information about all the general, non-media-specific OIDs and about required media-specific OIDs of interest to intermediate driver developers. The following mentions typical and commonly used general category OIDs and a few media-specific OIDs.

Issuing Set and Query Requests

An intermediate driver generally issues an OID_GEN_MAXIMUM_FRAME_SIZE request to query the maximum frame size, in bytes, supported by an underlying NIC driver. The size returned does not include the header.

The intermediate driver can query a binding with OID_GEN_MAXIMUM_TOTAL_SIZE to determine the largest packet an underlying NIC driver can accommodate on the NIC it manages. The intermediate driver must always set up send packets that conform to this size. It is an error for an overlying driver to submit a larger packet than a NIC driver to which it is bound can support.

The intermediate driver can query the size of the lookahead data buffer. The OID used is OID_GEN_CURRENT_LOOKAHEAD. If the intermediate driver issues this as a query request, NDIS returns the current lookahead buffer size for the given binding to the underlying NIC driver. If the intermediate driver makes a set request, it indicates its preferred lookahead buffer size but the intermediate driver is not assured that the underlying NIC driver will conform to this.

The intermediate driver queries the underlying NIC driver for its link speed with OID_GEN_LINK_SPEED and uses the response to set any internal time-out values it maintains. If the intermediate driver is bound to a WAN NIC driver, it cannot determine the link speed until it receives a line-up indication, meaning a connection has been established between the local node and a remote node. See Part 2, Chapter 5, for a description of the line-up indication.

The intermediate driver must also issue an OID_GEN_MAC_OPTIONS to determine the set of operating characteristics of the underlying NIC driver. This OID returns such information as whether the underlying driver supports full-duplex transmits and receives.

The intermediate driver usually issues an OID_GEN_MAXIMUM_SEND_PACKETS query, particularly if the intermediate driver exports a MiniportSendPackets function. Such an intermediate driver can propagate the returned value when it, in turn, responds to an OID_GEN_MAXIMUM_SEND_PACKETS query from a still higher level driver.

An intermediate driver also can query the medium-dependent current address with a medium-specific OID, such as OID_WAN_CURRENT_ADDRESS, OID_802_3_CURRENT_ADDRESS, OID_802_5_CURRENT_ADDRESS, or OID_FDDI_LONG_CURRENT_ADDRESS.

If needed, the intermediate driver issues a set request to inform NDIS of its operating characteristics, by passing OID_GEN_PROTOCOL_OPTIONS to NdisRequest.

An intermediate driver bound to a WAN-capable NIC must also make the following set-information requests:

Responding to Sets and Queries

Because an intermediate NDIS driver is bound to by an overlying NDIS driver, it can also receive queries and sets at its MiniportQueryInformation and MiniportSetInformation functions. In some cases, the intermediate driver just passes such requests through to the underlying NIC driver. Otherwise, it can respond to these queries and sets as appropriate to the medium it exports at its upper edge.

Typically, the general OIDs received by an intermediate driver will be the same or similar to those that the intermediate driver makes to the underlying NIC driver. The medium-specific OIDs received by an intermediate driver will be the type of the medium expected by the overlying driver.