1
2
3
4
5
6
7
8
9 #ifndef __U_SERIAL_H
10 #define __U_SERIAL_H
11
12 #include <linux/usb/composite.h>
13 #include <linux/usb/cdc.h>
14
15 #define MAX_U_SERIAL_PORTS 4
16
17 struct f_serial_opts {
18 struct usb_function_instance func_inst;
19 u8 port_num;
20 };
21
22
23
24
25
26
27
28
29
30
31
32
33
34 struct gserial {
35 struct usb_function func;
36
37
38 struct gs_port *ioport;
39
40 struct usb_ep *in;
41 struct usb_ep *out;
42
43
44 struct usb_cdc_line_coding port_line_coding;
45
46
47 void (*connect)(struct gserial *p);
48 void (*disconnect)(struct gserial *p);
49 int (*send_break)(struct gserial *p, int duration);
50 };
51
52
53 struct usb_request *gs_alloc_req(struct usb_ep *ep, unsigned len, gfp_t flags);
54 void gs_free_req(struct usb_ep *, struct usb_request *req);
55
56
57 int gserial_alloc_line(unsigned char *port_line);
58 void gserial_free_line(unsigned char port_line);
59
60
61 int gserial_connect(struct gserial *, u8 port_num);
62 void gserial_disconnect(struct gserial *);
63
64
65 int gser_bind_config(struct usb_configuration *c, u8 port_num);
66 int obex_bind_config(struct usb_configuration *c, u8 port_num);
67
68 #endif