SCSI Miniport Driver's HwScsiInterrupt Routine
On entry, an 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 driver'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 driver, an HwScsiInterrupt routine does some or all of the following:
Dismisses the interrupt on the HBA (required)
Notifies the port driver (by calling ScsiPortNotification or ScsiPortCompleteRequest) if the HBA indicates that certain SCSI error conditions occurred during the operation and possibly logs the error.
For more information about logging errors, see Error Handling in SCSI Miniport Drivers.
Completes the requested operation that caused the interrupt, such as calling ScsiPortIoMapTransfer (see SCSI Miniport Driver's HwScsiDmaStarted Routine) if the interrupt came in from a previously selected target TID and LU, indicating a readiness to transfer data.
When the HwScsiInterrupt routine (or an internal miniport driver routine) completes an SRB, it calls ScsiPortNotification twice:
First, with the NotificationTypeRequestComplete and the just-satisfied SRB.
Next, with the NotificationTypeNextRequest, or with NextLuRequest if the HBA supports tagged queuing or multiple requests per logical unit.
For better overall system performance, a miniport driver's HwScsiInterrupt routine should do only the minimum necessary to process I/O requests. That is, the miniport driver should be designed to return control from the HwScsiInterrupt routine as quickly as possible. An HwScsiInterrupt routine must not call ScsiPortStallExecution with large intervals, thereby monopolizing a processor and preventing other drivers from servicing their device interrupts.