| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0+ */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * u_serial.h - interface to USB gadget "serial port"/TTY utilities |
|---|
| 4 | 4 | * |
|---|
| .. | .. |
|---|
| 12 | 12 | #include <linux/usb/composite.h> |
|---|
| 13 | 13 | #include <linux/usb/cdc.h> |
|---|
| 14 | 14 | |
|---|
| 15 | | -#define MAX_U_SERIAL_PORTS 4 |
|---|
| 15 | +#define MAX_U_SERIAL_PORTS 8 |
|---|
| 16 | 16 | |
|---|
| 17 | 17 | struct f_serial_opts { |
|---|
| 18 | 18 | struct usb_function_instance func_inst; |
|---|
| .. | .. |
|---|
| 54 | 54 | void gs_free_req(struct usb_ep *, struct usb_request *req); |
|---|
| 55 | 55 | |
|---|
| 56 | 56 | /* management of individual TTY ports */ |
|---|
| 57 | +int gserial_alloc_line_no_console(unsigned char *port_line); |
|---|
| 57 | 58 | int gserial_alloc_line(unsigned char *port_line); |
|---|
| 58 | 59 | void gserial_free_line(unsigned char port_line); |
|---|
| 60 | + |
|---|
| 61 | +#ifdef CONFIG_U_SERIAL_CONSOLE |
|---|
| 62 | + |
|---|
| 63 | +ssize_t gserial_set_console(unsigned char port_num, const char *page, size_t count); |
|---|
| 64 | +ssize_t gserial_get_console(unsigned char port_num, char *page); |
|---|
| 65 | + |
|---|
| 66 | +#endif /* CONFIG_U_SERIAL_CONSOLE */ |
|---|
| 59 | 67 | |
|---|
| 60 | 68 | /* connect/disconnect is handled by individual functions */ |
|---|
| 61 | 69 | int gserial_connect(struct gserial *, u8 port_num); |
|---|
| 62 | 70 | void gserial_disconnect(struct gserial *); |
|---|
| 71 | +void gserial_suspend(struct gserial *p); |
|---|
| 72 | +void gserial_resume(struct gserial *p); |
|---|
| 63 | 73 | |
|---|
| 64 | 74 | /* functions are bound to configurations by a config or gadget driver */ |
|---|
| 65 | 75 | int gser_bind_config(struct usb_configuration *c, u8 port_num); |
|---|