Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man9f / scsi_setup_cdb.9f
blob9aaf67be27b1c0e1116710f5817bb2cceffe75ca
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_SETUP_CDB 9F "Jan 16, 2006"
7 .SH NAME
8 scsi_setup_cdb \- setup SCSI command descriptor block (CDB)
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBint\fR \fBscsi_setup_cdb\fR(\fBunion scsi_cdb\fR \fI*cdbp\fR, \fBuchar_t\fR \fIcmd\fR, \fBuint_t\fR \fIaddr\fR,
13      \fBuint_t\fR \fIcnt\fR, \fBuint_t\fR \fIothr_cdb_data\fR);
14 .fi
16 .SH INTERFACE LEVEL
17 .sp
18 .LP
19 Solaris DDI specific (Solaris DDI).
20 .SH PARAMETERS
21 .sp
22 .ne 2
23 .na
24 \fB\fIcdbp\fR\fR
25 .ad
26 .RS 17n
27 Pointer to command descriptor block.
28 .RE
30 .sp
31 .ne 2
32 .na
33 \fB\fIcmd\fR\fR
34 .ad
35 .RS 17n
36 The first byte of the \fBSCSI\fR group 0, 1, 2, 4, or 5 \fBCDB\fR.
37 .RE
39 .sp
40 .ne 2
41 .na
42 \fB\fIaddr\fR\fR
43 .ad
44 .RS 17n
45 Pointer to the location of the data.
46 .RE
48 .sp
49 .ne 2
50 .na
51 \fB\fIcnt\fR\fR
52 .ad
53 .RS 17n
54 Data transfer length in units defined by the SCSI device type. For sequential
55 devices \fIcnt\fR is the number of bytes. For block devices, \fIcnt\fR is the
56 number of blocks.
57 .RE
59 .sp
60 .ne 2
61 .na
62 \fB\fIothr_cdb_data\fR\fR
63 .ad
64 .RS 17n
65 Additional \fBCDB\fR data.
66 .RE
68 .SH DESCRIPTION
69 .sp
70 .LP
71 The \fBscsi_setup_cdb()\fR function initializes a group 0, 1, 2, 4, or 5 type
72 of command descriptor block pointed to by  \fIcdbp\fR using \fIcmd\fR,
73 \fIaddr\fR, \fIcnt\fR, \fIothr_cdb_data\fR.
74 .sp
75 .LP
76 \fIaddr\fR should be set to 0 for commands having no addressing information
77 (for example, group 0 READ command for sequential access devices).
78 \fIothr_cdb_data\fR should be additional \fBCDB\fR data for Group 4 commands;
79 otherwise, it should be set to 0.
80 .sp
81 .LP
82 The \fBscsi_setup_cdb()\fR function does not set the \fBLUN\fR bits in
83 \fBCDB\fR[1] as the  \fBmakecom\fR(9F) functions do.  Also, the fixed bit for
84 sequential access device commands is not set.
85 .SH RETURN VALUES
86 .sp
87 .LP
88 The \fBscsi_setup_cdb()\fR function returns:
89 .sp
90 .ne 2
91 .na
92 \fB\fB1\fR\fR
93 .ad
94 .RS 5n
95 Upon success.
96 .RE
98 .sp
99 .ne 2
101 \fB\fB0\fR\fR
103 .RS 5n
104 Upon failure.
107 .SH CONTEXT
110 These functions can be called from a user, interrupt, or kernel context.
111 .SH SEE ALSO
114 \fBmakecom\fR(9F), \fBscsi_pkt\fR(9S)
117 \fIWriting Device Drivers\fR
120 \fIAmerican National Standard Small Computer System Interface-2 (SCSI-2)\fR
123 \fIAmerican National Standard SCSI-3 Primary Commands (SPC)\fR