Condividi tramite


Registering Handlers for Interrupt Support (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 describes how to choose interrupt-support handlers for a miniport driver that manages a NIC that generates interrupts. For a detailed description of interrupt handling, see Handling an Interrupt.

When a NIC interrupts, NDIS fields the interrupt; that is, NDIS is always called first when a NIC interrupts. NDIS determines to which miniport driver the interrupt belongs and either calls that miniport driver's MiniportISRfunction or handles the interrupt for the miniport driver if the interrupt is not shared and if the miniport driver specified in its call to NdisMRegisterInterruptthat NDIS should not call its MiniportISRfunction. If NDIS does not call a miniport driver's ISR function, NDIS disables further interrupts by calling the miniport driver's MiniportDisableInterruptfunction and then queues the miniport driver's MiniportHandleInterruptDPC function.

If a miniport driver handles its device interrupts, it must register its ISR handler in an NDIS_MINIPORT_CHARACTERISTICS structure and indicate that it wants its ISR handler called by setting the RequestIsrargument of NdisMRegisterInterruptto TRUE.

Registering an ISR Handler (NDIS 5.1)

A miniport driver for a NIC that generates interrupts must register an ISR handler if any of the following is true:

  • The miniport driver manages a NIC that can interrupt during miniport driver initialization or during a miniport driver halt operation

  • The miniport driver's NIC shares an IRQ with another device

  • The miniport driver must capture interrupt-specific data from NIC registers at DIRQL.

Such a miniport driver must also set RequestIsrto TRUE when it calls NdisMRegisterInterrupt. If the interrupt is shared, the miniport driver must also set SharedInterruptto TRUE when calling NdisMRegisterInterrupt.

If none of the above-listed conditions are true, a miniport driver for a NIC that generates interrupts can specify that NDIS handle interrupts by calling NdisMRegisterInterruptwith RequestIsrset to FALSE and SharedInterruptset to FALSE.

Registering a HandleInterrupt Handler (NDIS 5.1)

A miniport driver must register an HandleInterrupt Handler if it manages a NIC that generates interrupts. Even if NDIS completely handles the interrupt, it will always queue a DPC for the miniport driver, causing the miniport driver's MiniportHandleInterrupthandler to run.

Enabling and Disabling Interrupts (NDIS 5.1)

If the NIC does not generate an interrupt, the miniport driver does not need to provide a MiniportEnableInterruptor MiniportDisableInterruptfunction. If a miniport driver always handles its interrupts in a MiniportISRfunction and schedules a MiniportHandleInterruptfunction, it might not provide specific MiniportEnableInterruptor MiniportDisableInterruptfunctions. Instead, such a miniport driver can choose to disable interrupts within its ISR and enable them within its DPC, without providing specific driver functions for this purpose. If a miniport driver specifies that NDIS handle its interrupts, it must supply a MiniportDisableInterruptfunction, and if the miniport driver does not reenable interrupts in its MiniportHandleInterruptfunction, it must have a MiniportEnableInterruptfunction.

 

 

Send comments about this topic to Microsoft