Share via


MiniportISR (Compact 2013)

3/26/2014

This function is required if the driver's network adapter generates interrupts.

Syntax

VOID MiniportISR(
  PBOOLEAN InterruptRecognized,
  PBOOLEAN QueueMiniportHandleInterrupt,
  NDIS_HANDLE MiniportAdapterContext
);

Parameters

  • InterruptRecognized
    [out] Points to a variable in which MiniportISR returns whether the network adapter actually generated the interrupt. MiniportISR sets this to TRUE if it detects that the interrupt came from the network adapter designated at MiniportAdapterContext.

    If its network adapter shares an IRQ with other devices on the same bus, MiniportISR should return FALSE as quickly as possible when it determines that the network adapter did not interrupt.

  • QueueMiniportHandleInterrupt
    [out] Points to a variable that MiniportISR sets to TRUE if the MiniportHandleInterrupt function should be called to complete the interrupt-driven I/O operation.

    If the variable at InterruptRecognized is set to FALSE, the value of this variable is irrelevant because MiniportHandleInterrupt will not be called.

  • MiniportAdapterContext
    [in] Specifies the handle to a miniport-allocated context area in which the driver maintains per-network adapter state, set up by MiniportInitialize.

Return Value

None

Remarks

Any network adapter driver should do as little work as possible in its MiniportISR function, deferring I/O operations for each interrupt the network adapter generates to the MiniportHandleInterrupt function. A network adapter driver's ISR is not re-entrant on Windows Embedded Compact-Based devices, although two instantiations of a MiniportISR function can execute concurrently in SMP machines, especially if the miniport supports full duplex sends and receives. Be aware that SMP is not supported for Windows Embedded Compact.

MiniportISR is called if the following conditions are true:

  • An interrupt occurs on the network adapter while the driver's MiniportInitialize or MiniportHalt function is running.
  • An interrupt occurs on the I/O bus and the network adapter shares an IRQ with other devices on that bus.
  • If the network adapter shares an IRQ with other devices, that miniport's ISR must be called on every interrupt to determine whether its network adapter actually generated the interrupt. If not, MiniportISR should return FALSE immediately so that the driver of the device that actually generated the interrupt is called quickly. This strategy maximizes I/O throughput for every device on the same bus.
  • An interrupt occurs and the network adapter driver specified that its ISR should be called to handle every interrupt when its MiniportInitialize function called NdisMRegisterInterrupt.
  • Miniports that do not provide MiniportDisable/EnableInterrupt functionality must have their ISRs called on every interrupt.

MiniportISR dismisses the interrupt on the network adapter, saves whatever state it must about the interrupt, and defers as much of the I/O processing for each interrupt as possible to the MiniportHandleInterrupt function.

The remaining information in this reference page does not apply to Windows Embedded Compact because the functionality is not supported. However, if portability to Microsoft® Windows® 2000 is a concern, the following information is provided.

After MiniportISR returns control with the variables at InterruptRecognized and QueueMiniportHandleInterrupt set to TRUE, the corresponding MiniportHandleInterrupt function runs at a lower hardware priority than that of the ISR. Generally, MiniportHandleInterrupt should do all the work for interrupt-driven I/O operations except for determining whether the network adapter actually generated the interrupt, and, if it is necessary, preserving the type (receive, send, reset) of interrupt.

However, a driver writer should not rely on a one-to-one correspondence between the execution of MiniportISR and MiniportHandleInterrupt. A MiniportHandleInterrupt function should be written to handle the I/O processing for more than one network adapter interrupt. Its MiniportISR and MiniportHandleInterrupt functions can run concurrently in SMP machines. Moreover, as soon as MiniportISR acknowledges a network adapter interrupt, the network adapter can generate another interrupt, whereas the MiniportHandleInterrupt DPC can be queued for execution one time for such a sequence of interrupts.

The MiniportHandleInterrupt function is not queued if the driver's MiniportHalt or MiniportInitialize function is currently executing.

Requirements

Header

externs.h

See Also

Reference

NDIS 5.x Legacy Functions
MiniportHandleInterrupt
MiniportInitialize
MiniportHalt
NdisMRegisterInterrupt
NDIS 5.x Legacy Reference