4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 USBA PIPE STATE TRANSITIONS INFORMATION
28 ---------------------------------------
30 1. Control pipe state transitions:-
32 o Default control pipe (endpoint number 0):
34 NOTE:- Queuing of control requests are allowed at USBA level.
36 Calls Current state additional condition Action Next state
37 ----- ------------- -------------------- ------ -----------
38 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
40 usb_pipe_ctrl_xfer USB_PIPE_STATE_IDLE No outstanding request send req to hcd USB_PIPE_STATE_ACTIVE
41 Outstanding reqs pending queue the requests USB_PIPE_STATE_IDLE
45 USB_PIPE_STATE_ACTIVE - queue the requests USB_PIPE_STATE_ACTIVE
49 USB_PIPE_STATE_ERROR - queue the requests USB_PIPE_STATE_ERROR
53 USB_PIPE_STATE_CLOSING - return failure USB_PIPE_STATE_CLOSING
56 usba_hcdi_cb USB_PIPE_STATE_ACTIVE - Before doing callback USB_PIPE_STATE_IDLE
57 (Normal callback) No outstanding request - USB_PIPE_STATE_IDLE
58 Outstanding reqs pending Send next req to hcd USB_PIPE_STATE_ACTIVE
61 USB_PIPE_STATE_ERROR - Don't send any more req USB_PIPE_STATE_ERROR
63 USB_PIPE_STATE_CLOSING - Don't send any more req USB_PIPE_STATE_CLOSING
67 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
68 - On auto clear USB_PIPE_STATE_IDLE
71 No outstanding request - USB_PIPE_STATE_IDLE
72 Outstanding reqs pending Send next req to hcd USB_PIPE_STATE_ACTIVE
74 usb_pipe_reset USB_PIPE_STATE_XXXX - Return failure USB_PIPE_STATE_XXXX
78 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
81 Once pipe is closed - USB_PIPE_STATE_CLOSED
84 o Normal control pipe (endpoint number > 0):
86 NOTE:- Queuing of control requests are allowed at USBA level.
88 Calls Current state additional condition Action Next state
89 ----- ------------- -------------------- ------ -----------
90 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
92 usb_pipe_ctrl_xfer USB_PIPE_STATE_IDLE No outstanding request send req to hcd USB_PIPE_STATE_ACTIVE
93 Outstanding reqs pending queue the requests USB_PIPE_STATE_IDLE
97 USB_PIPE_STATE_ACTIVE - queue the requests USB_PIPE_STATE_ACTIVE
101 USB_PIPE_STATE_ERROR - return failure USB_PIPE_STATE_ERROR
103 USB_PIPE_STATE_CLOSING - return failure USB_PIPE_STATE_CLOSING
106 usba_hcdi_cb USB_PIPE_STATE_ACTIVE - Before doing callback USB_PIPE_STATE_IDLE
107 (Normal callback) No outstanding request - USB_PIPE_STATE_IDLE
108 Outstanding reqs pending Send next req to hcd USB_PIPE_STATE_ACTIVE
111 USB_PIPE_STATE_ERROR - Don't send any more req USB_PIPE_STATE_ERROR
112 USB_PIPE_STATE_CLOSING
116 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
117 - On auto clear USB_PIPE_STATE_IDLE
118 (Remove all outstanding
121 usb_pipe_reset USB_PIPE_STATE_XXXX - Remove all outstanding USB_PIPE_STATE_IDLE
125 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
126 USB_PIPE_STATE_ACTIVE
128 Once pipe is closed - USB_PIPE_STATE_CLOSED
130 2. Bulk pipe state transitions (endpoint number > 1, both IN and OUT):-
132 NOTE:- Queuing of bulk requests are allowed at USBA level.
134 Calls Current state additional condition Action Next state
135 ----- ------------- -------------------- ------ -----------
136 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
138 usb_pipe_bulk_xfer USB_PIPE_STATE_IDLE No outstanding request send req to hcd USB_PIPE_STATE_ACTIVE
141 USB_PIPE_STATE_ACTIVE - send req to hcd USB_PIPE_STATE_ACTIVE
143 USB_PIPE_STATE_ERROR - return failure USB_PIPE_STATE_ERROR
145 USB_PIPE_STATE_CLOSING - return failure USB_PIPE_STATE_CLOSING
147 usba_hcdi_cb USB_PIPE_STATE_ACTIVE if no requests are pending Before doing callback USB_PIPE_STATE_IDLE
148 else outstanding reqs pending Before doing callback USB_PIPE_STATE_ACTIVE
151 USB_PIPE_STATE_ERROR - - USB_PIPE_STATE_ERROR
152 USB_PIPE_STATE_CLOSING - - USB_PIPE_STATE_CLOSING
156 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
157 - On auto clear USB_PIPE_STATE_IDLE
158 (Remove all outstanding
161 usb_pipe_reset USB_PIPE_STATE_XXXX - Remove all outstanding USB_PIPE_STATE_IDLE
165 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
166 USB_PIPE_STATE_ACTIVE
168 Once pipe is closed - USB_PIPE_STATE_CLOSED
170 3. Interrupt pipe state transitions (endpoint number > 1, both IN and OUT) :-
174 Calls Current state additional condition Action Next state
175 ----- ------------- -------------------- ------ -----------
176 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
178 usb_pipe_intr_xfer USB_PIPE_STATE_IDLE - send req to hcd USB_PIPE_STATE_ACTIVE
180 USB_PIPE_STATE_ACTIVE - return failure USB_PIPE_STATE_ACTIVE
182 USB_PIPE_STATE_CLOSING
184 usba_hcdi_cb USB_PIPE_STATE_ACTIVE One time xfer Before doing callback USB_PIPE_STATE_IDLE
185 USB_CR_STOPPED_POLLING
188 USB_PIPE_STATE_ERROR - - USB_PIPE_STATE_ERROR
189 USB_PIPE_STATE_CLOSING - - USB_PIPE_STATE_CLOSING
193 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
194 - On auto clear USB_PIPE_STATE_IDLE
195 (Remove all outstanding
198 usb_pipe_reset USB_PIPE_STATE_XXXX - Remove all outstanding USB_PIPE_STATE_IDLE
202 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
203 USB_PIPE_STATE_ACTIVE
205 Once pipe is closed - USB_PIPE_STATE_CLOSED
209 NOTE: Send all interrupt OUT requests to HCD and no queuing at USBA level.
211 Calls Current state additional condition Action Next state
212 ----- ------------- -------------------- ------ -----------
213 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
215 usb_pipe_intr_xfer USB_PIPE_STATE_IDLE - send req to hcd USB_PIPE_STATE_ACTIVE
218 USB_PIPE_STATE_ACTIVE - send req to hcd USB_PIPE_STATE_ACTIVE
220 USB_PIPE_STATE_ERROR - return failure USB_PIPE_STATE_ERROR
222 USB_PIPE_STATE_CLOSING - return failure USB_PIPE_STATE_CLOSING
224 usba_hcdi_cb USB_PIPE_STATE_ACTIVE if no requests are pending Before doing callback USB_PIPE_STATE_IDLE
225 else outstanding reqs pending Before doing callback USB_PIPE_STATE_ACTIVE
228 USB_PIPE_STATE_ERROR - - USB_PIPE_STATE_ERROR
229 USB_PIPE_STATE_CLOSING - - USB_PIPE_STATE_CLOSING
233 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
234 - On auto clear USB_PIPE_STATE_IDLE
235 (Remove all outstanding
238 usb_pipe_reset USB_PIPE_STATE_XXXX - Remove all outstanding USB_PIPE_STATE_IDLE
242 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
243 USB_PIPE_STATE_ACTIVE
245 Once pipe is closed - USB_PIPE_STATE_CLOSED
247 4. Isochronous pipe state transitions (endpoint number > 1, both IN and OUT):-
251 Calls Current state additional condition Action Next state
252 ----- ------------- -------------------- ------ -----------
253 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
255 usb_pipe_isoch_xfer USB_PIPE_STATE_IDLE - send req to hcd USB_PIPE_STATE_ACTIVE
257 USB_PIPE_STATE_ACTIVE - return failure USB_PIPE_STATE_ACTIVE
259 USB_PIPE_STATE_CLOSING
261 usba_hcdi_cb USB_PIPE_STATE_ACTIVE One time xfer Before doing callback USB_PIPE_STATE_IDLE
262 USB_CR_STOPPED_POLLING
265 USB_PIPE_STATE_ERROR - - USB_PIPE_STATE_ERROR
266 USB_PIPE_STATE_CLOSING - - USB_PIPE_STATE_CLOSING
270 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
271 - On auto clear USB_PIPE_STATE_IDLE
272 (Remove all outstanding
275 usb_pipe_reset USB_PIPE_STATE_XXXX - Remove all outstanding USB_PIPE_STATE_IDLE
279 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
280 USB_PIPE_STATE_ACTIVE
282 Once pipe is closed - USB_PIPE_STATE_CLOSED
286 NOTE: Send all isochronous OUT requests to HCD and no queuing at USBA level.
288 Calls Current state additional condition Action Next state
289 ----- ------------- -------------------- ------ -----------
290 usb_pipe_open USB_PIPE_STATE_CLOSED - Initialize pipe USB_PIPE_STATE_IDLE
292 usb_pipe_intr_xfer USB_PIPE_STATE_IDLE - send req to hcd USB_PIPE_STATE_ACTIVE
295 USB_PIPE_STATE_ACTIVE - send req to hcd USB_PIPE_STATE_ACTIVE
297 USB_PIPE_STATE_ERROR - return failure USB_PIPE_STATE_ERROR
299 USB_PIPE_STATE_CLOSING - return failure USB_PIPE_STATE_CLOSING
301 usba_hcdi_cb USB_PIPE_STATE_ACTIVE if no requests are pending Before doing callback USB_PIPE_STATE_IDLE
302 else outstanding reqs pending Before doing callback USB_PIPE_STATE_ACTIVE
305 USB_PIPE_STATE_ERROR - - USB_PIPE_STATE_ERROR
306 USB_PIPE_STATE_CLOSING - - USB_PIPE_STATE_CLOSING
310 (exceptional callback) USB_PIPE_STATE_ACTIVE - Before auto clear USB_PIPE_STATE_ERROR
311 - On auto clear USB_PIPE_STATE_IDLE
312 (Remove all outstanding
315 usb_pipe_reset USB_PIPE_STATE_XXXX - Remove all outstanding USB_PIPE_STATE_IDLE
319 usb_pipe_close USB_PIPE_STATE_IDLE - - USB_PIPE_STATE_CLOSING
320 USB_PIPE_STATE_ACTIVE
322 Once pipe is closed - USB_PIPE_STATE_CLOSED