blob: 19ec50a42a74c65f247df28ef30e2a357aa2b93f [file] [log] [blame]
David Brownella400cad2008-06-19 17:55:23 -07001/*
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 Pietrasiewiczc0501f42013-11-07 08:41:27 +01009#define GZERO_BULK_BUFLEN 4096
10#define GZERO_QLEN 32
11
Sebastian Andrzej Siewiorcf9a08a2012-12-23 21:10:01 +010012struct 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 Brownella400cad2008-06-19 17:55:23 -070021
Sebastian Andrzej Siewiorcf9a08a2012-12-23 21:10:01 +010022struct 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
32struct f_lb_opts {
33 struct usb_function_instance func_inst;
34 unsigned bulk_buflen;
35 unsigned qlen;
Andrzej Pietrasiewiczc0501f42013-11-07 08:41:27 +010036
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 Siewiorcf9a08a2012-12-23 21:10:01 +010045};
46
47void lb_modexit(void);
48int lb_modinit(void);
David Brownella400cad2008-06-19 17:55:23 -070049
50/* common utilities */
David Brownella400cad2008-06-19 17:55:23 -070051void free_ep_req(struct usb_ep *ep, struct usb_request *req);
52void disable_endpoints(struct usb_composite_dev *cdev,
Paul Zimmermanb4036cc2012-04-16 14:19:06 -070053 struct usb_ep *in, struct usb_ep *out,
54 struct usb_ep *iso_in, struct usb_ep *iso_out);
David Brownella400cad2008-06-19 17:55:23 -070055
David Brownella400cad2008-06-19 17:55:23 -070056#endif /* __G_ZERO_H */