| Current File : //usr/share/man/man9f/scsi_find_sense_descr.9f |
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
.TH scsi_find_sense_descr 9F "30 Jun 2006" "SunOS 5.11" "Kernel Functions for Drivers"
.SH NAME
scsi_find_sense_descr \- find descriptor in SCSI sense data
.SH SYNOPSIS
.LP
.nf
#include <sys/scsi/scsi.h>
\fBuint8_t *\fR\fBscsi_find_sense_descr\fR(\fBuint8_t *\fR\fIsense_buffer\fR, \fBint\fR \fIsense_buf_len\fR,
\fBint\fR \fIreq_descr_type\fR);
.fi
.SH INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI).
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIsense_buffer\fR\fR
.ad
.RS 18n
.rt
Pointer to a buffer containing \fBSCSI\fR descriptor sense data. The data is expected in wire format starting at the response code.
.RE
.sp
.ne 2
.mk
.na
\fB\fIsense_buf_len\fR\fR
.ad
.RS 18n
.rt
Integer that contains the length of sense buffer in bytes.
.RE
.sp
.ne 2
.mk
.na
\fB\fIreq_descr_type\fR\fR
.ad
.RS 18n
.rt
Integer that contains the descriptor type value for the desired sense descriptor.
.RE
.SH DESCRIPTION
.sp
.LP
The \fBscsi_find_sense_descr()\fR function is used to obtain a pointer to a specific descriptor type, specified by \fIreq_descr_type\fR, within a descriptor sense buffer. Before returning the pointer, \fBscsi_find_sense_descr()\fR verifies that the entire descriptor is present based on the length provided in \fIsense_buf_len\fR.
.sp
.LP
Any value for \fIreq_descr_type\fR can be requested. The following descriptor types are already defined:
.sp
.in +2
.nf
#define DESCR_INFORMATION 0x00
#define DESCR_COMMAND_SPECIFIC 0x01
#define DESCR_SENSE_KEY_SPECIFIC 0x02
#define DESCR_FRU 0x03
#define DESCR_STREAM_COMMANDS 0x04
#define DESCR_BLOCK_COMMANDS 0x05
#define DESCR_OSD_OID 0x06
#define DESCR_OSD_RESP_INTEGRITY 0x07
#define DESCR_OSD_ATTR_ID 0x08
.fi
.in -2
.sp
.LP
Drivers should use \fBscsi_validate_sense\fR(9F) to ensure that the sense buffer contains valid descriptor sense data.
.SH RETURN VALUES
.sp
.LP
The \fBscsi_find_sense_descr()\fR function returns a pointer to a sense descriptor of the requested type if a descriptor of that type exists. If no such descriptor exists, \fBscsi_find_sense_descr()\fR returns \fINULL\fR.
.SH CONTEXT
.sp
.LP
The \fBscsi_find_sense_descr()\fR function can be called from user or interrupt context.
.SH SEE ALSO
.sp
.LP
\fBscsi_ext_sense_fields\fR(9F), \fBscsi_sense_asc\fR(9F), \fBscsi_sense_ascq\fR(9F), \fBscsi_sense_cmdspecific_uint64\fR(9F), \fBscsi_sense_info_uint64\fR(9F), \fBscsi_sense_key\fR(9F), \fBscsi_validate_sense\fR(9F)