#include <linux/kernel.h>
#include <linux/errno.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/spinlock.h>
#include <linux/serial.h>
#include <linux/serial_reg.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/uaccess.h>
#include <linux/parport.h>
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define MOS_WDR_TIMEOUT …
#define MOS_MAX_PORT …
#define MOS_WRITE …
#define MOS_READ …
#define SERIAL_IIR_RLS …
#define SERIAL_IIR_RDA …
#define SERIAL_IIR_CTI …
#define SERIAL_IIR_THR …
#define SERIAL_IIR_MS …
#define NUM_URBS …
#define URB_TRANSFER_BUFFER_SIZE …
struct moschip_port { … };
#define USB_VENDOR_ID_MOSCHIP …
#define MOSCHIP_DEVICE_ID_7720 …
#define MOSCHIP_DEVICE_ID_7715 …
static const struct usb_device_id id_table[] = …;
MODULE_DEVICE_TABLE(usb, id_table);
#ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT
#define DCR_INIT_VAL …
#define ECR_INIT_VAL …
enum mos7715_pp_modes { … };
struct mos7715_parport { … };
static DEFINE_SPINLOCK(release_lock);
#endif
static const unsigned int dummy;
enum mos_regs { … };
static inline __u16 get_reg_index(enum mos_regs reg)
{ … }
static inline __u16 get_reg_value(enum mos_regs reg,
unsigned int serial_portnum)
{ … }
static int write_mos_reg(struct usb_serial *serial, unsigned int serial_portnum,
enum mos_regs reg, __u8 data)
{ … }
static int read_mos_reg(struct usb_serial *serial, unsigned int serial_portnum,
enum mos_regs reg, __u8 *data)
{ … }
#ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT
static inline int mos7715_change_mode(struct mos7715_parport *mos_parport,
enum mos7715_pp_modes mode)
{ … }
static void destroy_mos_parport(struct kref *kref)
{ … }
static int parport_prologue(struct parport *pp)
{ … }
static inline void parport_epilogue(struct parport *pp)
{ … }
static void deferred_restore_writes(struct work_struct *work)
{ … }
static void parport_mos7715_write_data(struct parport *pp, unsigned char d)
{ … }
static unsigned char parport_mos7715_read_data(struct parport *pp)
{ … }
static void parport_mos7715_write_control(struct parport *pp, unsigned char d)
{ … }
static unsigned char parport_mos7715_read_control(struct parport *pp)
{ … }
static unsigned char parport_mos7715_frob_control(struct parport *pp,
unsigned char mask,
unsigned char val)
{ … }
static unsigned char parport_mos7715_read_status(struct parport *pp)
{ … }
static void parport_mos7715_enable_irq(struct parport *pp)
{ … }
static void parport_mos7715_disable_irq(struct parport *pp)
{ … }
static void parport_mos7715_data_forward(struct parport *pp)
{ … }
static void parport_mos7715_data_reverse(struct parport *pp)
{ … }
static void parport_mos7715_init_state(struct pardevice *dev,
struct parport_state *s)
{ … }
static void parport_mos7715_save_state(struct parport *pp,
struct parport_state *s)
{ … }
static void parport_mos7715_restore_state(struct parport *pp,
struct parport_state *s)
{ … }
static size_t parport_mos7715_write_compat(struct parport *pp,
const void *buffer,
size_t len, int flags)
{ … }
static struct parport_operations parport_mos7715_ops = …;
static int mos7715_parport_init(struct usb_serial *serial)
{ … }
#endif
static void mos7720_interrupt_callback(struct urb *urb)
{ … }
static void mos7715_interrupt_callback(struct urb *urb)
{ … }
static void mos7720_bulk_in_callback(struct urb *urb)
{ … }
static void mos7720_bulk_out_data_callback(struct urb *urb)
{ … }
static int mos77xx_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static unsigned int mos7720_chars_in_buffer(struct tty_struct *tty)
{ … }
static void mos7720_close(struct usb_serial_port *port)
{ … }
static int mos7720_break(struct tty_struct *tty, int break_state)
{ … }
static unsigned int mos7720_write_room(struct tty_struct *tty)
{ … }
static int mos7720_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *data, int count)
{ … }
static void mos7720_throttle(struct tty_struct *tty)
{ … }
static void mos7720_unthrottle(struct tty_struct *tty)
{ … }
static int set_higher_rates(struct moschip_port *mos7720_port,
unsigned int baud)
{ … }
struct divisor_table_entry { … };
static const struct divisor_table_entry divisor_table[] = …;
static int calc_baud_rate_divisor(struct usb_serial_port *port, int baudrate, int *divisor)
{ … }
static int send_cmd_write_baud_rate(struct moschip_port *mos7720_port,
int baudrate)
{ … }
static void change_port_settings(struct tty_struct *tty,
struct moschip_port *mos7720_port,
const struct ktermios *old_termios)
{ … }
static void mos7720_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static int get_lsr_info(struct tty_struct *tty,
struct moschip_port *mos7720_port, unsigned int __user *value)
{ … }
static int mos7720_tiocmget(struct tty_struct *tty)
{ … }
static int mos7720_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static int mos7720_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{ … }
static int mos7720_startup(struct usb_serial *serial)
{ … }
static void mos7720_release(struct usb_serial *serial)
{ … }
static int mos7720_port_probe(struct usb_serial_port *port)
{ … }
static void mos7720_port_remove(struct usb_serial_port *port)
{ … }
static struct usb_serial_driver moschip7720_2port_driver = …;
static struct usb_serial_driver * const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;