Print this page
4888 Undocument dma_req(9s)
4884 EOF scsi_hba_attach
4886 EOF ddi_dmae_getlim
4887 EOF ddi_iomin
4634 undocument scsi_hba_attach() and ddi_dma_lim(9s)
4630 clean stale references to ddi_iopb_alloc and ddi_iopb_free
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man9f/get_pktiopb.9f
+++ new/usr/src/man/man9f/get_pktiopb.9f
1 1 '\" te
2 +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
2 3 .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
3 4 .\" 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 5 .\" 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 6 .\" 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 GET_PKTIOPB 9F "Jan 16, 2006"
7 +.TH GET_PKTIOPB 9F "May 24, 2014"
7 8 .SH NAME
8 9 get_pktiopb, free_pktiopb \- allocate/free a SCSI packet in the iopb map
9 10 .SH SYNOPSIS
10 11 .LP
11 12 .nf
12 13 #include <sys/scsi/scsi.h>
13 14
14 15
15 16
16 17 \fBstruct scsi_pkt *\fR\fBget_pktiopb\fR(\fBstruct scsi_address *\fR\fIap\fR,
17 18 \fBcaddr_t *\fR\fIdatap\fR, \fBint\fR \fIcdblen\fR, \fBint\fR \fIstatuslen\fR, \fBint\fR \fIdatalen\fR,
18 19 \fBint\fR \fIreadflag\fR, \fBint (*\fR\fIcallback\fR);
19 20 .fi
20 21
21 22 .LP
22 23 .nf
23 24 \fBvoid\fR \fBfree_pktiopb\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR, \fBcaddr_t\fR \fIdatap\fR, \fBint\fR \fIdatalen\fR);
24 25 .fi
25 26
26 27 .SH INTERFACE LEVEL
27 28 .sp
28 29 .LP
29 30 These interfaces are obsolete. Use \fBscsi_alloc_consistent_buf\fR(9F) instead
30 31 of \fBget_pktiopb()\fR. Use \fBscsi_free_consistent_buf\fR(9F) instead of
31 32 \fBfree_pktiopb()\fR.
32 33 .SH PARAMETERS
33 34 .sp
34 35 .ne 2
35 36 .na
36 37 \fB\fIap\fR\fR
37 38 .ad
38 39 .RS 13n
39 40 Pointer to the target's \fBscsi_address\fR structure.
40 41 .RE
41 42
42 43 .sp
43 44 .ne 2
44 45 .na
45 46 \fB\fIdatap\fR\fR
46 47 .ad
47 48 .RS 13n
48 49 Pointer to the address of the packet, set by this function.
49 50 .RE
50 51
51 52 .sp
52 53 .ne 2
53 54 .na
54 55 \fB\fIcdblen\fR\fR
55 56 .ad
56 57 .RS 13n
57 58 Number of bytes required for the \fBSCSI \fRcommand descriptor block (CDB).
58 59 .RE
59 60
60 61 .sp
61 62 .ne 2
62 63 .na
63 64 \fB\fIstatuslen\fR\fR
64 65 .ad
65 66 .RS 13n
66 67 Number of bytes required for the \fBSCSI \fRstatus area.
67 68 .RE
68 69
69 70 .sp
70 71 .ne 2
71 72 .na
72 73 \fB\fIdatalen\fR\fR
73 74 .ad
74 75 .RS 13n
75 76 Number of bytes required for the data area of the \fBSCSI \fRcommand.
76 77 .RE
77 78
78 79 .sp
79 80 .ne 2
80 81 .na
81 82 \fB\fIreadflag\fR\fR
82 83 .ad
83 84 .RS 13n
84 85 If non-zero, data will be transferred from the \fBSCSI \fRtarget.
85 86 .RE
86 87
87 88 .sp
88 89 .ne 2
89 90 .na
90 91 \fB\fIcallback\fR\fR
91 92 .ad
92 93 .RS 13n
93 94 Pointer to a callback function, or \fBNULL_FUNC\fR or \fBSLEEP_FUNC\fR
94 95 .RE
95 96
96 97 .sp
97 98 .ne 2
98 99 .na
99 100 \fB\fIpkt\fR\fR
100 101 .ad
101 102 .RS 13n
102 103 Pointer to a \fBscsi_pkt\fR(9S) structure.
103 104 .RE
104 105
105 106 .SH DESCRIPTION
106 107 .sp
107 108 .LP
108 109 The \fBget_pktiopb()\fR function allocates a \fBscsi_pkt\fR structure that has
109 110 a small data area allocated. It is used by some \fBSCSI \fRcommands such as
110 111 \fBREQUEST_SENSE\fR, which involve a small amount of data and require
111 112 cache-consistent memory for proper operation. It uses \fBddi_iopb_alloc\fR(9F)
112 113 for allocating the data area and \fBscsi_resalloc\fR(9F) to allocate the packet
113 114 and \fBDMA\fR resources.
114 115 .sp
115 116 .LP
116 117 \fIcallback\fR indicates what \fBget_pktiopb()\fR should do when resources are
117 118 not available:
118 119 .sp
119 120 .ne 2
120 121 .na
121 122 \fB\fBNULL_FUNC\fR\fR
122 123 .ad
123 124 .RS 16n
124 125 Do not wait for resources. Return a \fINULL\fR pointer.
125 126 .RE
126 127
127 128 .sp
128 129 .ne 2
129 130 .na
130 131 \fB\fBSLEEP_FUNC\fR\fR
131 132 .ad
132 133 .RS 16n
133 134 Wait indefinitely for resources.
134 135 .RE
135 136
136 137 .sp
137 138 .ne 2
138 139 .na
139 140 \fBOther Values\fR
140 141 .ad
141 142 .RS 16n
142 143 \fIcallback\fR points to a function which is called when resources may have
143 144 become available. \fIcallback\fR \fBmust\fR return either \fB0\fR (indicating
144 145 that it attempted to allocate resources but failed to do so again), in which
145 146 case it is put back on a list to be called again later, or \fB1\fR indicating
146 147 either success in allocating resources or indicating that it no longer cares
147 148 for a retry.
148 149 .RE
149 150
150 151 .sp
151 152 .LP
152 153 The \fBfree_pktiopb()\fR function is used for freeing the packet and its
153 154 associated resources.
154 155 .SH RETURN VALUES
155 156 .sp
156 157 .LP
157 158 The \fBget_pktiopb()\fR function returns a pointer to the newly allocated
158 159 \fBscsi_pkt\fR or a \fINULL\fR pointer.
159 160 .SH CONTEXT
160 161 .sp
161 162 .LP
162 163 If \fIcallback\fR is \fBSLEEP_FUNC\fR, then this routine can be called only
163 164 from user or kernel context. Otherwise, it can be called from user, interrupt,
164 165 or kernel context. The \fIcallback\fR function should not block or call
165 166 routines that block.
166 167 .sp
167 168 .LP
168 169 The \fBfree_pktiopb()\fR function can be called from user, interrupt, or kernel
169 170 context.
170 171 .SH ATTRIBUTES
171 172 .sp
172 173 .LP
173 174 See \fBattributes\fR(5) for a description of the following attributes:
174 175 .sp
175 176
176 177 .sp
177 178 .TS
178 179 box;
↓ open down ↓ |
162 lines elided |
↑ open up ↑ |
179 180 c | c
180 181 l | l .
181 182 ATTRIBUTE TYPE ATTRIBUTE VALUE
182 183 _
183 184 Stability Level Obsolete
184 185 .TE
185 186
186 187 .SH SEE ALSO
187 188 .sp
188 189 .LP
189 -\fBattributes\fR(5), \fBddi_iopb_alloc\fR(9F),
190 +\fBattributes\fR(5),
190 191 \fBscsi_alloc_consistent_buf\fR(9F), \fBscsi_free_consistent_buf\fR(9F),
191 192 \fBscsi_pktalloc\fR(9F), \fBscsi_resalloc\fR(9F), \fBscsi_pkt\fR(9S)
192 193 .sp
193 194 .LP
194 195 \fIWriting Device Drivers\fR
195 196 .SH NOTES
196 197 .sp
197 198 .LP
198 199 The \fBget_pktiopb()\fR and \fBfree_pktiopb()\fR functions are obsolete and
199 200 will be discontinued in a future release. These functions have been replaced
200 201 by, respectively, \fBscsi_alloc_consistent_buf\fR(9F) and
201 202 \fBscsi_free_consistent_buf\fR(9F).
202 203 .sp
203 204 .LP
204 205 The \fBget_pktiopb()\fR function uses scarce resources. For this reason and its
205 206 obsolescence (see above), its use is discouraged.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX