'\" te .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved .TH scsi_validate_sense 9F "29 Jun 2006" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME scsi_validate_sense \- find descriptor in SCSI sense data .SH SYNOPSIS .LP .nf #include \fBint\fR \fBscsi_validate_sense\fR(\fBuint8_t *\fR\fIsense_buffer\fR, \fBint\fR \fIsense_buf_len\fR, \fBint *\fR\fIflags\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIsense_buffer\fR\fR .ad .RS 17n .rt Pointer to a buffer containing \fBSCSI\fR sense data. The sense data is expected in wire format starting at the response code. .RE .sp .ne 2 .mk .na \fB\fIsense_buf_len\fR\fR .ad .RS 17n .rt Length of sense buffer in bytes. .RE .sp .ne 2 .mk .na \fB\fIflags\fR\fR .ad .RS 17n .rt Returns additional properties of the sense data. .RE .SH DESCRIPTION .sp .LP The \fBscsi_validate_sense()\fR function returns the format of the sense data contained in the provided sense buffer. If the response code field in the sense data is not recognized or if there is not enough sense data to include sense key, asc, and ascq then \fBscsi_validate_sense()\fR returns \fBSENSE_UNUSABLE\fR. If the buffer contains usable sense data in fixed format, the function returns \fBSENSE_FIXED_FORMAT\fR. If the buffer contains usable sense data in descriptor format, the function returns \fBSENSE_DESCR_FORMAT\fR. .sp .LP The following flags may be set as appropriate depending on the sense data: .sp .ne 2 .mk .na \fB\fBSNS_BUF_OVERFLOW\fR\fR .ad .RS 20n .rt The sense data buffer provided for the request is too small to hold all the sense data. .RE .sp .ne 2 .mk .na \fB\fBSNS_BUF_DEFERRED\fR\fR .ad .RS 20n .rt The sense data contained in the buffer relates to an error that has occurred during the processing of a successfully completed command, such as a cached write that could not be committed to the media. .RE .SH RETURN VALUES .sp .ne 2 .mk .na \fB\fBSENSE_UNUSABLE\fR\fR .ad .RS 22n .rt The response code from the sense data is unrecognized or not enough sense data present to provide the \fBsense key\fR, \fBasc\fR, and \fBascq\fR. .RE .sp .ne 2 .mk .na \fB\fBSENSE_FIXED_FORMAT\fR\fR .ad .RS 22n .rt The sense data in the buffer is in "fixed format". .RE .sp .ne 2 .mk .na \fB\fBSENSE_DESCR_FORMAT\fR\fR .ad .RS 22n .rt The sense data in the buffer is in "descriptor format". .RE .SH CONTEXT .sp .LP The \fBscsi_validate_sense()\fR function can be called from user or interrupt context. .SH SEE ALSO .sp .LP \fBscsi_ext_sense_fields\fR(9F), \fBscsi_find_sense_descr\fR(9F), \fBscsi_sense_asc\fR(9F), \fBscsi_sense_ascq\fR(9F), \fBscsi_sense_cmdspecific_uint64\fR(9F), \fBscsi_sense_info_uint64\fR(9F), \fBscsi_sense_key\fR(9F)