2 .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SCSI_VALIDATE_SENSE 9F "Jun 29, 2006"
8 scsi_validate_sense \- find descriptor in SCSI sense data
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_validate_sense\fR(\fBuint8_t *\fR\fIsense_buffer\fR, \fBint\fR \fIsense_buf_len\fR,
17 \fBint *\fR\fIflags\fR);
23 Solaris DDI specific (Solaris DDI).
28 \fB\fIsense_buffer\fR\fR
31 Pointer to a buffer containing \fBSCSI\fR sense data. The sense data is
32 expected in wire format starting at the response code.
38 \fB\fIsense_buf_len\fR\fR
41 Length of sense buffer in bytes.
50 Returns additional properties of the sense data.
56 The \fBscsi_validate_sense()\fR function returns the format of the sense data
57 contained in the provided sense buffer. If the response code field in the sense
58 data is not recognized or if there is not enough sense data to include sense
59 key, asc, and ascq then \fBscsi_validate_sense()\fR returns
60 \fBSENSE_UNUSABLE\fR. If the buffer contains usable sense data in fixed format,
61 the function returns \fBSENSE_FIXED_FORMAT\fR. If the buffer contains usable
62 sense data in descriptor format, the function returns \fBSENSE_DESCR_FORMAT\fR.
65 The following flags may be set as appropriate depending on the sense data:
69 \fB\fBSNS_BUF_OVERFLOW\fR\fR
72 The sense data buffer provided for the request is too small to hold all the
79 \fB\fBSNS_BUF_DEFERRED\fR\fR
82 The sense data contained in the buffer relates to an error that has occurred
83 during the processing of a successfully completed command, such as a cached
84 write that could not be commited to the media.
91 \fB\fBSENSE_UNUSABLE\fR\fR
94 The response code from the sense data is unrecognized or not enough sense data
95 present to provide the \fBsense key\fR, \fBasc\fR, and \fBascq\fR.
101 \fB\fBSENSE_FIXED_FORMAT\fR\fR
104 The sense data in the buffer is in "fixed format".
110 \fB\fBSENSE_DESCR_FORMAT\fR\fR
113 The sense data in the buffer is in "descriptor format".
119 The \fBscsi_validate_sense()\fR function can be called from user or interrupt
124 \fBscsi_ext_sense_fields\fR(9F), \fBscsi_find_sense_descr\fR(9F),
125 \fBscsi_sense_asc\fR(9F), \fBscsi_sense_ascq\fR(9F),
126 \fBscsi_sense_cmdspecific_uint64\fR(9F), \fBscsi_sense_info_uint64\fR(9F),
127 \fBscsi_sense_key\fR(9F)