remove csh(1)
[unleashed.git] / share / man / man9s / usb_bulk_req.9s
blob564f6f84d1d165ba98c2e46c2394a7e16d744725
1 '\" te
2 .\" Copyright (c) 2004, 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 USB_BULK_REQUEST 9S "Jan 5, 2004"
7 .SH NAME
8 usb_bulk_req, usb_bulk_req_t, usb_bulk_request \- USB bulk request structure
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include  <sys/usb/usba.h>
13 .fi
15 .SH INTERFACE LEVEL
16 .LP
17 Solaris DDI specific (Solaris DDI)
18 .SH DESCRIPTION
19 .LP
20 A bulk request (that is, a request sent through a bulk pipe) is used to
21 transfer large amounts of data in reliable but non-time-critical fashion.
22 Please refer to Section \fI5.8\fR of the \fIUSB 2.0\fR specification for
23 information on bulk transfers. (The \fIUSB 2.0\fR specification is available at
24 \fIwww.usb.org\fR.)
25 .sp
26 .LP
27 The fields in the usb_bulk_req_t are used to format a bulk request. Please see
28 below for acceptable combinations of flags and attributes.
29 .sp
30 .LP
31 The usb_bulk_req_t fields are:
32 .sp
33 .in +2
34 .nf
35 uint_t          bulk_len;       /* number of bytes to xfer      */
36                                 /* Please see */
37                                 /* usb_pipe_get_max_bulk_transfer_size(9F) */
38                                 /* for maximum size */
39 mblk_t          *bulk_data;     /* the data for the data phase  */
40                                 /* IN or OUT: allocated by client */
41 uint_t          bulk_timeout;   /* xfer timeout value in secs   */
42                                 /* If set to zero, defaults to 5 sec */
43 usb_opaque_t    bulk_client_private; /* Client specific information */
44 usb_req_attrs_t bulk_attributes; /* xfer-attributes     */
46 /* Normal callback function, called upon completion. */
47 void            (*bulk_cb)(
48                     usb_pipe_handle_t ph, struct usb_bulk_req *req);
50 /* Exception callback function, for error handling. */
51 void            (*bulk_exc_cb)(
52                     usb_pipe_handle_t ph, struct usb_bulk_req *req);
54 /* set by USBA/HCD framework on completion */
55 usb_cr_t        bulk_completion_reason; /* overall success status */
56                                    /* See usb_completion_reason(9S) */
57 usb_cb_flags_t  bulk_cb_flags; /* recovery done by callback hndlr */
58                                    /* See usb_callback_flags(9S) */
59 .fi
60 .in -2
62 .sp
63 .LP
64 Request attributes define special handling for transfers. The following
65 attributes are valid for bulk requests:
66 .sp
67 .ne 2
68 .na
69 \fBUSB_ATTRS_SHORT_XFER_OK\fR
70 .ad
71 .RS 27n
72 USB framework accepts transfers where less data is received than expected.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fBUSB_ATTRS_AUTOCLEARING\fR
79 .ad
80 .RS 27n
81 USB framework resets pipe and clears functional stalls automatically on
82 exception.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fBUSB_ATTRS_PIPE_RESET\fR
89 .ad
90 .RS 27n
91 USB framework resets pipe automatically on exception.
92 .RE
94 .sp
95 .LP
96 Please see \fBusb_request_attributes\fR(9S) for more information.
97 .sp
98 .LP
99 Bulk transfers/requests are subject to the following constraints and caveats:
102 1) The following table indicates combinations of \fBusb_pipe_bulk_xfer\fR()
103 flags argument and fields of the usb_bulk_req_t request argument (X = don't
104 care).
106 .in +2
108 .in -2
110 .in +2
112 Flags     Type  Attributes       Data   Timeout Semantics
113 ---------------------------------------------------------------
114  X         X     X                ==NULL X      illegal
116  X         X     ONE_XFER         X      X      illegal
118  no sleep  IN    !SHORT_XFER_OK   !=NULL 0      See  note (A)
120  no sleep  IN    !SHORT_XFER_OK   !=NULL > 0    See  note (B)
122  sleep     IN    !SHORT_XFER_OK   !=NULL 0      See  note (C)
124  sleep     IN    !SHORT_XFER_OK   !=NULL > 0    See  note (D)
126  no sleep  IN    SHORT_XFER_OK    !=NULL 0      See  note (E)
128  no sleep  IN    SHORT_XFER_OK    !=NULL > 0    See  note (F)
130  sleep     IN    SHORT_XFER_OK    !=NULL 0      See  note (G)
132  sleep     IN    SHORT_XFER_OK    !=NULL > 0    See  note (H)
134  X         OUT   SHORT_XFER_OK   X       X      illegal
136  no sleep  OUT   X               !=NULL  0      See  note (I)
138  no sleep  OUT   X               !=NULL  > 0    See  note (J)
140  sleep     OUT   X               !=NULL  0      See  note (K)
142  sleep     OUT   X               !=NULL  > 0    See  note (L)
144 .in -2
148 Table notes:
150 .in +2
151 A). Fill buffer, no timeout, callback when bulk_len is transferred.
152 .in -2
154 .in +2
155 B). Fill buffer, with timeout; callback when bulk_len is transferred.
156 .in -2
158 .in +2
159 C). Fill buffer, no timeout, unblock when bulk_len is transferred; no callback.
160 .in -2
162 .in +2
163 D). Fill buffer, with timeout; unblock when bulk_len is transferred or a
164 timeout occurs; no callback.
165 .in -2
167 .in +2
168 E) Fill buffer, no timeout, callback when bulk_len is transferred or first
169 short packet is received.
170 .in -2
172 .in +2
173 F). Fill buffer, with timeout; callback when bulk_len is transferred or first
174 short packet is received.
175 .in -2
177 .in +2
178 G). Fill buffer, no timeout, unblock when bulk_len is transferred or first
179 short packet is received; no callback.
180 .in -2
182 .in +2
183 H). Fill buffer, with timeout; unblock when bulk_len is transferred, first
184 short packet is received, or a timeout occurs; no callback.
185 .in -2
187 .in +2
188 I). Empty buffer, no timeout; callback when bulk_len is transferred.
189 .in -2
191 .in +2
192 J) Empty buffer, with timeout; callback when bulk_len is transferred or a
193 timeout occurs.
194 .in -2
196 .in +2
197 K). Empty buffer, no timeout; unblock when bulk_len is transferred; no
198 callback.
199 .in -2
201 .in +2
202 L). Empty buffer, with timeout; unblock when bulk_len is transferred or a
203 timeout occurs; no callback.
204 .in -2
207 2) bulk_len must be > 0. bulk_data must not be NULL.
210 3) Bulk_residue is set for both READ and WRITE. If it is set to 0, it means
211 that all of the data was transferred successfully.  In case of WRITE it
212 contains data not written and in case of READ it contains the data NOT read so
213 far. A residue can only occur because of timeout or bus/device error. (Note
214 that a short transfer for a request where the USB_ATTRS_SHORT_XFER_OK attribute
215 is not set is considered a device error.)  An exception callback is made and
216 completion_reason will be non-zero.
219 4) Splitting large bulk transfers: Due to internal constraints, the USBA
220 framework can only do a limited size bulk data transfer per request.  A client
221 driver may first determine this limitation by calling the USBA interface,
222 \fBusb_pipe_get_max_bulk_transfer_size\fR(9F), and then restrict itself to
223 doing transfers in multiples of this fixed size. This forces a client driver
224 to do data transfers in a loop for a large request, splitting it into multiple
225 chunks of fixed size.
228 The bulk_completion_reason indicates the status of the transfer.  See
229 \fBusb_completion_reason\fR(9S) for usb_cr_t definitions.
232 The bulk_cb_flags are set prior to calling the exception callback handler to
233 summarize recovery actions taken and errors encountered during recovery. See
234 \fBusb_callback_flags\fR(9S) for usb_cb_flags_t definitions.
237 --- Callback handling ---
240 All usb request types share the same callback handling. See
241 \fBusb_callback_flags\fR(9S) for details.
242 .SH ATTRIBUTES
244 See attributes(5) for descriptions of the following attributes:
249 box;
250 c | c
251 l | l .
252 ATTRIBUTE TYPE  ATTRIBUTE VALUE
254 Architecture    PCI-based systems
256 Interface stability     Committed
259 .SH SEE ALSO
261 \fBusb_alloc_request\fR(9F), \fBusb_pipe_bulk_xfer\fR(9F),
262 \fBusb_pipe_ctrl_xfer\fR(9F), \fBusb_pipe_get_max_bulk_transfer_size\fR(9F),
263 \fBusb_pipe_intr_xfer\fR(9F), \fBusb_pipe_isoc_xfer\fR(9F),
264 \fBusb_callback_flags\fR(9S), \fBusb_completion_reason\fR(9S),
265 \fBusb_ctrl_request\fR(9S), \fBusb_intr_request\fR(9S),
266 \fBusb_isoc_request\fR(9S), \fBusb_request_attributes\fR(9S)