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