Registering MiniportXXX Functions (Windows Embedded CE 6.0)

1/6/2010

Each address member of the NDIS_MINIPORT_CHARACTERISTICS structure must be initialized. To initialize, the address members must be set to the address of a miniport-supplied function or to NULL. The miniport must supply entry points for all mandatory MiniportXXX functions; otherwise, NDIS will unload the driver. The MiniportXXX functions are defined in the Ndis.h file.

Because the miniport supplies the addresses, and not the names, of its MiniportXXX functions, driver developers are free to name these functions whatever they want. A reasonable miniport-development strategy is to give these functions names that make debugging easier. For instance, the miniport NIC driver Mp.sys could name the entry points MpISR, MpSend, and so on.

Some MiniportXXX functions are optional. For instance, if a NIC does not generate interrupts, the miniport must poll its NIC. Such a miniport must have a MiniportTimer function but does not need a MiniportISR function, a MiniportEnableInterrupt function, or a MiniportDisableInterrupt function.

A typical miniport driver uses a small number of functions to communicate through NDIS with the upper layers and hardware. NDIS calls MiniportXXX functions to communicate with a miniport on its own behalf or on the behalf of a protocol driver.

NDIS NIC miniports and upper-layer drivers use the NDIS library, called Ndis.sys, to communicate with each other through calls to NdisXXX functions.

The following table shows the NDIS Driver Upper-Edge Functions, or miniport driver functions, that a miniport can export.

Function Description Asynchronous operation

DriverEntry

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

Not applicable

MiniportCheckForHang

Checks the internal state of the NIC.

No

MiniportDisableInterrupt

Disables the NIC from generating interrupts.

No

MiniportEnableInterrupt

Enables the NIC to generate interrupts.

No

MiniportHalt

Deallocates and deregisters resources 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

MiniportQueryInformation

Queries the capabilities and status of the miniport driver.

Yes

MiniportReconfigure

Currently, the NDIS library never calls this function, but a MiniportInitialize function can call a MiniportReconfigure function as an internal driver function.

Not Applicable

MiniportReset

Issues a hardware reset to the NIC.

Yes

MiniportReturnPacket

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

No

MiniportSend

Transmits a packet through the NIC onto the network. Required if the driver has no MiniportSendPackets or MiniportWanSend function.

Yes

MiniportSendPackets

Transmits an array of packets through the NIC onto the network.

Yes

MiniportSetInformation

Changes information about the miniport driver or its NIC.

Yes

MiniportShutdown

Restores a NIC to its initial state when the system is shut down.

No

MiniportSynchronizeISR

Synchronizes access to resources shared with MiniportISR or MiniportDisableInterrupt.

No

MiniportTransferData

Copies the contents of a packet received by the NIC into a given packet buffer.

Yes

MiniportWanSend

Transmits a packet through the NIC onto the network. Required if the driver controls a WAN NIC.

No

Many miniport functions can operate either synchronously or asynchronously. The asynchronous functions have functions that must be called when an operation is finished, as shown in the following table. For example, if a protocol driver calls the NdisReset function to reset a NIC, the miniport's MiniportReset function can change the reset operation by returning NDIS_STATUS_PENDING. Eventually, the MiniportReset function must call the NdisMResetComplete function to indicate the final status of the reset request.

The following table shows the NDIS completion function that corresponds to each possibly asynchronous upper-edge miniport driver function.

Function Completion function

MiniportSend,MiniportSendPackets

NdisMSendComplete

MiniportQueryInformation

NdisMQueryInformationComplete

MiniportReset

NdisMResetComplete

MiniportSetInformation

NdisMSetInformationComplete

MiniportTransferData

NdisMTransferDataComplete

See Also

Concepts

Miniport Drivers
Choosing a Send Function
Choosing a Receive Function
Registering a CheckForHang Handler