Miniport Driver Upper-Edge Functions (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.
This section provides an overview of the upper-edge functions exported by miniport drivers. NDIS calls these functions on behalf of itself or other layers of the network software, such as a higher level protocol driver that is bound to a NIC managed by the NIC driver. A miniport driver must export some or all of the upper-edge functions.
Names of the miniport driver functions discussed here use Miniport as a generic prefix. However, functions written for an actual miniport driver should use a more descriptive prefix to make debugging easier. Because the addresses of the functions (not the names) are passed to the NDIS Library during initialization, the naming of MiniportXxx functions is at the discretion of the driver developer.
Some of the NIC driver functions are inherently synchronous, while others can complete either synchronously or asynchronously. When a miniport driver function returns NDIS_STATUS_PENDING, the miniport driver must complete the request by calling the appropriate NdisMXxxComplete function. NDIS takes care of any further coordination with other layers, calling the completion functions of those layers for asynchronous requests as required.
The following table summarizes the NDIS-defined miniport driver functions.
Function | Description | Async Option |
---|---|---|
Called by the operating system to activate and initialize the miniport driver. |
Not Applicable | |
Called to indicate that a preceding call to NdisMAllocateSharedMemoryAsyncis now complete. |
No |
|
For a specified adapter, cancels the transmission of all packets marked with a specified cancellation identifier |
No |
|
Checks the internal state of the NIC. |
No |
|
Activates a virtual connection (VC). Exported only by connection-oriented miniport drivers. |
Yes |
|
Sets up per-VC state for a VC. Exported only by connection-oriented miniport drivers. |
No |
|
Releases per-VC state for a VC. Exported only by connection-oriented miniport drivers. |
Yes |
|
Deletes a VC. Exported only by connection-oriented miniport drivers. |
No |
|
Queries the capabilities and current status of the miniport driver or changes (sets) information about the miniport driver or its NIC. Exported only by connection-oriented miniport drivers. |
Yes |
|
Transmits an array of packets through a NIC onto the network. Exported only by connection-oriented miniport drivers. |
Yes |
|
Disables the NIC from generating interrupts. |
No |
|
Enables the NIC to generate interrupts. |
No |
|
Deallocates and deregisters resources used for the NIC and halts the NIC so that it is no longer functioning. |
No |
|
Deferred processing function called to complete interrupt-driven I/O processing. |
No |
|
Initializes the NIC. |
No |
|
Runs at a high priority as the interrupt service routine for the NIC. |
No |
|
Handles notification of Plug and Play (PnP) events. |
No |
|
Queries the capabilities and current status of the miniport driver. Exported only by connectionless miniport drivers. |
Yes |
|
Not used. |
No |
|
Issues a hardware reset to the NIC. |
Yes |
|
Receives from an upper layer a packet that was previously passed up by a call to NdisMIndicateReceivePacket. |
No |
|
Transmits a packet through the NIC onto the network. Exported only by legacy connectionless miniport drivers. Required if the driver has no MiniportSendPacketsor MiniportWanSendfunction. |
Yes |
|
Transmits an array of packets through the NIC onto the network. Exported only by connectionless miniport drivers. |
Yes |
|
Changes (sets) information about the miniport driver or its NIC. Exported only by connectionless miniport drivers. |
Yes |
|
Restores a NIC to its initial state when the system is shut down. NDIS 5.1 miniport drivers should register a MiniportShutdownfunction by calling NdisMRegisterMiniport--not by calling NdisMRegisterAdapterShutdownHandler. |
No |
|
Synchronizes access to resources shared with MiniportISRor MiniportDisableInterrupt. Required if any NIC driver function that runs at less than DIRQL shares resources with that driver's MiniportISRor MiniportDisableInterruptfunction. |
No |
|
Polls the state of the NIC. |
No |
|
Copies the contents of a packet received by the NIC into a given packet buffer. Exported only by connectionless miniport drivers. |
Yes |
|
Transmits a packet through the NIC onto the network. Required if the driver controls a WAN NIC. |
No |
The following table summarizes the NDIS completion function that corresponds to each possibly asynchronous upper-edge driver function.
Function(s) | Asynchronous Completion Function |
---|---|
MiniportSend, MiniportSendPackets | |
Connection-oriented miniport drivers differ from connectionless miniport drivers with respect to MiniportXxx functions as follows:
Connection-oriented miniport drivers must be able to create, activate, deactivate and delete VCs. The MiniportCoCreateVc, MiniportCoActivateVc, MiniportCoDeactivateVc, and MiniportCoDeleteVc functions accomplish these tasks.
The MiniportSend or MiniportSendPackets function of connectionless miniport drivers are replaced by the MiniportCoSendPackets function in connection-oriented miniport drivers.
The MiniportQueryInformation and MiniportSetInformation functions of connectionless miniport drivers are replaced by the MiniportCoRequest function in connection-oriented miniport drivers.
Since connection-oriented miniport drivers always indicate complete packets to bound protocols, they do not need a MiniportTransferData function.