]> Pileus Git - ~andy/linux/blob - drivers/staging/octeon-usb/cvmx-usb.h
74edb0a72e834bcc62b57b2f3069d3e4ba6d0054
[~andy/linux] / drivers / staging / octeon-usb / cvmx-usb.h
1 /***********************license start***************
2  * Copyright (c) 2003-2010  Cavium Networks (support@cavium.com). All rights
3  * reserved.
4  *
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *   * Redistributions of source code must retain the above copyright
11  *     notice, this list of conditions and the following disclaimer.
12  *
13  *   * Redistributions in binary form must reproduce the above
14  *     copyright notice, this list of conditions and the following
15  *     disclaimer in the documentation and/or other materials provided
16  *     with the distribution.
17
18  *   * Neither the name of Cavium Networks nor the names of
19  *     its contributors may be used to endorse or promote products
20  *     derived from this software without specific prior written
21  *     permission.
22
23  * This Software, including technical data, may be subject to U.S. export  control
24  * laws, including the U.S. Export Administration Act and its  associated
25  * regulations, and may be subject to export or import  regulations in other
26  * countries.
27
28  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29  * AND WITH ALL FAULTS AND CAVIUM  NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
30  * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31  * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32  * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33  * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34  * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35  * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36  * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
37  * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38  ***********************license end**************************************/
39
40
41 /**
42  * "cvmx-usb.h" defines a set of low level USB functions to help
43  * developers create Octeon USB drivers for various operating
44  * systems. These functions provide a generic API to the Octeon
45  * USB blocks, hiding the internal hardware specific
46  * operations.
47  *
48  * At a high level the device driver needs to:
49  *
50  * - Call cvmx_usb_get_num_ports() to get the number of
51  *   supported ports.
52  * - Call cvmx_usb_initialize() for each Octeon USB port.
53  * - Enable the port using cvmx_usb_enable().
54  * - Either periodically, or in an interrupt handler, call
55  *   cvmx_usb_poll() to service USB events.
56  * - Manage pipes using cvmx_usb_open_pipe() and
57  *   cvmx_usb_close_pipe().
58  * - Manage transfers using cvmx_usb_submit_*() and
59  *   cvmx_usb_cancel*().
60  * - Shutdown USB on unload using cvmx_usb_shutdown().
61  *
62  * To monitor USB status changes, the device driver must use
63  * cvmx_usb_register_callback() to register for events that it
64  * is interested in. Below are a few hints on successfully
65  * implementing a driver on top of this API.
66  *
67  * == Initialization ==
68  *
69  * When a driver is first loaded, it is normally not necessary
70  * to bring up the USB port completely. Most operating systems
71  * expect to initialize and enable the port in two independent
72  * steps. Normally an operating system will probe hardware,
73  * initialize anything found, and then enable the hardware.
74  *
75  * In the probe phase you should:
76  * - Use cvmx_usb_get_num_ports() to determine the number of
77  *   USB port to be supported.
78  * - Allocate space for a struct cvmx_usb_state for each
79  *   port.
80  * - Tell the operating system about each port
81  *
82  * In the initialization phase you should:
83  * - Use cvmx_usb_initialize() on each port.
84  * - Do not call cvmx_usb_enable(). This leaves the USB port in
85  *   the disabled state until the operating system is ready.
86  *
87  * Finally, in the enable phase you should:
88  * - Call cvmx_usb_enable() on the appropriate port.
89  * - Note that some operating system use a RESET instead of an
90  *   enable call. To implement RESET, you should call
91  *   cvmx_usb_disable() followed by cvmx_usb_enable().
92  *
93  * == Locking ==
94  *
95  * All of the functions in the cvmx-usb API assume exclusive
96  * access to the USB hardware and internal data structures. This
97  * means that the driver must provide locking as necessary.
98  *
99  * In the single CPU state it is normally enough to disable
100  * interrupts before every call to cvmx_usb*() and enable them
101  * again after the call is complete. Keep in mind that it is
102  * very common for the callback handlers to make additional
103  * calls into cvmx-usb, so the disable/enable must be protected
104  * against recursion. As an example, the Linux kernel
105  * local_irq_save() and local_irq_restore() are perfect for this
106  * in the non SMP case.
107  *
108  * In the SMP case, locking is more complicated. For SMP you not
109  * only need to disable interrupts on the local core, but also
110  * take a lock to make sure that another core cannot call
111  * cvmx-usb.
112  *
113  * == Port callback ==
114  *
115  * The port callback prototype needs to look as follows:
116  *
117  * void port_callback(struct cvmx_usb_state *usb,
118  *                    enum cvmx_usb_callback reason,
119  *                    enum cvmx_usb_complete status,
120  *                    int pipe_handle,
121  *                    int submit_handle,
122  *                    int bytes_transferred,
123  *                    void *user_data);
124  * - "usb" is the struct cvmx_usb_state for the port.
125  * - "reason" will always be CVMX_USB_CALLBACK_PORT_CHANGED.
126  * - "status" will always be CVMX_USB_COMPLETE_SUCCESS.
127  * - "pipe_handle" will always be -1.
128  * - "submit_handle" will always be -1.
129  * - "bytes_transferred" will always be 0.
130  * - "user_data" is the void pointer originally passed along
131  *   with the callback. Use this for any state information you
132  *   need.
133  *
134  * The port callback will be called whenever the user plugs /
135  * unplugs a device from the port. It will not be called when a
136  * device is plugged / unplugged from a hub connected to the
137  * root port. Normally all the callback needs to do is tell the
138  * operating system to poll the root hub for status. Under
139  * Linux, this is performed by calling usb_hcd_poll_rh_status().
140  * In the Linux driver we use "user_data". to pass around the
141  * Linux "hcd" structure. Once the port callback completes,
142  * Linux automatically calls octeon_usb_hub_status_data() which
143  * uses cvmx_usb_get_status() to determine the root port status.
144  *
145  * == Complete callback ==
146  *
147  * The completion callback prototype needs to look as follows:
148  *
149  * void complete_callback(struct cvmx_usb_state *usb,
150  *                        enum cvmx_usb_callback reason,
151  *                        enum cvmx_usb_complete status,
152  *                        int pipe_handle,
153  *                        int submit_handle,
154  *                        int bytes_transferred,
155  *                        void *user_data);
156  * - "usb" is the struct cvmx_usb_state for the port.
157  * - "reason" will always be CVMX_USB_CALLBACK_TRANSFER_COMPLETE.
158  * - "status" will be one of the cvmx_usb_complete enumerations.
159  * - "pipe_handle" is the handle to the pipe the transaction
160  *   was originally submitted on.
161  * - "submit_handle" is the handle returned by the original
162  *   cvmx_usb_submit_* call.
163  * - "bytes_transferred" is the number of bytes successfully
164  *   transferred in the transaction. This will be zero on most
165  *   error conditions.
166  * - "user_data" is the void pointer originally passed along
167  *   with the callback. Use this for any state information you
168  *   need. For example, the Linux "urb" is stored in here in the
169  *   Linux driver.
170  *
171  * In general your callback handler should use "status" and
172  * "bytes_transferred" to tell the operating system the how the
173  * transaction completed. Normally the pipe is not changed in
174  * this callback.
175  *
176  * == Canceling transactions ==
177  *
178  * When a transaction is cancelled using cvmx_usb_cancel*(), the
179  * actual length of time until the complete callback is called
180  * can vary greatly. It may be called before cvmx_usb_cancel*()
181  * returns, or it may be called a number of usb frames in the
182  * future once the hardware frees the transaction. In either of
183  * these cases, the complete handler will receive
184  * CVMX_USB_COMPLETE_CANCEL.
185  *
186  * == Handling pipes ==
187  *
188  * USB "pipes" is a software construct created by this API to
189  * enable the ordering of usb transactions to a device endpoint.
190  * Octeon's underlying hardware doesn't have any concept
191  * equivalent to "pipes". The hardware instead has eight
192  * channels that can be used simultaneously to have up to eight
193  * transaction in process at the same time. In order to maintain
194  * ordering in a pipe, the transactions for a pipe will only be
195  * active in one hardware channel at a time. From an API user's
196  * perspective, this doesn't matter but it can be helpful to
197  * keep this in mind when you are probing hardware while
198  * debugging.
199  *
200  * Also keep in mind that usb transactions contain state
201  * information about the previous transaction to the same
202  * endpoint. Each transaction has a PID toggle that changes 0/1
203  * between each sub packet. This is maintained in the pipe data
204  * structures. For this reason, you generally cannot create and
205  * destroy a pipe for every transaction. A sequence of
206  * transaction to the same endpoint must use the same pipe.
207  *
208  * == Root Hub ==
209  *
210  * Some operating systems view the usb root port as a normal usb
211  * hub. These systems attempt to control the root hub with
212  * messages similar to the usb 2.0 spec for hub control and
213  * status. For these systems it may be necessary to write
214  * function to decode standard usb control messages into
215  * equivalent cvmx-usb API calls.
216  *
217  * == Interrupts ==
218  *
219  * If you plan on using usb interrupts, cvmx_usb_poll() must be
220  * called on every usb interrupt. It will read the usb state,
221  * call any needed callbacks, and schedule transactions as
222  * needed. Your device driver needs only to hookup an interrupt
223  * handler and call cvmx_usb_poll(). Octeon's usb port 0 causes
224  * CIU bit CIU_INT*_SUM0[USB] to be set (bit 56). For port 1,
225  * CIU bit CIU_INT_SUM1[USB1] is set (bit 17). How these bits
226  * are turned into interrupt numbers is operating system
227  * specific. For Linux, there are the convenient defines
228  * OCTEON_IRQ_USB0 and OCTEON_IRQ_USB1 for the IRQ numbers.
229  *
230  * If you aren't using interrupts, simple call cvmx_usb_poll()
231  * in your main processing loop.
232  */
233
234 #ifndef __CVMX_USB_H__
235 #define __CVMX_USB_H__
236
237 /**
238  * enum cvmx_usb_speed - the possible USB device speeds
239  *
240  * @CVMX_USB_SPEED_HIGH: Device is operation at 480Mbps
241  * @CVMX_USB_SPEED_FULL: Device is operation at 12Mbps
242  * @CVMX_USB_SPEED_LOW:  Device is operation at 1.5Mbps
243  */
244 enum cvmx_usb_speed {
245         CVMX_USB_SPEED_HIGH = 0,
246         CVMX_USB_SPEED_FULL = 1,
247         CVMX_USB_SPEED_LOW = 2,
248 };
249
250 /**
251  * enum cvmx_usb_transfer - the possible USB transfer types
252  *
253  * @CVMX_USB_TRANSFER_CONTROL:     USB transfer type control for hub and status
254  *                                 transfers
255  * @CVMX_USB_TRANSFER_ISOCHRONOUS: USB transfer type isochronous for low
256  *                                 priority periodic transfers
257  * @CVMX_USB_TRANSFER_BULK:        USB transfer type bulk for large low priority
258  *                                 transfers
259  * @CVMX_USB_TRANSFER_INTERRUPT:   USB transfer type interrupt for high priority
260  *                                 periodic transfers
261  */
262 enum cvmx_usb_transfer {
263         CVMX_USB_TRANSFER_CONTROL = 0,
264         CVMX_USB_TRANSFER_ISOCHRONOUS = 1,
265         CVMX_USB_TRANSFER_BULK = 2,
266         CVMX_USB_TRANSFER_INTERRUPT = 3,
267 };
268
269 /**
270  * enum cvmx_usb_direction - the transfer directions
271  *
272  * @CVMX_USB_DIRECTION_OUT: Data is transferring from Octeon to the device/host
273  * @CVMX_USB_DIRECTION_IN:  Data is transferring from the device/host to Octeon
274  */
275 enum cvmx_usb_direction {
276         CVMX_USB_DIRECTION_OUT,
277         CVMX_USB_DIRECTION_IN,
278 };
279
280 /**
281  * enum cvmx_usb_complete - possible callback function status codes
282  *
283  * @CVMX_USB_COMPLETE_SUCCESS:    The transaction / operation finished without
284  *                                any errors
285  * @CVMX_USB_COMPLETE_SHORT:      FIXME: This is currently not implemented
286  * @CVMX_USB_COMPLETE_CANCEL:     The transaction was canceled while in flight by
287  *                                a user call to cvmx_usb_cancel
288  * @CVMX_USB_COMPLETE_ERROR:      The transaction aborted with an unexpected
289  *                                error status
290  * @CVMX_USB_COMPLETE_STALL:      The transaction received a USB STALL response
291  *                                from the device
292  * @CVMX_USB_COMPLETE_XACTERR:    The transaction failed with an error from the
293  *                                device even after a number of retries
294  * @CVMX_USB_COMPLETE_DATATGLERR: The transaction failed with a data toggle
295  *                                error even after a number of retries
296  * @CVMX_USB_COMPLETE_BABBLEERR:  The transaction failed with a babble error
297  * @CVMX_USB_COMPLETE_FRAMEERR:   The transaction failed with a frame error
298  *                                even after a number of retries
299  */
300 enum cvmx_usb_complete {
301         CVMX_USB_COMPLETE_SUCCESS,
302         CVMX_USB_COMPLETE_SHORT,
303         CVMX_USB_COMPLETE_CANCEL,
304         CVMX_USB_COMPLETE_ERROR,
305         CVMX_USB_COMPLETE_STALL,
306         CVMX_USB_COMPLETE_XACTERR,
307         CVMX_USB_COMPLETE_DATATGLERR,
308         CVMX_USB_COMPLETE_BABBLEERR,
309         CVMX_USB_COMPLETE_FRAMEERR,
310 };
311
312 /**
313  * struct cvmx_usb_port_status - the USB port status information
314  *
315  * @port_enabled:       1 = Usb port is enabled, 0 = disabled
316  * @port_over_current:  1 = Over current detected, 0 = Over current not
317  *                      detected. Octeon doesn't support over current detection.
318  * @port_powered:       1 = Port power is being supplied to the device, 0 =
319  *                      power is off. Octeon doesn't support turning port power
320  *                      off.
321  * @port_speed:         Current port speed.
322  * @connected:          1 = A device is connected to the port, 0 = No device is
323  *                      connected.
324  * @connect_change:     1 = Device connected state changed since the last set
325  *                      status call.
326  */
327 struct cvmx_usb_port_status {
328         uint32_t reserved               : 25;
329         uint32_t port_enabled           : 1;
330         uint32_t port_over_current      : 1;
331         uint32_t port_powered           : 1;
332         enum cvmx_usb_speed port_speed  : 2;
333         uint32_t connected              : 1;
334         uint32_t connect_change         : 1;
335 };
336
337 /**
338  * union cvmx_usb_control_header - the structure of a Control packet header
339  *
340  * @s.request_type:     Bit 7 tells the direction: 1=IN, 0=OUT
341  * @s.request           The standard usb request to make
342  * @s.value             Value parameter for the request in little endian format
343  * @s.index             Index for the request in little endian format
344  * @s.length            Length of the data associated with this request in
345  *                      little endian format
346  */
347 union cvmx_usb_control_header {
348         uint64_t u64;
349         struct {
350                 uint64_t request_type   : 8;
351                 uint64_t request        : 8;
352                 uint64_t value          : 16;
353                 uint64_t index          : 16;
354                 uint64_t length         : 16;
355         } s;
356 };
357
358 /**
359  * struct cvmx_usb_iso_packet - descriptor for Isochronous packets
360  *
361  * @offset:     This is the offset in bytes into the main buffer where this data
362  *              is stored.
363  * @length:     This is the length in bytes of the data.
364  * @status:     This is the status of this individual packet transfer.
365  */
366 struct cvmx_usb_iso_packet {
367         int offset;
368         int length;
369         enum cvmx_usb_complete status;
370 };
371
372 /**
373  * enum cvmx_usb_callback - possible callback reasons for the USB API
374  *
375  * @CVMX_USB_CALLBACK_TRANSFER_COMPLETE: A callback of this type is called when
376  *                                       a submitted transfer completes. The
377  *                                       completion callback will be called even
378  *                                       if the transfer fails or is canceled.
379  *                                       The status parameter will contain
380  *                                       details of why he callback was called.
381  * @CVMX_USB_CALLBACK_PORT_CHANGED:      The status of the port changed. For
382  *                                       example, someone may have plugged a
383  *                                       device in. The status parameter
384  *                                       contains CVMX_USB_COMPLETE_SUCCESS. Use
385  *                                       cvmx_usb_get_status() to get the new
386  *                                       port status.
387  * @__CVMX_USB_CALLBACK_END:             Do not use. Used internally for array
388  *                                       bounds.
389  */
390 enum cvmx_usb_callback {
391         CVMX_USB_CALLBACK_TRANSFER_COMPLETE,
392         CVMX_USB_CALLBACK_PORT_CHANGED,
393         __CVMX_USB_CALLBACK_END
394 };
395
396 /**
397  * USB state internal data. The contents of this structure
398  * may change in future SDKs. No data in it should be referenced
399  * by user's of this API.
400  */
401 struct cvmx_usb_state {
402         char data[65536];
403 };
404
405 /**
406  * USB callback functions are always of the following type.
407  * The parameters are as follows:
408  *      - state = USB device state populated by
409  *        cvmx_usb_initialize().
410  *      - reason = The enum cvmx_usb_callback used to register
411  *        the callback.
412  *      - status = The enum cvmx_usb_complete representing the
413  *        status code of a transaction.
414  *      - pipe_handle = The Pipe that caused this callback, or
415  *        -1 if this callback wasn't associated with a pipe.
416  *      - submit_handle = Transfer submit handle causing this
417  *        callback, or -1 if this callback wasn't associated
418  *        with a transfer.
419  *      - Actual number of bytes transfer.
420  *      - user_data = The user pointer supplied to the
421  *        function cvmx_usb_submit() or
422  *        cvmx_usb_register_callback() */
423 typedef void (*cvmx_usb_callback_func_t)(struct cvmx_usb_state *state,
424                                          enum cvmx_usb_callback reason,
425                                          enum cvmx_usb_complete status,
426                                          int pipe_handle, int submit_handle,
427                                          int bytes_transferred, void *user_data);
428
429 /**
430  * enum cvmx_usb_initialize_flags - flags used by the initialization function
431  *
432  * @CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_XI:    The USB port uses a 12MHz crystal
433  *                                            as clock source at USB_XO and
434  *                                            USB_XI.
435  * @CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_GND:   The USB port uses 12/24/48MHz 2.5V
436  *                                            board clock source at USB_XO.
437  *                                            USB_XI should be tied to GND.
438  * @CVMX_USB_INITIALIZE_FLAGS_CLOCK_MHZ_MASK: Mask for clock speed field
439  * @CVMX_USB_INITIALIZE_FLAGS_CLOCK_12MHZ:    Speed of reference clock or
440  *                                            crystal
441  * @CVMX_USB_INITIALIZE_FLAGS_CLOCK_24MHZ:    Speed of reference clock
442  * @CVMX_USB_INITIALIZE_FLAGS_CLOCK_48MHZ:    Speed of reference clock
443  * @CVMX_USB_INITIALIZE_FLAGS_NO_DMA:         Disable DMA and used polled IO for
444  *                                            data transfer use for the USB
445  */
446 enum cvmx_usb_initialize_flags {
447         CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_XI           = 1 << 0,
448         CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_GND          = 1 << 1,
449         CVMX_USB_INITIALIZE_FLAGS_CLOCK_MHZ_MASK        = 3 << 3,
450         CVMX_USB_INITIALIZE_FLAGS_CLOCK_12MHZ           = 1 << 3,
451         CVMX_USB_INITIALIZE_FLAGS_CLOCK_24MHZ           = 2 << 3,
452         CVMX_USB_INITIALIZE_FLAGS_CLOCK_48MHZ           = 3 << 3,
453         /* Bits 3-4 used to encode the clock frequency */
454         CVMX_USB_INITIALIZE_FLAGS_NO_DMA                = 1 << 5,
455 };
456
457 /**
458  * enum cvmx_usb_pipe_flags - flags for passing when a pipe is created.
459  *                            Currently no flags need to be passed.
460  *
461  * @__CVMX_USB_PIPE_FLAGS_OPEN:      Used internally to determine if a pipe is
462  *                                   open. Do not use.
463  * @__CVMX_USB_PIPE_FLAGS_SCHEDULED: Used internally to determine if a pipe is
464  *                                   actively using hardware. Do not use.
465  * @__CVMX_USB_PIPE_FLAGS_NEED_PING: Used internally to determine if a high
466  *                                   speed pipe is in the ping state. Do not
467  *                                   use.
468  */
469 enum cvmx_usb_pipe_flags {
470         __CVMX_USB_PIPE_FLAGS_OPEN      = 1 << 16,
471         __CVMX_USB_PIPE_FLAGS_SCHEDULED = 1 << 17,
472         __CVMX_USB_PIPE_FLAGS_NEED_PING = 1 << 18,
473 };
474
475 extern int cvmx_usb_get_num_ports(void);
476 extern int cvmx_usb_initialize(struct cvmx_usb_state *state,
477                                int usb_port_number);
478 extern int cvmx_usb_shutdown(struct cvmx_usb_state *state);
479 extern int cvmx_usb_enable(struct cvmx_usb_state *state);
480 extern int cvmx_usb_disable(struct cvmx_usb_state *state);
481 extern struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state);
482 extern void cvmx_usb_set_status(struct cvmx_usb_state *state, struct cvmx_usb_port_status port_status);
483 extern int cvmx_usb_open_pipe(struct cvmx_usb_state *state,
484                               enum cvmx_usb_pipe_flags flags,
485                               int device_addr, int endpoint_num,
486                               enum cvmx_usb_speed device_speed, int max_packet,
487                               enum cvmx_usb_transfer transfer_type,
488                               enum cvmx_usb_direction transfer_dir, int interval,
489                               int multi_count, int hub_device_addr,
490                               int hub_port);
491 extern int cvmx_usb_submit_bulk(struct cvmx_usb_state *state, int pipe_handle,
492                                 uint64_t buffer, int buffer_length,
493                                 cvmx_usb_callback_func_t callback,
494                                 void *user_data);
495 extern int cvmx_usb_submit_interrupt(struct cvmx_usb_state *state, int pipe_handle,
496                                      uint64_t buffer, int buffer_length,
497                                      cvmx_usb_callback_func_t callback,
498                                      void *user_data);
499 extern int cvmx_usb_submit_control(struct cvmx_usb_state *state, int pipe_handle,
500                                    uint64_t control_header,
501                                    uint64_t buffer, int buffer_length,
502                                    cvmx_usb_callback_func_t callback,
503                                    void *user_data);
504
505 /**
506  * enum cvmx_usb_isochronous_flags - flags to pass the
507  *                                   cvmx_usb_submit_isochronous() function.
508  *
509  * @CVMX_USB_ISOCHRONOUS_FLAGS_ALLOW_SHORT: Do not return an error if a transfer
510  *                                          is less than the maximum packet size
511  *                                          of the device.
512  * @CVMX_USB_ISOCHRONOUS_FLAGS_ASAP:        Schedule the transaction as soon as
513  *                                          possible.
514  */
515 enum cvmx_usb_isochronous_flags {
516         CVMX_USB_ISOCHRONOUS_FLAGS_ALLOW_SHORT  = 1 << 0,
517         CVMX_USB_ISOCHRONOUS_FLAGS_ASAP         = 1 << 1,
518 };
519
520 extern int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle,
521                                        int start_frame, int flags,
522                                        int number_packets,
523                                        struct cvmx_usb_iso_packet packets[],
524                                        uint64_t buffer, int buffer_length,
525                                        cvmx_usb_callback_func_t callback,
526                                        void *user_data);
527 extern int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle,
528                            int submit_handle);
529 extern int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle);
530 extern int cvmx_usb_close_pipe(struct cvmx_usb_state *state, int pipe_handle);
531 extern int cvmx_usb_register_callback(struct cvmx_usb_state *state,
532                                       enum cvmx_usb_callback reason,
533                                       cvmx_usb_callback_func_t callback,
534                                       void *user_data);
535 extern int cvmx_usb_get_frame_number(struct cvmx_usb_state *state);
536 extern int cvmx_usb_poll(struct cvmx_usb_state *state);
537
538 #endif  /* __CVMX_USB_H__ */