Querying a Connectionless Miniport Driver (NDIS 5.1)
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.
To query OIDs maintained by a connectionless miniport driver, a bound protocol calls NdisRequestand passes a structure of type NDIS_REQUESTthat specifies the object (OID) being queried and that points to a buffer into which NDIS eventually writes the requested information. The call to NdisRequestcauses NDIS to call the miniport driver's MiniportQueryInformationfunction, which returns the requested information to NDIS. MiniportQueryInformationcan complete synchronously or asynchronously with a call to NdisMQueryIndformationComplete.
NDIS can also call a miniport driver's MiniportQueryInformationfunction on its own behalf -- for example, after the miniport driver's MiniportInitializefunction has returned NDIS_STATUS_SUCCESS--to query the miniport driver's capabilities, status, or statistics. The following diagram illustrates querying a connectionless miniport driver.
The set of mandatory general operational OIDs for connectionless miniport drivers includes:
In particular, the miniport driver's MiniportQueryInformationfunction must be prepared to respond to OID_GEN_MAXIMUM_LOOKAHEAD, OID_GEN_MAXIMUM_SEND_PACKETS, and OID_GEN_MAC_OPTIONS.
If the miniport driver indicates received data by calling NdisXxxIndicateReceive, it should respond to OID_GEN_MAXIMUM_LOOKAHEAD with the maximum number of bytes the NIC can provide as lookahead data. If that value is different from the size of the lookahead buffer supported by bound protocols, NDIS will call MiniportSetInformationto set the size of the lookahead buffer provided by the miniport driver to the minimum of the miniport driver and protocol(s) values.
If the driver always indicates up full packets with NdisMIndicateReceivePacket, it should set this value to the maximum total packet size, which excludes the header.
If a miniport driver registers a MiniportSendPacketsfunction, MiniportQueryInformationwill be called with the OID_GEN_MAXIMUM_SEND_PACKETS request. The miniport driver must respond with the maximum number of packets it is prepared to handle on a single send request. The miniport driver should pick a maximum that minimizes the number of packets that it has to queue internally because it has no resources (its device is full). A miniport driver for a bus-master DMA NIC should attempt to pick a value that keeps its NIC filled under anticipated loads.
When MiniportQueryInformationis called with OID_GEN_MAC_OPTIONS, it must return a bitmask that specifies the optional operations that the miniport driver performs. The set of flags includes:
NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA
Indicates to a protocol driver that it is free to access indicated data by any means. If a miniport driver indicates data out of on-board shared memory, it must not set this flag.
NDIS_MAC_OPTION_NO_LOOPBACK
If set, indicates that the miniport driver does not loopback a packet passed to MiniportSend(Packets) that is directed to a receiver on the same machine, and that the miniport driver expects NDIS to perform the loopback. If NDIS performs the loopback of a packet, the packet is not passed down to the miniport driver. A miniport driver always sets this flag unless its NIC performs hardware loopbacks.
NDIS_MAC_OPTION_RECEIVE_SERIALIZED
If set, the miniport driver does not indicate any newly received packet up until the previously received packet has been fully processed, including transferring the data. Most miniport drivers, except those that indicate up packets by calling NdisMIndicateReceivePacket, set this flag.
NDIS_MAC_OPTION_TRANSFERS_NOT_PEND
If set, a miniport driver never returns NDIS_STATUS_PENDING from MiniportTransferData.
A miniport driver must never use the flag NDIS_MAC_OPTION_RESERVED, which is reserved for NDIS internal use.
MiniportQueryInformationis also queried with a media-specific OID to determine the NIC's current address. For instance, the miniport driver for a NIC of type 802.3 will be queried with OID_802_3_CURRENT_ADDRESS.
The miniport drivers for certain media types will receive additional OIDs that are media-specific. For example, a miniport driver whose NIC is of type 802.3 is queried with OID_802.3_MAXIMUM_LIST_SIZE. For more information, see General Objects.