David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This header declares the utility functions used by "Gadget Zero", plus |
| 3 | * interfaces to its two single-configuration function drivers. |
| 4 | */ |
| 5 | |
| 6 | #ifndef __G_ZERO_H |
| 7 | #define __G_ZERO_H |
| 8 | |
Andrzej Pietrasiewicz | c0501f4 | 2013-11-07 08:41:27 +0100 | [diff] [blame^] | 9 | #define GZERO_BULK_BUFLEN 4096 |
| 10 | #define GZERO_QLEN 32 |
| 11 | |
Sebastian Andrzej Siewior | cf9a08a | 2012-12-23 21:10:01 +0100 | [diff] [blame] | 12 | struct usb_zero_options { |
| 13 | unsigned pattern; |
| 14 | unsigned isoc_interval; |
| 15 | unsigned isoc_maxpacket; |
| 16 | unsigned isoc_mult; |
| 17 | unsigned isoc_maxburst; |
| 18 | unsigned bulk_buflen; |
| 19 | unsigned qlen; |
| 20 | }; |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 21 | |
Sebastian Andrzej Siewior | cf9a08a | 2012-12-23 21:10:01 +0100 | [diff] [blame] | 22 | struct f_ss_opts { |
| 23 | struct usb_function_instance func_inst; |
| 24 | unsigned pattern; |
| 25 | unsigned isoc_interval; |
| 26 | unsigned isoc_maxpacket; |
| 27 | unsigned isoc_mult; |
| 28 | unsigned isoc_maxburst; |
| 29 | unsigned bulk_buflen; |
| 30 | }; |
| 31 | |
| 32 | struct f_lb_opts { |
| 33 | struct usb_function_instance func_inst; |
| 34 | unsigned bulk_buflen; |
| 35 | unsigned qlen; |
Andrzej Pietrasiewicz | c0501f4 | 2013-11-07 08:41:27 +0100 | [diff] [blame^] | 36 | |
| 37 | /* |
| 38 | * Read/write access to configfs attributes is handled by configfs. |
| 39 | * |
| 40 | * This is to protect the data from concurrent access by read/write |
| 41 | * and create symlink/remove symlink. |
| 42 | */ |
| 43 | struct mutex lock; |
| 44 | int refcnt; |
Sebastian Andrzej Siewior | cf9a08a | 2012-12-23 21:10:01 +0100 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | void lb_modexit(void); |
| 48 | int lb_modinit(void); |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 49 | |
| 50 | /* common utilities */ |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 51 | void free_ep_req(struct usb_ep *ep, struct usb_request *req); |
| 52 | void disable_endpoints(struct usb_composite_dev *cdev, |
Paul Zimmerman | b4036cc | 2012-04-16 14:19:06 -0700 | [diff] [blame] | 53 | struct usb_ep *in, struct usb_ep *out, |
| 54 | struct usb_ep *iso_in, struct usb_ep *iso_out); |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 55 | |
David Brownell | a400cad | 2008-06-19 17:55:23 -0700 | [diff] [blame] | 56 | #endif /* __G_ZERO_H */ |