Commit 4d5a73dc authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

usb gadget serial: split out CDC ACM function

Split out CDC ACM parts of "gadget serial" to a "function driver".
Some key structural differences from the previous ACM support, shared
with with the generic serial function (next patch):

 - As a function driver, it can be combined with other functions.
   One gadget configuration could offer both serial and network
   links, as an example.

 - One serial port can be exposed in multiple configurations;
   the /dev/ttyGS0 node could be exposed regardless of which
   config the host selected.

 - One configuration can expose multiple serial ports, such as
   ttyGS0, ttyGS1, ttyGS2, and ttyGS3.

This code should be a lot easier to understand than the previous
all-in-one-big-file version of the driver.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 097db1d0
......@@ -556,6 +556,8 @@ been converted to this framework.
Near-term plans include converting all of them, except for "gadgetfs".
</para>
!Edrivers/usb/gadget/f_acm.c
</sect1>
......
......@@ -26,7 +26,7 @@ C_UTILS = composite.o usbstring.o config.o epautoconf.o
g_zero-objs := zero.o f_sourcesink.o f_loopback.o $(C_UTILS)
g_ether-objs := ether.o usbstring.o config.o epautoconf.o
g_serial-objs := serial.o u_serial.o usbstring.o config.o epautoconf.o
g_serial-objs := serial.o u_serial.o f_acm.o $(C_UTILS)
g_midi-objs := gmidi.o usbstring.o config.o epautoconf.o
gadgetfs-objs := inode.o
g_file_storage-objs := file_storage.o usbstring.o config.o \
......
This diff is collapsed.
......@@ -12,10 +12,7 @@
#ifndef __U_SERIAL_H
#define __U_SERIAL_H
/* #include <linux/usb/composite.h> */
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/composite.h>
#include <linux/usb/cdc.h>
/*
......@@ -32,7 +29,7 @@
* REVISIT someday, allow multiplexing several TTYs over these endpoints.
*/
struct gserial {
/* struct usb_function func; */
struct usb_function func;
/* port is managed by gserial_{connect,disconnect} */
struct gs_port *ioport;
......@@ -59,4 +56,7 @@ void gserial_cleanup(void);
int gserial_connect(struct gserial *, u8 port_num);
void gserial_disconnect(struct gserial *);
/* functions are bound to configurations by a config or gadget driver */
int acm_bind_config(struct usb_configuration *c, u8 port_num);
#endif /* __U_SERIAL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment