xref: /titanic_41/usr/src/uts/common/io/usb/usba/README (revision 4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22/*
23 * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29				USBA PIPE STATE TRANSITIONS INFORMATION
30				---------------------------------------
31
321. Control pipe state transitions:-
33
34   o Default control pipe (endpoint number 0):
35
36     NOTE:- Queuing of control requests are allowed at USBA level.
37
38     Calls			Current state		additional condition		Action			Next state
39     -----			-------------		--------------------		------			-----------
40     usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
41
42     usb_pipe_ctrl_xfer		USB_PIPE_STATE_IDLE	No outstanding request		send req to hcd		USB_PIPE_STATE_ACTIVE
43   							Outstanding reqs pending	queue the requests	USB_PIPE_STATE_IDLE
44 											(cb() will send
45 											next reqs to hcd)
46
47 				USB_PIPE_STATE_ACTIVE	-				queue the requests	USB_PIPE_STATE_ACTIVE
48 											(cb() will send
49 											next reqs to hcd)
50
51 				USB_PIPE_STATE_ERROR	-				queue the requests	USB_PIPE_STATE_ERROR
52 											(cb() will send
53 											next reqs to hcd)
54
55 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
56
57
58     usba_hcdi_cb		USB_PIPE_STATE_ACTIVE	-				Before doing callback	USB_PIPE_STATE_IDLE
59     (Normal callback)					No outstanding request		-			USB_PIPE_STATE_IDLE
60  							Outstanding reqs pending	Send next req to hcd	USB_PIPE_STATE_ACTIVE
61
62
63 				USB_PIPE_STATE_ERROR	-				Don't send any more req	USB_PIPE_STATE_ERROR
64
65 				USB_PIPE_STATE_CLOSING	-				Don't send any more req	USB_PIPE_STATE_CLOSING
66
67
68     usba_hcdi_cb
69     (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
70							-				On auto clear		USB_PIPE_STATE_IDLE
71											(Don't remove
72											outstanding requests)
73							No outstanding request		-			USB_PIPE_STATE_IDLE
74							Outstanding reqs pending	Send next req to hcd	USB_PIPE_STATE_ACTIVE
75
76     usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Return failure		USB_PIPE_STATE_XXXX
77  											(Not allowed)
78
79
80     usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
81				USB_PIPE_STATE_ACTIVE
82				USB_PIPE_STATE_ERROR
83							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
84
85
86   o Normal control pipe (endpoint number > 0):
87
88     NOTE:- Queuing of control requests are allowed at USBA level.
89
90     Calls			Current state		additional condition		Action			Next state
91     -----			-------------		--------------------		------			-----------
92     usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
93
94     usb_pipe_ctrl_xfer		USB_PIPE_STATE_IDLE	No outstanding request		send req to hcd		USB_PIPE_STATE_ACTIVE
95   							Outstanding reqs pending	queue the requests	USB_PIPE_STATE_IDLE
96 											(cb() will send
97 											next reqs to hcd)
98
99 				USB_PIPE_STATE_ACTIVE	-				queue the requests	USB_PIPE_STATE_ACTIVE
100 											(cb() will send
101 											next reqs to hcd)
102
103 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
104
105 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
106
107
108     usba_hcdi_cb		USB_PIPE_STATE_ACTIVE	-				Before doing callback	USB_PIPE_STATE_IDLE
109     (Normal callback)					No outstanding request		-			USB_PIPE_STATE_IDLE
110  							Outstanding reqs pending	Send next req to hcd	USB_PIPE_STATE_ACTIVE
111
112
113 				USB_PIPE_STATE_ERROR	-				Don't send any more req	USB_PIPE_STATE_ERROR
114 				USB_PIPE_STATE_CLOSING
115
116
117     usba_hcdi_cb
118     (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
119							-				On auto clear		USB_PIPE_STATE_IDLE
120											(Remove all outstanding
121											requests)
122
123     usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
124  											requests
125
126
127     usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
128				USB_PIPE_STATE_ACTIVE
129				USB_PIPE_STATE_ERROR
130							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
131
1322. Bulk pipe state transitions (endpoint number > 1, both IN and OUT):-
133
134   NOTE:- Queuing of bulk requests are allowed at USBA level.
135
136   Calls			Current state		additional condition		Action			Next state
137   -----			-------------		--------------------		------			-----------
138   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
139
140   usb_pipe_bulk_xfer		USB_PIPE_STATE_IDLE	No outstanding request		send req to hcd		USB_PIPE_STATE_ACTIVE
141
142
143 				USB_PIPE_STATE_ACTIVE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
144
145 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
146
147 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
148
149   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	if no requests are pending	Before doing callback	USB_PIPE_STATE_IDLE
150  							else outstanding reqs pending	Before doing callback	USB_PIPE_STATE_ACTIVE
151
152
153 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
154 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
155
156
157   usba_hcdi_cb
158   (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
159							-				On auto clear		USB_PIPE_STATE_IDLE
160											(Remove all outstanding
161											requests)
162
163   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
164  											requests
165
166
167   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
168				USB_PIPE_STATE_ACTIVE
169				USB_PIPE_STATE_ERROR
170							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
171
1723. Interrupt pipe state transitions (endpoint number > 1, both IN and OUT) :-
173
174   Interrupt IN:
175
176   Calls			Current state		additional condition		Action			Next state
177   -----			-------------		--------------------		------			-----------
178   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
179
180   usb_pipe_intr_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
181
182 				USB_PIPE_STATE_ACTIVE	-				return failure		USB_PIPE_STATE_ACTIVE
183 				USB_PIPE_STATE_ERROR
184 				USB_PIPE_STATE_CLOSING
185
186   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	One time xfer			Before doing callback	USB_PIPE_STATE_IDLE
187							USB_CR_STOPPED_POLLING
188							USB_CR_PIPE_RESET
189
190 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
191 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
192
193
194   usba_hcdi_cb
195   (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
196							-				On auto clear		USB_PIPE_STATE_IDLE
197											(Remove all outstanding
198											requests)
199
200   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
201  											requests
202
203
204   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
205				USB_PIPE_STATE_ACTIVE
206				USB_PIPE_STATE_ERROR
207							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
208
209   Interrupt OUT:
210
211   NOTE: Send all interrupt OUT requests to HCD and no queuing at USBA level.
212
213   Calls			Current state		additional condition		Action			Next state
214   -----			-------------		--------------------		------			-----------
215   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
216
217   usb_pipe_intr_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
218
219
220 				USB_PIPE_STATE_ACTIVE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
221
222 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
223
224 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
225
226   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	if no requests are pending	Before doing callback	USB_PIPE_STATE_IDLE
227  							else outstanding reqs pending	Before doing callback	USB_PIPE_STATE_ACTIVE
228
229
230 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
231 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
232
233
234   usba_hcdi_cb
235   (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
236							-				On auto clear		USB_PIPE_STATE_IDLE
237											(Remove all outstanding
238											requests)
239
240   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
241  											requests
242
243
244   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
245				USB_PIPE_STATE_ACTIVE
246				USB_PIPE_STATE_ERROR
247							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
248
2494. Isochronous pipe state transitions (endpoint number > 1, both IN and OUT):-
250
251   Isochronous IN:
252
253   Calls			Current state		additional condition		Action			Next state
254   -----			-------------		--------------------		------			-----------
255   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
256
257   usb_pipe_isoch_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
258
259 				USB_PIPE_STATE_ACTIVE	-				return failure		USB_PIPE_STATE_ACTIVE
260 				USB_PIPE_STATE_ERROR
261 				USB_PIPE_STATE_CLOSING
262
263   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	One time xfer			Before doing callback	USB_PIPE_STATE_IDLE
264							USB_CR_STOPPED_POLLING
265							USB_CR_PIPE_RESET
266
267 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
268 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
269
270
271   usba_hcdi_cb
272   (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
273							-				On auto clear		USB_PIPE_STATE_IDLE
274											(Remove all outstanding
275											requests)
276
277   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
278  											requests
279
280
281   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
282				USB_PIPE_STATE_ACTIVE
283				USB_PIPE_STATE_ERROR
284							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
285
286   Isochronous OUT:-
287
288   NOTE: Send all isochronous OUT requests to HCD and no queuing at USBA level.
289
290   Calls			Current state		additional condition		Action			Next state
291   -----			-------------		--------------------		------			-----------
292   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
293
294   usb_pipe_intr_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
295
296
297 				USB_PIPE_STATE_ACTIVE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
298
299 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
300
301 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
302
303   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	if no requests are pending	Before doing callback	USB_PIPE_STATE_IDLE
304  							else outstanding reqs pending	Before doing callback	USB_PIPE_STATE_ACTIVE
305
306
307 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
308 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
309
310
311   usba_hcdi_cb
312   (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
313							-				On auto clear		USB_PIPE_STATE_IDLE
314											(Remove all outstanding
315											requests)
316
317   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
318  											requests
319
320
321   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
322				USB_PIPE_STATE_ACTIVE
323				USB_PIPE_STATE_ERROR
324							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
325
326