A.4.8 SCSI Miniport Driver’s HwScsiInterrupt Routine

On entry, a HwScsiInterrupt routine should determine if its HBA actually generated an interrupt. HwScsiInterrupt must return FALSE as soon as possible if it detects a spurious interrupt so the ISR for the device that actually generated the interrupt can be called quickly.

Otherwise, a miniport’s HwScsiInterrupt routine is generally responsible for completing the I/O operation that caused the interrupt. Depending on the HBA and the design of the miniport, a HwScsiInterrupt routine does some or all of the following:

When the HwScsiInterrupt routine (or an internal miniport routine) completes an SRB, it calls ScsiPortNotification twice:

  1. First, with the NotificationType RequestComplete and the just satisfied SRB

  2. Next, with the NotificationType NextRequest, or with NextLuRequest if the HBA supports tagged queueing or multiple requests per logical unit

For better overall system performance, a miniport’s HwScsiInterrupt routine should do only the minimum necessary to process I/O requests. That is, the miniport should be designed to return control from the HwScsiInterrupt routine as quickly as possible. A HwScsiInterrupt routine must not call ScsiPortStallExecution with large intervals, thereby tying up a processor and preventing other drivers from servicing their device interrupts.