Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_validate_sense.9f
blobefe75a55aff213f7b0cacb13d3d0dd9fda6f1ae3
1 '\" te
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"
7 .SH NAME
8 scsi_validate_sense \- find descriptor in SCSI sense data
9 .SH SYNOPSIS
10 .LP
11 .nf
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);
18 .fi
20 .SH INTERFACE LEVEL
21 .LP
22 Solaris DDI specific (Solaris DDI).
23 .SH PARAMETERS
24 .ne 2
25 .na
26 \fB\fIsense_buffer\fR\fR
27 .ad
28 .RS 17n
29 Pointer to a buffer containing \fBSCSI\fR sense data. The sense data is
30 expected in wire format starting at the response code.
31 .RE
33 .sp
34 .ne 2
35 .na
36 \fB\fIsense_buf_len\fR\fR
37 .ad
38 .RS 17n
39 Length of sense buffer in bytes.
40 .RE
42 .sp
43 .ne 2
44 .na
45 \fB\fIflags\fR\fR
46 .ad
47 .RS 17n
48 Returns additional properties of the sense data.
49 .RE
51 .SH DESCRIPTION
52 .LP
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.
60 .sp
61 .LP
62 The following flags may be set as appropriate depending on the sense data:
63 .sp
64 .ne 2
65 .na
66 \fB\fBSNS_BUF_OVERFLOW\fR\fR
67 .ad
68 .RS 20n
69 The sense data buffer provided for the request is too small to hold all the
70 sense data.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fBSNS_BUF_DEFERRED\fR\fR
77 .ad
78 .RS 20n
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.
82 .RE
84 .SH RETURN VALUES
85 .ne 2
86 .na
87 \fB\fBSENSE_UNUSABLE\fR\fR
88 .ad
89 .RS 22n
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.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fBSENSE_FIXED_FORMAT\fR\fR
98 .ad
99 .RS 22n
100 The sense data in the buffer is in "fixed format".
104 .ne 2
106 \fB\fBSENSE_DESCR_FORMAT\fR\fR
108 .RS 22n
109 The sense data in the buffer is in "descriptor format".
112 .SH CONTEXT
114 The \fBscsi_validate_sense()\fR function can be called from user or interrupt
115 context.
116 .SH SEE ALSO
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)