NDIS Miniport Drivers (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.
An NDIS miniport driver (also called a miniport driver) has two basic functions:
Managing a network interface card (NIC), including sending and receiving data through the NIC.
Interfacing with higher-level drivers, such as intermediate drivers and transport protocol drivers.
A miniport driver communicates with its NIC and with higher-level drivers through the NDIS library. The NDIS library exports a full set of functions (NdisXxx functions) that encapsulate all of the operating system functions that a miniport driver must call. The miniport driver, in turn, must export a set of entry points ( MiniportXxx functions) that NDIS calls for its own purposes, or on behalf of higher-level drivers, to access the miniport driver.
The following send and receive operations illustrate the interaction of miniport drivers with NDIS and with higher-level drivers:
When a transport driver has a packet to transmit, it calls an NdisXxx function exported by the NDIS library. NDIS then passes the packet to the miniport driver by calling the appropriate MiniportXxx function exported by the miniport driver. The miniport driver then forwards the packet to the NIC for transmission by calling the appropriate NdisXxx functions.
When a NIC receives a packet addressed to itself, it can post a hardware interrupt that is handled by NDIS or the NIC's miniport driver. NDIS notifies the NIC's miniport driver by calling the appropriate MiniportXxx function. The miniport driver sets up the transfer of data from the NIC and then indicates the presence of the received packet to bound higher-level drivers by calling the appropriate NdisXxx function.
NDIS supports miniport drivers for both connectionless environments and connection-oriented environments.
Connectionless miniport drivers control NICs for connectionless network media, such as Ethernet, FDDI, and Token Ring. Connectionless miniport drivers are further divided into the following subtypes:
Serialized drivers that rely on NDIS to serialize calls to their MiniportXxx functions and to manage their send queues.
Deserialized drivers that serialize the operation of their own MiniportXxx functions and that internally queue all incoming send packets. This results in significantly better full-duplex performance, provided that the driver's critical sections (code that only a single thread at a time can execute) are kept small.
Connection-oriented miniport drivers control NICs for connection-oriented network media, such as ATM and ISDN. Connection-oriented miniport drivers are always deserialized -- they always serialize the operation of their own MiniportXxx functions and queue internally all incoming send packets.
An NDIS miniport driver can have a non-NDIS lower edge (see the following figure).
Through its non-NDIS lower edge, a miniport driver uses the class interface for a bus, such as the Universal Serial Bus (USB) or IEEE 1394 (FireWire) to control a device on the bus. The miniport driver communicates with the device by sending I/O request packets (IRPs) either to the bus or directly to remote devices that are attached to the bus. At its upper edge, the miniport driver exposes a standard NDIS miniport driver interface, which enables the miniport driver to communicate with overlying NDIS drivers.
NDIS also supports Wide Area Network (WAN) extensions for miniport drivers that manage WAN NICs. For more information about the WAN network environment, see Environment for WAN Network Drivers.