TapeMiniTapeError

VOID
    TapeMiniTapeError(

        IN PVOID  MinitapeExtension,                /* optional */
        IN PSCSI_REQUEST_BLOCK  Srb,
        IN OUT PTAPE_STATUS  TapeStatus
        );

TapeMiniTapeError provides device-specific error handling when a SCSI request block is completed with an error status. This routine is optional.

Parameters

MinitapeExtension
Points to the driver-specific minitape extension. NULL if the miniclass driver does not use a minitape extension.
Srb
Points to the SCSI request block for the operation that failed.
TapeStatus
Points to the TAPE_STATUS set by the tape class driver. The tape miniclass driver can change the TAPE_STATUS or leave it as is.

Comments

Most tape miniclass drivers do not provide a TapeMiniTapeError routine. The TAPE_STATUS codes set by the tape class driver are appropriate.

For some devices, however, a tape miniclass driver can identify a more appropriate error code than the tape class driver. For example, for some devices the tape class driver returns a TAPE_STATUS_BUS_RESET, but the tape miniclass driver is able to determine that the real problem is more accurately represented by TAPE_STATUS_NO_MEDIA.

A tape miniclass driver optionally specifies a TapeMiniTapeError routine in TAPE_INIT_DATA in its DriverEntry routine. When an error occurs during a read, write, or device control command the tape class driver sets an appropriate TAPE_STATUS code. If the tape miniclass driver supplied a TapeMiniTapeError routine, the tape class driver calls that routine with the minitape extension, the failed SRB, and the TAPE_STATUS code that would be returned.

TapeMiniTapeError determines whether to alter the status provided by the tape class driver based on the input parameters and its knowledge of the device. If the SRB_STATUS_AUTOSENSE_VALID bit is set in Srb->SrbStatus, then the SRB contains SCSI sense information at SenseInfoBuffer. The length of the buffer is SenseInfoBufferLength. The TapeMiniTapeError routine should examine this information along with the SrbStatus and ScsiStatus in the SRB to determine whether or not to change the TAPE_STATUS returned.

See Also

SCSI_REQUEST_BLOCK