#undef DEBUG
#undef VERBOSE_DEBUG
#include <linux/kernel.h>
#include <linux/sched/signal.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/log2.h>
#include <linux/tty.h>
#include <linux/serial.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/tty_ldisc.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/cdc.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <linux/idr.h>
#include <linux/list.h>
#include "cdc-acm.h"
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
static struct usb_driver acm_driver;
static struct tty_driver *acm_tty_driver;
static DEFINE_IDR(acm_minors);
static DEFINE_MUTEX(acm_minors_lock);
static void acm_tty_set_termios(struct tty_struct *tty,
const struct ktermios *termios_old);
static struct acm *acm_get_by_minor(unsigned int minor)
{ … }
static int acm_alloc_minor(struct acm *acm)
{ … }
static void acm_release_minor(struct acm *acm)
{ … }
static int acm_ctrl_msg(struct acm *acm, int request, int value,
void *buf, int len)
{ … }
static inline int acm_set_control(struct acm *acm, int control)
{ … }
#define acm_set_line(acm, line) …
#define acm_send_break(acm, ms) …
static void acm_poison_urbs(struct acm *acm)
{ … }
static void acm_unpoison_urbs(struct acm *acm)
{ … }
static int acm_wb_alloc(struct acm *acm)
{ … }
static int acm_wb_is_avail(struct acm *acm)
{ … }
static void acm_write_done(struct acm *acm, struct acm_wb *wb)
{ … }
static int acm_start_wb(struct acm *acm, struct acm_wb *wb)
{ … }
static ssize_t bmCapabilities_show
(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(bmCapabilities);
static ssize_t wCountryCodes_show
(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(wCountryCodes);
static ssize_t iCountryCodeRelDate_show
(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(iCountryCodeRelDate);
static void acm_process_notification(struct acm *acm, unsigned char *buf)
{ … }
static void acm_ctrl_irq(struct urb *urb)
{ … }
static int acm_submit_read_urb(struct acm *acm, int index, gfp_t mem_flags)
{ … }
static int acm_submit_read_urbs(struct acm *acm, gfp_t mem_flags)
{ … }
static void acm_process_read_urb(struct acm *acm, struct urb *urb)
{ … }
static void acm_read_bulk_callback(struct urb *urb)
{ … }
static void acm_write_bulk(struct urb *urb)
{ … }
static void acm_softint(struct work_struct *work)
{ … }
static int acm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
{ … }
static int acm_tty_open(struct tty_struct *tty, struct file *filp)
{ … }
static void acm_port_dtr_rts(struct tty_port *port, bool active)
{ … }
static int acm_port_activate(struct tty_port *port, struct tty_struct *tty)
{ … }
static void acm_port_destruct(struct tty_port *port)
{ … }
static void acm_port_shutdown(struct tty_port *port)
{ … }
static void acm_tty_cleanup(struct tty_struct *tty)
{ … }
static void acm_tty_hangup(struct tty_struct *tty)
{ … }
static void acm_tty_close(struct tty_struct *tty, struct file *filp)
{ … }
static ssize_t acm_tty_write(struct tty_struct *tty, const u8 *buf,
size_t count)
{ … }
static unsigned int acm_tty_write_room(struct tty_struct *tty)
{ … }
static void acm_tty_flush_buffer(struct tty_struct *tty)
{ … }
static unsigned int acm_tty_chars_in_buffer(struct tty_struct *tty)
{ … }
static void acm_tty_throttle(struct tty_struct *tty)
{ … }
static void acm_tty_unthrottle(struct tty_struct *tty)
{ … }
static int acm_tty_break_ctl(struct tty_struct *tty, int state)
{ … }
static int acm_tty_tiocmget(struct tty_struct *tty)
{ … }
static int acm_tty_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static int get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
{ … }
static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
{ … }
static int wait_serial_change(struct acm *acm, unsigned long arg)
{ … }
static int acm_tty_get_icount(struct tty_struct *tty,
struct serial_icounter_struct *icount)
{ … }
static int acm_tty_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{ … }
static void acm_tty_set_termios(struct tty_struct *tty,
const struct ktermios *termios_old)
{ … }
static const struct tty_port_operations acm_port_ops = …;
static void acm_write_buffers_free(struct acm *acm)
{ … }
static void acm_read_buffers_free(struct acm *acm)
{ … }
static int acm_write_buffers_alloc(struct acm *acm)
{ … }
static int acm_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static void acm_disconnect(struct usb_interface *intf)
{ … }
#ifdef CONFIG_PM
static int acm_suspend(struct usb_interface *intf, pm_message_t message)
{ … }
static int acm_resume(struct usb_interface *intf)
{ … }
static int acm_reset_resume(struct usb_interface *intf)
{ … }
#endif
static int acm_pre_reset(struct usb_interface *intf)
{ … }
#define NOKIA_PCSUITE_ACM_INFO(x) …
#define SAMSUNG_PCSUITE_ACM_INFO(x) …
static const struct usb_device_id acm_ids[] = …;
MODULE_DEVICE_TABLE(usb, acm_ids);
static struct usb_driver acm_driver = …;
static const struct tty_operations acm_ops = …;
static int __init acm_init(void)
{ … }
static void __exit acm_exit(void)
{ … }
module_init(…) …;
module_exit(acm_exit);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_ALIAS_CHARDEV_MAJOR(…);