xref: /titanic_50/usr/src/uts/common/io/usb/usba/README (revision 1bdd6c0e3710e91cb1f31aa78de33cb638494480)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21/*
22 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26
27				USBA PIPE STATE TRANSITIONS INFORMATION
28				---------------------------------------
29
301. Control pipe state transitions:-
31
32   o Default control pipe (endpoint number 0):
33
34     NOTE:- Queuing of control requests are allowed at USBA level.
35
36     Calls			Current state		additional condition		Action			Next state
37     -----			-------------		--------------------		------			-----------
38     usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
39
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
42 											(cb() will send
43 											next reqs to hcd)
44
45 				USB_PIPE_STATE_ACTIVE	-				queue the requests	USB_PIPE_STATE_ACTIVE
46 											(cb() will send
47 											next reqs to hcd)
48
49 				USB_PIPE_STATE_ERROR	-				queue the requests	USB_PIPE_STATE_ERROR
50 											(cb() will send
51 											next reqs to hcd)
52
53 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
54
55
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
59
60
61 				USB_PIPE_STATE_ERROR	-				Don't send any more req	USB_PIPE_STATE_ERROR
62
63 				USB_PIPE_STATE_CLOSING	-				Don't send any more req	USB_PIPE_STATE_CLOSING
64
65
66     usba_hcdi_cb
67     (exceptional callback)	USB_PIPE_STATE_ACTIVE	-				Before auto clear	USB_PIPE_STATE_ERROR
68							-				On auto clear		USB_PIPE_STATE_IDLE
69											(Don't remove
70											outstanding requests)
71							No outstanding request		-			USB_PIPE_STATE_IDLE
72							Outstanding reqs pending	Send next req to hcd	USB_PIPE_STATE_ACTIVE
73
74     usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Return failure		USB_PIPE_STATE_XXXX
75  											(Not allowed)
76
77
78     usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
79				USB_PIPE_STATE_ACTIVE
80				USB_PIPE_STATE_ERROR
81							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
82
83
84   o Normal control pipe (endpoint number > 0):
85
86     NOTE:- Queuing of control requests are allowed at USBA level.
87
88     Calls			Current state		additional condition		Action			Next state
89     -----			-------------		--------------------		------			-----------
90     usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
91
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
94 											(cb() will send
95 											next reqs to hcd)
96
97 				USB_PIPE_STATE_ACTIVE	-				queue the requests	USB_PIPE_STATE_ACTIVE
98 											(cb() will send
99 											next reqs to hcd)
100
101 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
102
103 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
104
105
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
109
110
111 				USB_PIPE_STATE_ERROR	-				Don't send any more req	USB_PIPE_STATE_ERROR
112 				USB_PIPE_STATE_CLOSING
113
114
115     usba_hcdi_cb
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
119											requests)
120
121     usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
122  											requests
123
124
125     usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
126				USB_PIPE_STATE_ACTIVE
127				USB_PIPE_STATE_ERROR
128							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
129
1302. Bulk pipe state transitions (endpoint number > 1, both IN and OUT):-
131
132   NOTE:- Queuing of bulk requests are allowed at USBA level.
133
134   Calls			Current state		additional condition		Action			Next state
135   -----			-------------		--------------------		------			-----------
136   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
137
138   usb_pipe_bulk_xfer		USB_PIPE_STATE_IDLE	No outstanding request		send req to hcd		USB_PIPE_STATE_ACTIVE
139
140
141 				USB_PIPE_STATE_ACTIVE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
142
143 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
144
145 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
146
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
149
150
151 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
152 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
153
154
155   usba_hcdi_cb
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
159											requests)
160
161   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
162  											requests
163
164
165   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
166				USB_PIPE_STATE_ACTIVE
167				USB_PIPE_STATE_ERROR
168							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
169
1703. Interrupt pipe state transitions (endpoint number > 1, both IN and OUT) :-
171
172   Interrupt IN:
173
174   Calls			Current state		additional condition		Action			Next state
175   -----			-------------		--------------------		------			-----------
176   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
177
178   usb_pipe_intr_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
179
180 				USB_PIPE_STATE_ACTIVE	-				return failure		USB_PIPE_STATE_ACTIVE
181 				USB_PIPE_STATE_ERROR
182 				USB_PIPE_STATE_CLOSING
183
184   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	One time xfer			Before doing callback	USB_PIPE_STATE_IDLE
185							USB_CR_STOPPED_POLLING
186							USB_CR_PIPE_RESET
187
188 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
189 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
190
191
192   usba_hcdi_cb
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
196											requests)
197
198   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
199  											requests
200
201
202   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
203				USB_PIPE_STATE_ACTIVE
204				USB_PIPE_STATE_ERROR
205							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
206
207   Interrupt OUT:
208
209   NOTE: Send all interrupt OUT requests to HCD and no queuing at USBA level.
210
211   Calls			Current state		additional condition		Action			Next state
212   -----			-------------		--------------------		------			-----------
213   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
214
215   usb_pipe_intr_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
216
217
218 				USB_PIPE_STATE_ACTIVE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
219
220 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
221
222 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
223
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
226
227
228 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
229 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
230
231
232   usba_hcdi_cb
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
236											requests)
237
238   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
239  											requests
240
241
242   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
243				USB_PIPE_STATE_ACTIVE
244				USB_PIPE_STATE_ERROR
245							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
246
2474. Isochronous pipe state transitions (endpoint number > 1, both IN and OUT):-
248
249   Isochronous IN:
250
251   Calls			Current state		additional condition		Action			Next state
252   -----			-------------		--------------------		------			-----------
253   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
254
255   usb_pipe_isoch_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
256
257 				USB_PIPE_STATE_ACTIVE	-				return failure		USB_PIPE_STATE_ACTIVE
258 				USB_PIPE_STATE_ERROR
259 				USB_PIPE_STATE_CLOSING
260
261   usba_hcdi_cb			USB_PIPE_STATE_ACTIVE	One time xfer			Before doing callback	USB_PIPE_STATE_IDLE
262							USB_CR_STOPPED_POLLING
263							USB_CR_PIPE_RESET
264
265 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
266 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
267
268
269   usba_hcdi_cb
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
273											requests)
274
275   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
276  											requests
277
278
279   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
280				USB_PIPE_STATE_ACTIVE
281				USB_PIPE_STATE_ERROR
282							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
283
284   Isochronous OUT:-
285
286   NOTE: Send all isochronous OUT requests to HCD and no queuing at USBA level.
287
288   Calls			Current state		additional condition		Action			Next state
289   -----			-------------		--------------------		------			-----------
290   usb_pipe_open		USB_PIPE_STATE_CLOSED	-				Initialize pipe		USB_PIPE_STATE_IDLE
291
292   usb_pipe_intr_xfer		USB_PIPE_STATE_IDLE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
293
294
295 				USB_PIPE_STATE_ACTIVE	-				send req to hcd		USB_PIPE_STATE_ACTIVE
296
297 				USB_PIPE_STATE_ERROR	-				return failure		USB_PIPE_STATE_ERROR
298
299 				USB_PIPE_STATE_CLOSING	-				return failure		USB_PIPE_STATE_CLOSING
300
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
303
304
305 				USB_PIPE_STATE_ERROR	-				-			USB_PIPE_STATE_ERROR
306 				USB_PIPE_STATE_CLOSING	-				-			USB_PIPE_STATE_CLOSING
307
308
309   usba_hcdi_cb
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
313											requests)
314
315   usb_pipe_reset		USB_PIPE_STATE_XXXX	-				Remove all outstanding	USB_PIPE_STATE_IDLE
316  											requests
317
318
319   usb_pipe_close		USB_PIPE_STATE_IDLE	-				-			USB_PIPE_STATE_CLOSING
320				USB_PIPE_STATE_ACTIVE
321				USB_PIPE_STATE_ERROR
322							Once pipe is closed		-			USB_PIPE_STATE_CLOSED
323
324