Поделиться через


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

DriverEntry of NDIS Miniport Drivers

Called by the operating system to activate and initialize the miniport driver.

Not Applicable

MiniportAllocateComplete

Called to indicate that a preceding call to NdisMAllocateSharedMemoryAsyncis now complete.

No

MiniportCancelSendPackets

For a specified adapter, cancels the transmission of all packets marked with a specified cancellation identifier

No

MiniportCheckForHang

Checks the internal state of the NIC.

No

MiniportCoActivateVc

Activates a virtual connection (VC). Exported only by connection-oriented miniport drivers.

Yes

MiniportCoCreateVc

Sets up per-VC state for a VC. Exported only by connection-oriented miniport drivers.

No

MiniportCoDeactivateVc

Releases per-VC state for a VC. Exported only by connection-oriented miniport drivers.

Yes

MiniportCoDeleteVc

Deletes a VC. Exported only by connection-oriented miniport drivers.

No

MiniportCoRequest

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

MiniportCoSendPackets

Transmits an array of packets through a NIC onto the network. Exported only by connection-oriented miniport drivers.

Yes

MiniportDisableInterrupt

Disables the NIC from generating interrupts.

No

MiniportEnableInterrupt

Enables the NIC to generate interrupts.

No

MiniportHalt

Deallocates and deregisters resources used for the NIC and halts the NIC so that it is no longer functioning.

No

MiniportHandleInterrupt

Deferred processing function called to complete interrupt-driven I/O processing.

No

MiniportInitialize

Initializes the NIC.

No

MiniportISR

Runs at a high priority as the interrupt service routine for the NIC.

No

MiniportPnPEventNotify

Handles notification of Plug and Play (PnP) events.

No

MiniportQueryInformation

Queries the capabilities and current status of the miniport driver. Exported only by connectionless miniport drivers.

Yes

MiniportReconfigure

Not used.

No

MiniportReset

Issues a hardware reset to the NIC.

Yes

MiniportReturnPacket

Receives from an upper layer a packet that was previously passed up by a call to NdisMIndicateReceivePacket.

No

MiniportSend

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

MiniportSendPackets

Transmits an array of packets through the NIC onto the network. Exported only by connectionless miniport drivers.

Yes

MiniportSetInformation

Changes (sets) information about the miniport driver or its NIC. Exported only by connectionless miniport drivers.

Yes

MiniportShutdown

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

MiniportSynchronizeISR

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

MiniportTimer

Polls the state of the NIC.

No

MiniportTransferData

Copies the contents of a packet received by the NIC into a given packet buffer. Exported only by connectionless miniport drivers.

Yes

MiniportWanSend

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

MiniportCoActivateVc

NdisMCoActivateVcComplete

MiniportCoDeactivateVc

NdisMCoDeactivateVcComplete

MiniportCoRequest

NdisCoRequestComplete

MiniportCoSendPackets

NdisMCoSendComplete

MiniportSend, MiniportSendPackets

NdisMSendComplete

MiniportQueryInformation

NdisMQueryInformationComplete

MiniportReset

NdisMResetComplete

MiniportSetInformation

NdisMSetInformationComplete

MiniportTransferData

NdisMTransferDataComplete

 

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.

 

 

Send comments about this topic to Microsoft