Partager via


How Your Miniport Driver Interfaces with NDIS (Compact 7)

3/12/2014

NDIS miniport drivers directly manage network adapters that are installed on a device. NDIS miniport drivers have two basic functions:

  • Manage a network adapter, including sending and receiving data through the adapter.
  • Interface with higher level drivers such as intermediate drivers and protocol drivers.

Each miniport driver communicates with its network adapter and with higher level drivers through the NDIS library, also referred to as the NDIS wrapper. The following diagram is a simplified representation of how an NDIS miniport driver interfaces with other components in the NDIS architecture:

NDIS Stack

As shown in the preceding figure, the miniport driver communicates with protocol drivers and adapter hardware through the NDIS wrapper. The NDIS wrapper provides an interface to the upper and lower edges of the miniport driver. At the lower edge, the miniport driver uses NDIS to communicate with the adapter hardware. At the upper edge, the miniport driver presents an interface to enable protocol drivers (and intermediate drivers) to configure the adapter and to send and receive packets over the network. The NDIS wrapper also abstracts portions of the OS and provides support functions for the miniport driver to use for accessing network adapter hardware.

The NDIS Wrapper exports a set of functions (NdisMXxx and NdisXxx functions) that encapsulate all OS functions that a miniport driver must call. The NDIS 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 describe the interaction of a miniport driver with NDIS and higher level drivers:

  • When a protocol driver has a packet to transmit, it calls an NdisXxx function exported by the NDIS wrapper. NDIS then passes the packet to the miniport driver by calling the appropriate MiniportXxx function that is exported by the miniport driver. The miniport driver then forwards the packet to the network adapter for transmission by calling the appropriate NdisXxx functions.
  • When a network adapter receives a packet, it can post a hardware interrupt that is handled by NDIS or the network adapter's miniport driver. NDIS notifies the network adapter's miniport driver by calling the appropriate MiniportXxx function. The miniport driver sets up the transfer of data from the network adapter and then indicates the presence of the received packet to higher level protocol drivers by calling the appropriate NdisXxx function.

Your miniport driver maintains information about its capabilities and status, in addition to information about each network adapter that it controls. An object identifier (OID) identifies each information type. NDIS and higher level drivers can query and, in some cases, set information using OIDs. Higher level drivers call NdisOidRequest to query the capabilities or status of an adapter or set the state of an adapter. NDIS, in turn, calls the miniport driver's MiniportOidRequest function to respond to the query or set operation.

NDIS miniport drivers can be serialized or deserialized:

  • A serialized miniport driver relies on NDIS to serialize calls to its MiniportXxx functions and to manage its send queues.
  • A deserialized driver serializes the operation of its own MiniportXxx functions and internally queues all incoming send packets.

All NDIS 6.0 miniport drivers must be deserialized drivers. If your NDIS 5.x miniport driver is serialized, you must convert it to a deserialized driver for it to work with NDIS 6.0. For more information about deserialized miniport drivers, see Deserialized NDIS Miniport Drivers [Reference].

See Also

Concepts

NDIS Driver Overview