Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / makecom.9f
blobf123c3950df40f9fd055db094eb17d64cfd3e164
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 MAKECOM 9F "Jan 16, 2006"
7 .SH NAME
8 makecom, makecom_g0, makecom_g0_s, makecom_g1, makecom_g5 \- make a packet for
9 SCSI commands
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/scsi/scsi.h>
15 \fBvoid\fR \fBmakecom_g0\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR, \fBstruct scsi_device *\fR\fIdevp\fR,
16      \fBint\fR \fIflag\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fIaddr\fR, \fBint\fR \fIcnt\fR);
17 .fi
19 .LP
20 .nf
21 \fBvoid\fR \fBmakecom_g0_s\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR, \fBstruct scsi_device *\fR\fIdevp\fR,
22      \fBint\fR \fIflag\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fIcnt\fR, \fBint\fR \fIfixbit\fR);
23 .fi
25 .LP
26 .nf
27 \fBvoid\fR \fBmakecom_g1\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR, \fBstruct scsi_device *\fR\fIdevp\fR,
28      \fBint\fR \fIflag\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fIaddr\fR, \fBint\fR \fIcnt\fR);
29 .fi
31 .LP
32 .nf
33 \fBvoid\fR \fBmakecom_g5\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR, \fBstruct scsi_device *\fR\fIdevp\fR,
34      \fBint\fR \fIflag\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fIaddr\fR, \fBint\fR \fIcnt\fR);
35 .fi
37 .SH INTERFACE LEVEL
38 .sp
39 .LP
40 These interfaces are obsolete. \fBscsi_setup_cdb\fR(9F) should be used instead.
41 .SH PARAMETERS
42 .sp
43 .ne 2
44 .na
45 \fB\fIpkt\fR\fR
46 .ad
47 .RS 10n
48 Pointer to an allocated \fBscsi_pkt\fR(9S) structure.
49 .RE
51 .sp
52 .ne 2
53 .na
54 \fB\fIdevp\fR\fR
55 .ad
56 .RS 10n
57 Pointer to the target's \fBscsi_device\fR(9S) structure.
58 .RE
60 .sp
61 .ne 2
62 .na
63 \fB\fIflag\fR\fR
64 .ad
65 .RS 10n
66 Flags for the \fBpkt_flags\fR member.
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fB\fIcmd\fR\fR
73 .ad
74 .RS 10n
75 First byte of a group 0 or 1 or 5 \fBSCSI\fR \fBCDB\fR.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fIaddr\fR\fR
82 .ad
83 .RS 10n
84 Pointer to the location of the data.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fIcnt\fR\fR
91 .ad
92 .RS 10n
93 Data transfer length in units defined by the SCSI device type. For sequential
94 devices \fIcnt\fR is the number of bytes. For block devices, \fIcnt\fR is the
95 number of blocks.
96 .RE
98 .sp
99 .ne 2
101 \fB\fIfixbit\fR\fR
103 .RS 10n
104 Fixed bit in sequential access device commands.
107 .SH DESCRIPTION
110 The \fBmakecom\fR functions initialize a packet with the specified command
111 descriptor block, \fIdevp\fR and transport flags. The \fBpkt_address\fR,
112 \fBpkt_flags\fR, and the command descriptor block pointed to by \fBpkt_cdbp\fR
113 are initialized using the remaining arguments. Target drivers may use
114 \fBmakecom_g0()\fR for Group 0 commands (except for sequential access devices),
115 or \fBmakecom_g0_s()\fR for Group 0 commands for sequential access devices, or
116 \fBmakecom_g1()\fR for Group 1 commands,  or \fBmakecom_g5()\fR for Group 5
117 commands. \fIfixbit\fR is used by sequential access devices for accessing fixed
118 block sizes and sets the tag portion of the \fBSCSI\fR \fBCDB\fR.
119 .SH CONTEXT
122 These functions can be called from user, interrupt, or kernel context.
123 .SH EXAMPLES
125 \fBExample 1 \fRUsing \fBmakecom\fR Functions
127 .in +2
129 if (blkno >= (1<<20)) {
130       makecom_g1(pkt, SD_SCSI_DEVP, pflag, SCMD_WRITE_G1,
131          (int) blkno, nblk);
132 } else {
133       makecom_g0(pkt, SD_SCSI_DEVP, pflag, SCMD_WRITE,
134          (int) blkno, nblk);
137 .in -2
139 .SH ATTRIBUTES
142 See \fBattributes\fR(5) for a description of the following attributes:
147 box;
148 c | c
149 l | l .
150 ATTRIBUTE TYPE  ATTRIBUTE VALUE
152 Stability Level Obsolete
155 .SH SEE ALSO
158 \fBattributes\fR(5), \fBscsi_setup_cdb\fR(9F), \fBscsi_device\fR(9S),
159 \fBscsi_pkt\fR(9S)
162 \fIANSI Small Computer System Interface-2 (SCSI-2)\fR
165 \fIWriting Device Drivers\fR
166 .SH NOTES
169 The \fBmakecom_g0()\fR, \fBmakecom_g0_s()\fR, \fBmakecom_g1()\fR, and
170 \fBmakecom_g5()\fR functions are obsolete and will be discontinued in a future
171 release. These functions have been replaced by the \fBscsi_setup_cdb()\fR
172 function. See \fBscsi_setup_cdb\fR(9F).