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_FIND_SENSE_DESCR 9F "Jun 30, 2006"
8 scsi_find_sense_descr \- find descriptor in SCSI sense data
12 #include <sys/scsi/scsi.h>
16 \fBuint8_t *\fR\fBscsi_find_sense_descr\fR(\fBuint8_t *\fR\fIsense_buffer\fR, \fBint\fR \fIsense_buf_len\fR,
17 \fBint\fR \fIreq_descr_type\fR);
23 Solaris DDI specific (Solaris DDI).
28 \fB\fIsense_buffer\fR\fR
31 Pointer to a buffer containing \fBSCSI\fR descriptor sense data. The data is
32 expected in wire format starting at the response code.
38 \fB\fIsense_buf_len\fR\fR
41 Integer that contains the length of sense buffer in bytes.
47 \fB\fIreq_descr_type\fR\fR
50 Integer that contains the descriptor type value for the desired sense
57 The \fBscsi_find_sense_descr()\fR function is used to obtain a pointer to a
58 specific descriptor type, specified by \fIreq_descr_type\fR, within a
59 descriptor sense buffer. Before returning the pointer,
60 \fBscsi_find_sense_descr()\fR verifies that the entire descriptor is present
61 based on the length provided in \fIsense_buf_len\fR.
64 Any value for \fIreq_descr_type\fR can be requested. The following descriptor
65 types are already defined:
69 #define DESCR_INFORMATION 0x00
70 #define DESCR_COMMAND_SPECIFIC 0x01
71 #define DESCR_SENSE_KEY_SPECIFIC 0x02
72 #define DESCR_FRU 0x03
73 #define DESCR_STREAM_COMMANDS 0x04
74 #define DESCR_BLOCK_COMMANDS 0x05
75 #define DESCR_OSD_OID 0x06
76 #define DESCR_OSD_RESP_INTEGRITY 0x07
77 #define DESCR_OSD_ATTR_ID 0x08
83 Drivers should use \fBscsi_validate_sense\fR(9F) to ensure that the sense
84 buffer contains valid descriptor sense data.
88 The \fBscsi_find_sense_descr()\fR function returns a pointer to a sense
89 descriptor of the requested type if a descriptor of that type exists. If no
90 such descriptor exists, \fBscsi_find_sense_descr()\fR returns \fINULL\fR.
94 The \fBscsi_find_sense_descr()\fR function can be called from user or interrupt
99 \fBscsi_ext_sense_fields\fR(9F), \fBscsi_sense_asc\fR(9F),
100 \fBscsi_sense_ascq\fR(9F), \fBscsi_sense_cmdspecific_uint64\fR(9F),
101 \fBscsi_sense_info_uint64\fR(9F), \fBscsi_sense_key\fR(9F),
102 \fBscsi_validate_sense\fR(9F)