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 "April 9, 2016"
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);
22 Solaris DDI specific (Solaris DDI).
26 \fB\fIsense_buffer\fR\fR
29 Pointer to a buffer containing \fBSCSI\fR sense data. The sense data is
30 expected in wire format starting at the response code.
36 \fB\fIsense_buf_len\fR\fR
39 Length of sense buffer in bytes.
48 Returns additional properties of the sense data.
53 The \fBscsi_validate_sense()\fR function returns the format of the sense data
54 contained in the provided sense buffer. If the response code field in the sense
55 data is not recognized or if there is not enough sense data to include sense
56 key, asc, and ascq then \fBscsi_validate_sense()\fR returns
57 \fBSENSE_UNUSABLE\fR. If the buffer contains usable sense data in fixed format,
58 the function returns \fBSENSE_FIXED_FORMAT\fR. If the buffer contains usable
59 sense data in descriptor format, the function returns \fBSENSE_DESCR_FORMAT\fR.
62 The following flags may be set as appropriate depending on the sense data:
66 \fB\fBSNS_BUF_OVERFLOW\fR\fR
69 The sense data buffer provided for the request is too small to hold all the
76 \fB\fBSNS_BUF_DEFERRED\fR\fR
79 The sense data contained in the buffer relates to an error that has occurred
80 during the processing of a successfully completed command, such as a cached
81 write that could not be committed to the media.
87 \fB\fBSENSE_UNUSABLE\fR\fR
90 The response code from the sense data is unrecognized or not enough sense data
91 present to provide the \fBsense key\fR, \fBasc\fR, and \fBascq\fR.
97 \fB\fBSENSE_FIXED_FORMAT\fR\fR
100 The sense data in the buffer is in "fixed format".
106 \fB\fBSENSE_DESCR_FORMAT\fR\fR
109 The sense data in the buffer is in "descriptor format".
114 The \fBscsi_validate_sense()\fR function can be called from user or interrupt
118 \fBscsi_ext_sense_fields\fR(9F), \fBscsi_find_sense_descr\fR(9F),
119 \fBscsi_sense_asc\fR(9F), \fBscsi_sense_ascq\fR(9F),
120 \fBscsi_sense_cmdspecific_uint64\fR(9F), \fBscsi_sense_info_uint64\fR(9F),
121 \fBscsi_sense_key\fR(9F)