Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * This header declares the utility functions used by "Gadget Zero", plus
4 * interfaces to its two single-configuration function drivers.
5 */
6
7#ifndef __G_ZERO_H
8#define __G_ZERO_H
9
10#define GZERO_BULK_BUFLEN 4096
11#define GZERO_QLEN 32
12#define GZERO_ISOC_INTERVAL 4
13#define GZERO_ISOC_MAXPACKET 1024
14#define GZERO_SS_BULK_QLEN 1
15#define GZERO_SS_ISO_QLEN 8
16
17struct usb_zero_options {
18 unsigned pattern;
19 unsigned isoc_interval;
20 unsigned isoc_maxpacket;
21 unsigned isoc_mult;
22 unsigned isoc_maxburst;
23 unsigned bulk_buflen;
24 unsigned qlen;
25 unsigned ss_bulk_qlen;
26 unsigned ss_iso_qlen;
27};
28
29struct f_ss_opts {
30 struct usb_function_instance func_inst;
31 unsigned pattern;
32 unsigned isoc_interval;
33 unsigned isoc_maxpacket;
34 unsigned isoc_mult;
35 unsigned isoc_maxburst;
36 unsigned bulk_buflen;
37 unsigned bulk_qlen;
38 unsigned iso_qlen;
39
40 /*
41 * Read/write access to configfs attributes is handled by configfs.
42 *
43 * This is to protect the data from concurrent access by read/write
44 * and create symlink/remove symlink.
45 */
46 struct mutex lock;
47 int refcnt;
48};
49
50struct f_lb_opts {
51 struct usb_function_instance func_inst;
52 unsigned bulk_buflen;
53 unsigned qlen;
54
55 /*
56 * Read/write access to configfs attributes is handled by configfs.
57 *
58 * This is to protect the data from concurrent access by read/write
59 * and create symlink/remove symlink.
60 */
61 struct mutex lock;
62 int refcnt;
63};
64
65void lb_modexit(void);
66int lb_modinit(void);
67
68/* common utilities */
69void disable_endpoints(struct usb_composite_dev *cdev,
70 struct usb_ep *in, struct usb_ep *out,
71 struct usb_ep *iso_in, struct usb_ep *iso_out);
72
73#endif /* __G_ZERO_H */
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
9#define GZERO_BULK_BUFLEN 4096
10#define GZERO_QLEN 32
11#define GZERO_ISOC_INTERVAL 4
12#define GZERO_ISOC_MAXPACKET 1024
13#define GZERO_SS_BULK_QLEN 1
14#define GZERO_SS_ISO_QLEN 8
15
16struct usb_zero_options {
17 unsigned pattern;
18 unsigned isoc_interval;
19 unsigned isoc_maxpacket;
20 unsigned isoc_mult;
21 unsigned isoc_maxburst;
22 unsigned bulk_buflen;
23 unsigned qlen;
24 unsigned ss_bulk_qlen;
25 unsigned ss_iso_qlen;
26};
27
28struct f_ss_opts {
29 struct usb_function_instance func_inst;
30 unsigned pattern;
31 unsigned isoc_interval;
32 unsigned isoc_maxpacket;
33 unsigned isoc_mult;
34 unsigned isoc_maxburst;
35 unsigned bulk_buflen;
36 unsigned bulk_qlen;
37 unsigned iso_qlen;
38
39 /*
40 * Read/write access to configfs attributes is handled by configfs.
41 *
42 * This is to protect the data from concurrent access by read/write
43 * and create symlink/remove symlink.
44 */
45 struct mutex lock;
46 int refcnt;
47};
48
49struct f_lb_opts {
50 struct usb_function_instance func_inst;
51 unsigned bulk_buflen;
52 unsigned qlen;
53
54 /*
55 * Read/write access to configfs attributes is handled by configfs.
56 *
57 * This is to protect the data from concurrent access by read/write
58 * and create symlink/remove symlink.
59 */
60 struct mutex lock;
61 int refcnt;
62};
63
64void lb_modexit(void);
65int lb_modinit(void);
66
67/* common utilities */
68void disable_endpoints(struct usb_composite_dev *cdev,
69 struct usb_ep *in, struct usb_ep *out,
70 struct usb_ep *iso_in, struct usb_ep *iso_out);
71
72#endif /* __G_ZERO_H */