A.1.5.3 SCSI Class Driver’s RetryRequest Routine

The port-miniport driver pair is responsible for retrying requests if certain SCSI errors occur, including bus parity errors, selection time-outs, and target controller busy errors. If their retry attempts fail, the Windows NT SCSI port driver completes the request with an appropriate error and logs the I/O error, as well.

SCSI class drivers should never attempt to retry a request that the port driver has already failed due to any of the preceding errors.

SCSI class drivers are required to retry requests that fail due to target controller errors, SCSI bus resets, or time-outs. In general, a RetryRequest routine can resubmit such an IRP to the port driver and direct that the SRB be placed at the head of the port driver’s LU-specific queue.

In particular, a RetryRequest routine should do the following:

  1. Ensure that a partial transfer request has the correct values set for the starting address and length.

  2. Zero the SrbStatus and ScsiStatus members of the SRB.

  3. Set up the SrbFlags member, as necessary for the device.

  4. Set up the I/O stack location for the port driver in the IRP as already described in Sections A.1.4 through A.1.4.5.

  5. Call IoSetCompletionRoutine for the IRP, because the driver’s IoCompletion routine might need to retry the request more than once, or to call the driver’s InterpretRequestSense or ReleaseQueue routine.

  6. Pass the request on to the port driver with IoCallDriver.