The routine mrd_scsi_decode(3mrd) is used by the low level MRD
routines to map SCSI device errors to MRD_STATUS codes. It
uses the Additional Sense Code (asc) and Additional Sense Code
Qualifier (ascq) of the status structure to find an appropriate
MRD_STATUS code. If both the asc and ascq are zero (0), the Sense
Key (key) will be used to determine the code. The resulting MRD_
STATUS code will be copied to the code field and returned.
The routine mrd_map_os_error(3mrd) is used to map operating
system specific failures to MRD_STATUS codes. If the os_status
isn't recognized, the routine will return MRD_STATUS_OS_ERROR.
If the log_info argument is a valid pointer, a copy of the
operating system text for the message will also copied to the
space provided.
This routine uses the dev_status_t structure for handing errors.
The dev_status_t structure includes the code, os_status, and SCSI
error fields. The following describes how to decode errors with
the dev_status_t structure.
SCSI Errors
SCSI errors are indicated when the value of the valid field of
the SCSI error is not equal to 0. The key, asc, and ascq fields
provide additional information to help determine the cause of the
error.
The code usually maps the Additional Sense Code and Additional
Sense Code Qualifier (ASC/ASCQ) values to an MRD error. The asc
and ascq values are copied from the request sense data returned
by the target.
The Additional Sense Code (asc) indicates further information
related to the error or exception condition reported in the sense
key field. The Additional Sense Code Qualifier (ascq) indicates
detailed information related to the additional sense code. For
more information, consult the SCSI-2 Specification.
Operating System Errors
Operating system errors are indicated when the value of the valid
field of the SCSI error is equal to 0 and the value of the os_
status field is not equal to 0. This result is most likely caused
by an operating system error, and probably has a mapped error in
MRD.
MRD Errors
MRD errors are indicated when the value of the os_status field is
0, and the value of the valid field of the SCSI error is 0. This
result is most likely caused when MRD encounters its own failure.