#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/uaccess.h>
#include <linux/serial.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/kfifo.h>
#include <linux/idr.h>
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define USB_SERIAL_TTY_MAJOR …
#define USB_SERIAL_TTY_MINORS …
static DEFINE_IDR(serial_minors);
static DEFINE_MUTEX(table_lock);
static LIST_HEAD(usb_serial_driver_list);
struct usb_serial_port *usb_serial_port_get_by_minor(unsigned minor)
{ … }
static int allocate_minors(struct usb_serial *serial, int num_ports)
{ … }
static void release_minors(struct usb_serial *serial)
{ … }
int usb_serial_claim_interface(struct usb_serial *serial, struct usb_interface *intf)
{ … }
EXPORT_SYMBOL_GPL(…);
static void release_sibling(struct usb_serial *serial, struct usb_interface *intf)
{ … }
static void destroy_serial(struct kref *kref)
{ … }
void usb_serial_put(struct usb_serial *serial)
{ … }
static int serial_install(struct tty_driver *driver, struct tty_struct *tty)
{ … }
static int serial_port_activate(struct tty_port *tport, struct tty_struct *tty)
{ … }
static int serial_open(struct tty_struct *tty, struct file *filp)
{ … }
static void serial_port_shutdown(struct tty_port *tport)
{ … }
static void serial_hangup(struct tty_struct *tty)
{ … }
static void serial_close(struct tty_struct *tty, struct file *filp)
{ … }
static void serial_cleanup(struct tty_struct *tty)
{ … }
static ssize_t serial_write(struct tty_struct *tty, const u8 *buf, size_t count)
{ … }
static unsigned int serial_write_room(struct tty_struct *tty)
{ … }
static unsigned int serial_chars_in_buffer(struct tty_struct *tty)
{ … }
static void serial_wait_until_sent(struct tty_struct *tty, int timeout)
{ … }
static void serial_throttle(struct tty_struct *tty)
{ … }
static void serial_unthrottle(struct tty_struct *tty)
{ … }
static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
{ … }
static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
{ … }
static int serial_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{ … }
static void serial_set_termios(struct tty_struct *tty,
const struct ktermios *old)
{ … }
static int serial_break(struct tty_struct *tty, int break_state)
{ … }
static int serial_proc_show(struct seq_file *m, void *v)
{ … }
static int serial_tiocmget(struct tty_struct *tty)
{ … }
static int serial_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static int serial_get_icount(struct tty_struct *tty,
struct serial_icounter_struct *icount)
{ … }
void usb_serial_port_softint(struct usb_serial_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
static void usb_serial_port_work(struct work_struct *work)
{ … }
static void usb_serial_port_poison_urbs(struct usb_serial_port *port)
{ … }
static void usb_serial_port_unpoison_urbs(struct usb_serial_port *port)
{ … }
static void usb_serial_port_release(struct device *dev)
{ … }
static struct usb_serial *create_serial(struct usb_device *dev,
struct usb_interface *interface,
struct usb_serial_driver *driver)
{ … }
static const struct usb_device_id *match_dynamic_id(struct usb_interface *intf,
struct usb_serial_driver *drv)
{ … }
static const struct usb_device_id *get_iface_id(struct usb_serial_driver *drv,
struct usb_interface *intf)
{ … }
static struct usb_serial_driver *search_serial_device(
struct usb_interface *iface)
{ … }
static bool serial_port_carrier_raised(struct tty_port *port)
{ … }
static void serial_port_dtr_rts(struct tty_port *port, bool on)
{ … }
static ssize_t port_number_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(port_number);
static struct attribute *usb_serial_port_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct tty_port_operations serial_port_ops = …;
static void store_endpoint(struct usb_serial *serial,
struct usb_serial_endpoints *epds,
struct usb_endpoint_descriptor *epd)
{ … }
static void find_endpoints(struct usb_serial *serial,
struct usb_serial_endpoints *epds,
struct usb_interface *intf)
{ … }
static int setup_port_bulk_in(struct usb_serial_port *port,
struct usb_endpoint_descriptor *epd)
{ … }
static int setup_port_bulk_out(struct usb_serial_port *port,
struct usb_endpoint_descriptor *epd)
{ … }
static int setup_port_interrupt_in(struct usb_serial_port *port,
struct usb_endpoint_descriptor *epd)
{ … }
static int setup_port_interrupt_out(struct usb_serial_port *port,
struct usb_endpoint_descriptor *epd)
{ … }
static int usb_serial_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{ … }
static void usb_serial_disconnect(struct usb_interface *interface)
{ … }
int usb_serial_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
EXPORT_SYMBOL(…);
static void usb_serial_unpoison_port_urbs(struct usb_serial *serial)
{ … }
int usb_serial_resume(struct usb_interface *intf)
{ … }
EXPORT_SYMBOL(…);
static int usb_serial_reset_resume(struct usb_interface *intf)
{ … }
static const struct tty_operations serial_ops = …;
struct tty_driver *usb_serial_tty_driver;
static int __init usb_serial_init(void)
{ … }
static void __exit usb_serial_exit(void)
{ … }
module_init(…) …;
module_exit(usb_serial_exit);
#define set_to_generic_if_null(type, function) …
static void usb_serial_operations_init(struct usb_serial_driver *device)
{ … }
static int usb_serial_register(struct usb_serial_driver *driver)
{ … }
static void usb_serial_deregister(struct usb_serial_driver *device)
{ … }
int usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers[],
const char *name,
const struct usb_device_id *id_table)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_serial_deregister_drivers(struct usb_serial_driver *const serial_drivers[])
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;