hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/usb/gadget/function/u_serial.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0+
1
+/* SPDX-License-Identifier: GPL-2.0+ */
22 /*
33 * u_serial.h - interface to USB gadget "serial port"/TTY utilities
44 *
....@@ -12,7 +12,7 @@
1212 #include <linux/usb/composite.h>
1313 #include <linux/usb/cdc.h>
1414
15
-#define MAX_U_SERIAL_PORTS 4
15
+#define MAX_U_SERIAL_PORTS 8
1616
1717 struct f_serial_opts {
1818 struct usb_function_instance func_inst;
....@@ -54,12 +54,22 @@
5454 void gs_free_req(struct usb_ep *, struct usb_request *req);
5555
5656 /* management of individual TTY ports */
57
+int gserial_alloc_line_no_console(unsigned char *port_line);
5758 int gserial_alloc_line(unsigned char *port_line);
5859 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 */
5967
6068 /* connect/disconnect is handled by individual functions */
6169 int gserial_connect(struct gserial *, u8 port_num);
6270 void gserial_disconnect(struct gserial *);
71
+void gserial_suspend(struct gserial *p);
72
+void gserial_resume(struct gserial *p);
6373
6474 /* functions are bound to configurations by a config or gadget driver */
6575 int gser_bind_config(struct usb_configuration *c, u8 port_num);