Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / uts / common / io / usb / usba / README
blob104fcdc21d35ea332d4dbbfb7f56f0ed5ba8e267
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
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
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)
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
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
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
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
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)
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
110                         
111                                 USB_PIPE_STATE_ERROR    -                               Don't send any more req USB_PIPE_STATE_ERROR
112                                 USB_PIPE_STATE_CLOSING
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
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
140    
141                                 USB_PIPE_STATE_ACTIVE   -                               send req to hcd         USB_PIPE_STATE_ACTIVE
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
150                         
151                                 USB_PIPE_STATE_ERROR    -                               -                       USB_PIPE_STATE_ERROR
152                                 USB_PIPE_STATE_CLOSING  -                               -                       USB_PIPE_STATE_CLOSING
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
170 3. Interrupt pipe state transitions (endpoint number > 1, both IN and OUT) :-
172    Interrupt IN:
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
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
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
207    Interrupt OUT:
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
217    
218                                 USB_PIPE_STATE_ACTIVE   -                               send req to hcd         USB_PIPE_STATE_ACTIVE
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
227                         
228                                 USB_PIPE_STATE_ERROR    -                               -                       USB_PIPE_STATE_ERROR
229                                 USB_PIPE_STATE_CLOSING  -                               -                       USB_PIPE_STATE_CLOSING
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
247 4. Isochronous pipe state transitions (endpoint number > 1, both IN and OUT):-
249    Isochronous IN:
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
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
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
284    Isochronous OUT:-
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
294    
295                                 USB_PIPE_STATE_ACTIVE   -                               send req to hcd         USB_PIPE_STATE_ACTIVE
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
304                         
305                                 USB_PIPE_STATE_ERROR    -                               -                       USB_PIPE_STATE_ERROR
306                                 USB_PIPE_STATE_CLOSING  -                               -                       USB_PIPE_STATE_CLOSING
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