9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / scsi_cname.9f
blob49e52a5fd128b4655c9420e8681645b11de63cd9
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_CNAME 9F "Jan 16, 2006"
7 .SH NAME
8 scsi_cname, scsi_dname, scsi_mname, scsi_rname, scsi_sname \- decode a SCSI
9 name
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/scsi/scsi.h>
17 \fBchar *\fR\fBscsi_cname\fR(\fBuchar_t\fR \fIcmd\fR, \fBchar **\fR\fIcmdvec\fR);
18 .fi
20 .LP
21 .nf
22 \fBchar *\fR\fBscsi_dname\fR(\fBint\fR \fIdtype\fR);
23 .fi
25 .LP
26 .nf
27 \fBchar *\fR\fBscsi_mname\fR(\fBuchar_t\fR \fImsg\fR);
28 .fi
30 .LP
31 .nf
32 \fBchar *\fR\fBscsi_rname\fR(\fBuchar_t\fR \fIreason\fR);
33 .fi
35 .LP
36 .nf
37 \fBchar *\fR\fBscsi_sname\fR(\fBuchar_t\fR \fIsense_key\fR);
38 .fi
40 .SH INTERFACE LEVEL
41 .sp
42 .LP
43 Solaris DDI specific (Solaris DDI).
44 .SH PARAMETERS
45 .sp
46 .ne 2
47 .na
48 \fB\fIcmd\fR\fR
49 .ad
50 .RS 13n
51 A \fBSCSI\fR command value.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fIcmdvec\fR\fR
58 .ad
59 .RS 13n
60 Pointer to an array of command strings.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fIdtype\fR\fR
67 .ad
68 .RS 13n
69 Device type.
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fB\fImsg\fR\fR
76 .ad
77 .RS 13n
78 A message value.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fB\fIreason\fR\fR
85 .ad
86 .RS 13n
87 A packet reason value.
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fB\fIsense_key\fR\fR
94 .ad
95 .RS 13n
96 A \fBSCSI\fR sense key value.
97 .RE
99 .SH DESCRIPTION
102 The \fBscsi_cname()\fR function decodes \fBSCSI\fR commands. \fIcmdvec\fR is a
103 pointer to an array of strings. The first byte of the string is the command
104 value, and the remainder is the name of the command.
107 The \fBscsi_dname()\fR function decodes the peripheral device type (for
108 example, direct access or sequential access) in the inquiry data.
111 The \fBscsi_mname()\fR function decodes \fBSCSI \fRmessages.
114 The \fBscsi_rname()\fR function decodes packet completion reasons.
117 The \fBscsi_sname()\fR function decodes \fBSCSI\fR sense keys.
118 .SH RETURN VALUES
121 These functions return a pointer to a string. If an argument is invalid, they
122 return a string to that effect.
123 .SH CONTEXT
126 These functions can be called from user, interrupt, or kernel context.
127 .SH EXAMPLES
129 \fBExample 1 \fRDecoding SCSI tape commands.
132 The \fBscsi_cname()\fR function decodes \fBSCSI \fRtape commands as follows:
135 .in +2
137 static char *st_cmds[] = {
138             "\e000test unit ready",
139             "\e001rewind",      
140             "\e003request sense",
141             "\e010read",
142             "\e012write",
143             "\e020write file mark",
144             "\e021space",
145             "\e022inquiry",
146             "\e025mode select",
147             "\e031erase tape",
148             "\e032mode sense",
149             "\e033load tape",
150             NULL
151     };
152     ..
153     cmn_err(CE_CONT, "st: cmd=%s", scsi_cname(cmd, st_cmds));
155 .in -2
157 .SH SEE ALSO
160 \fIWriting Device Drivers\fR