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:
·Dismisses the interrupt on the HBA (required)
·Notifies (by calling ScsiPortNotification or ScsiPortCompleteRequest) the port driver if the HBA indicates that certain SCSI error conditions occurred during the operation and possibly logging the error.
For more information about logging errors, see Section A.4.11.
·Completes the requested operation that caused the interrupt, such as calling ScsiPortIoMapTransfer (see Section A.4.6) 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 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.