#include <linux/kernel.h>
#include <linux/sched/signal.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/sysrq.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/uaccess.h>
#include <linux/kfifo.h>
#include <linux/serial.h>
#ifdef CONFIG_USB_SERIAL_GENERIC
static __u16 vendor = …;
static __u16 product = …;
module_param(vendor, ushort, 0);
MODULE_PARM_DESC(…) …;
module_param(product, ushort, 0);
MODULE_PARM_DESC(…) …;
static struct usb_device_id generic_device_ids[2];
static int usb_serial_generic_probe(struct usb_serial *serial,
const struct usb_device_id *id)
{ … }
static int usb_serial_generic_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static struct usb_serial_driver usb_serial_generic_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
#endif
int usb_serial_generic_register(void)
{ … }
void usb_serial_generic_deregister(void)
{ … }
int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_close(struct usb_serial_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port,
void *dest, size_t size)
{ … }
int usb_serial_generic_write_start(struct usb_serial_port *port,
gfp_t mem_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
int usb_serial_generic_write(struct tty_struct *tty,
struct usb_serial_port *port, const unsigned char *buf, int count)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int usb_serial_generic_write_room(struct tty_struct *tty)
{ … }
unsigned int usb_serial_generic_chars_in_buffer(struct tty_struct *tty)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_wait_until_sent(struct tty_struct *tty, long timeout)
{ … }
EXPORT_SYMBOL_GPL(…);
static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
int index, gfp_t mem_flags)
{ … }
int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port,
gfp_t mem_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_process_read_urb(struct urb *urb)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_read_bulk_callback(struct urb *urb)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_write_bulk_callback(struct urb *urb)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_throttle(struct tty_struct *tty)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_generic_unthrottle(struct tty_struct *tty)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool usb_serial_generic_msr_changed(struct tty_struct *tty,
unsigned long arg, struct async_icount *cprev)
{ … }
int usb_serial_generic_tiocmiwait(struct tty_struct *tty, unsigned long arg)
{ … }
EXPORT_SYMBOL_GPL(…);
int usb_serial_generic_get_icount(struct tty_struct *tty,
struct serial_icounter_struct *icount)
{ … }
EXPORT_SYMBOL_GPL(…);
#if defined(CONFIG_USB_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
{ … }
EXPORT_SYMBOL_GPL(…);
int usb_serial_handle_break(struct usb_serial_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
void usb_serial_handle_dcd_change(struct usb_serial_port *port,
struct tty_struct *tty, unsigned int status)
{ … }
EXPORT_SYMBOL_GPL(…);
int usb_serial_generic_resume(struct usb_serial *serial)
{ … }
EXPORT_SYMBOL_GPL(…);