A SCSI miniport driver is responsible for handling and for notifying the port driver of the following kinds of SCSI errors, which should be set in the SrbStatus field before the driver completes the SRB it was processing when the error occurred:
For a data underrun, the miniport driver must update the SRB's DataTransferLength to indicate how much data actually was transferred.
Whenever the miniport driver encounters an HBA or bus error, it should call ScsiPortLogError with one of the following system-defined error codes:
ScsiPortLogError allocates an error-log packet, sets it up, and logs the I/O error on behalf of the miniport driver to help users or system administrators monitor the condition of the HBA.