다음을 통해 공유


NdisMRegisterInterruptEx (Compact 2013)

3/26/2014

NDIS miniport drivers call the NdisMRegisterInterruptEx function to register an interrupt.

Syntax

NDIS_STATUS
  NdisMRegisterInterruptEx(
    IN NDIS_HANDLE  MiniportAdapterHandle,
    IN NDIS_HANDLE  MiniportInterruptContext,
    IN PNDIS_MINIPORT_INTERRUPT_CHARACTERISTICS  MiniportInterruptCharacteristics,
    OUT PNDIS_HANDLE  NdisInterruptHandle
    );

Parameters

  • MiniportAdapterHandle
    The miniport adapter handle that NDIS passed to the MiniportInitializeEx function.
  • MiniportInterruptContext
    A pointer to a block of context information. The miniport driver allocates this memory to store information about the interrupt. NDIS passes the context information block in later calls to other functions that are associated with the interrupt.
  • MiniportInterruptCharacteristics
    A pointer to an NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS structure that the miniport driver created. The driver initializes this structure with handler entry points and configuration parameters that define the interrupt characteristics.
  • NdisInterruptHandle
    A pointer to an NDIS handle. NDIS writes the handle for the newly created interrupt object to the address that the NdisInterruptHandle pointer specifies.

Return Value

NdisMRegisterInterruptEx can return one of the following values:

Value

Meaning

NDIS_STATUS_SUCCESS

NDIS initialized the interrupt object and supplied a valid interrupt handle at NdisInterruptHandle. NDIS claimed hardware resources and set up the functions that it calls when an interrupt occurs.

NDIS_STATUS_RESOURCES

NdisMRegisterInterruptEx failed because of insufficient resources.

NDIS_STATUS_XXX or NT_STATUS_XXX

The attempt to initialize the interrupt object failed for reasons other than those in the previous list.

Remarks

A miniport driver must call NdisMRegisterInterruptEx from its MiniportInitializeEx function if it manages a network adapter that generates interrupts.

MiniportInitializeEx must call the NdisMSetMiniportAttributes function before calling NdisMRegisterInterruptEx.

The miniport driver must specify entry points for the following interrupt service functions:

  • MiniportInterrupt
    NDIS calls this function when a network adapter, or another device that shares the interrupt with the network adapter, generates an interrupt.
  • MiniportInterruptDPC
    A miniport driver must provide a MiniportInterruptDPC function if the driver calls the NdisMRegisterInterruptEx function to register an interrupt.
  • MiniportDisableInterruptEx
    NDIS can call a miniport driver's MiniportDisableInterruptEx handler to disable interrupts for diagnostic and troubleshooting.
  • MiniportEnableInterruptEx
    NDIS can call a miniport driver's MiniportEnableInterruptEx handler to enable interrupts for diagnostic and troubleshooting.

If the network adapter supports message-signaled interrupts (MSI), the miniport driver should specify entry points for the following MSI service functions:

  • MiniportMessageInterrupt
    NDIS calls this function when a network adapter generates a message-based interrupt.
  • MiniportMessageInterruptDPC
    A miniport driver must provide a MiniportMessageInterruptDPC handler if the driver calls the NdisMRegisterInterruptEx function to register an interrupt.
  • MiniportDisableMessageInterrupt
    NDIS can call a miniport driver's MiniportDisableMessageInterrupt handler to disable a message interrupt for diagnostic and troubleshooting.
  • MiniportEnableMessageInterrupt
    NDIS can call a miniport driver's MiniportEnableMessageInterrupt function to enable a message interrupt for diagnostic and troubleshooting.

If a driver specifies entry points for MSI, it must also specify entry points for the non-MSI interrupt service functions. Also, if NdisMRegisterInterruptEx returns NDIS_STATUS_SUCCESS, the driver must examine the value of the InterruptType member of the NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS structure to determine the type of interrupts NDIS granted. If NDIS cannot grant MSI support, it will grant support for line based interrupts.

When interrupts are enabled on the network adapter, a driver's MiniportInterrupt (or MiniportMessageInterrupt) function can be called at any time after the driver calls NdisMRegisterInterruptEx, even before NdisMRegisterInterruptEx returns. Therefore, a driver should not call NdisMRegisterInterruptEx until it is ready to handle an interrupt.

Drivers call the NdisMDeregisterInterruptEx function to release resources that were previously allocated with NdisMRegisterInterruptEx.

Requirements

Header

ndis.h

See Also

Reference

NDIS Functions for Interrupts
MiniportInitializeEx
NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS
NdisMDeregisterInterruptEx
NdisMSetMiniportAttributes