Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_sense_key.9f
blob59d88a94c89e07e1513d32da9f7ae4e8a94201eb
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_SENSE_KEY 9F "Jun 28, 2006"
7 .SH NAME
8 scsi_sense_key, scsi_sense_asc, scsi_sense_ascq \- retrieve fields from SCSI
9 sense data
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/scsi/scsi.h>
17 \fBuint8_t\fR \fBscsi_sense_key\fR(\fBuint8_t *\fR\fIsense_buffer\fR);
18 .fi
20 .LP
21 .nf
22 \fBuint8_t\fR \fBscsi_sense_asc\fR(\fBuint8_t *\fR\fIsense_buffer\fR);
23 .fi
25 .LP
26 .nf
27 \fBuint8_t\fR \fBscsi_sense_ascq\fR(\fBuint8_t *\fR\fIsense_buffer\fR);
28 .fi
30 .SH INTERFACE LEVEL
31 .sp
32 .LP
33 Solaris DDI specific (Solaris DDI).
34 .SH PARAMETERS
35 .sp
36 .ne 2
37 .na
38 \fB\fIsense_buffer\fR\fR
39 .ad
40 .RS 16n
41 Pointer to a buffer containing \fBSCSI\fR sense data. The sense data is
42 expected in wire format starting at the response code. It can be in either
43 fixed or descriptor format.
44 .RE
46 .SH DESCRIPTION
47 .sp
48 .LP
49 The \fBscsi_sense_key()\fR function returns the sense key value from the sense
50 data contained in the sense_buffer.
51 .sp
52 .LP
53 The \fBscsi_sense_asc()\fR function returns the additional sense code
54 (\fBASC\fR) value from the sense data contained in the sense_buffer.
55 .sp
56 .LP
57 The \fBscsi_sense_ascq()\fR function returns the additional sense code
58 qualifier (\fBASCQ\fR) value from the sense data contained in the sense_buffer.
59 .sp
60 .LP
61 The \fBscsi_sense_key()\fR, \fBscsi_sense_asc()\fR, and \fBscsi_sense_ascq()\fR
62 functions are used to retrieve values from \fBSCSI\fR sense data, regardles of
63 whether the sense data is in fixed format or descriptor format.
64 .sp
65 .LP
66 Drivers should use \fBscsi_validate_sense\fR(9F) to ensure that valid sense
67 key, \fBasc\fR, and \fBascq\fR values are present in the sense data.
68 .SH RETURN VALUES
69 .sp
70 .LP
71 The \fBscsi_sense_key()\fR function returns the sense key value from the sense
72 buffer. The \fBscsi_sense_asc()\fR function returns the additional sense code
73 (\fBASC\fR) from the sense buffer and the \fBscsi_sense_ascq()\fR function
74 returns the additional sense code qualifier (\fBASCQ\fR) from the sense buffer.
75 .SH CONTEXT
76 .sp
77 .LP
78 The \fBscsi_sense_key()\fR, \fBscsi_sense_asc()\fR, and \fBscsi_sense_ascq()\fR
79 functions can be called from user or interrupt context.
80 .SH SEE ALSO
81 .sp
82 .LP
83 \fBscsi_ext_sense_fields\fR(9F), \fBscsi_find_sense_descr\fR(9F),
84 \fBscsi_sense_cmdspecific_uint64\fR(9F), \fBscsi_sense_info_uint64\fR(9F),
85 \fBscsi_validate_sense\fR(9F)