#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/moduleparam.h>
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/serial.h>
#include <linux/kfifo.h>
#include <linux/delay.h>
#include <linux/uaccess.h>
#include <asm/unaligned.h>
#include "cypress_m8.h"
static bool stats;
static int interval;
static bool unstable_bauds;
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define CYPRESS_BUF_SIZE …
static const struct usb_device_id id_table_earthmate[] = …;
static const struct usb_device_id id_table_cyphidcomrs232[] = …;
static const struct usb_device_id id_table_nokiaca42v2[] = …;
static const struct usb_device_id id_table_combined[] = …;
MODULE_DEVICE_TABLE(usb, id_table_combined);
enum packet_format { … };
struct cypress_private { … };
static int cypress_earthmate_port_probe(struct usb_serial_port *port);
static int cypress_hidcom_port_probe(struct usb_serial_port *port);
static int cypress_ca42v2_port_probe(struct usb_serial_port *port);
static void cypress_port_remove(struct usb_serial_port *port);
static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port);
static void cypress_close(struct usb_serial_port *port);
static void cypress_dtr_rts(struct usb_serial_port *port, int on);
static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count);
static void cypress_send(struct usb_serial_port *port);
static unsigned int cypress_write_room(struct tty_struct *tty);
static void cypress_earthmate_init_termios(struct tty_struct *tty);
static void cypress_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios);
static int cypress_tiocmget(struct tty_struct *tty);
static int cypress_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear);
static unsigned int cypress_chars_in_buffer(struct tty_struct *tty);
static void cypress_throttle(struct tty_struct *tty);
static void cypress_unthrottle(struct tty_struct *tty);
static void cypress_set_dead(struct usb_serial_port *port);
static void cypress_read_int_callback(struct urb *urb);
static void cypress_write_int_callback(struct urb *urb);
static struct usb_serial_driver cypress_earthmate_device = …;
static struct usb_serial_driver cypress_hidcom_device = …;
static struct usb_serial_driver cypress_ca42v2_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
static inline bool is_frwd(struct usb_device *dev)
{ … }
static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate)
{ … }
static int cypress_serial_control(struct tty_struct *tty,
struct usb_serial_port *port, speed_t baud_rate, int data_bits,
int stop_bits, int parity_enable, int parity_type, int reset,
int cypress_request_type)
{ … }
static void cypress_set_dead(struct usb_serial_port *port)
{ … }
static int cypress_generic_port_probe(struct usb_serial_port *port)
{ … }
static int cypress_earthmate_port_probe(struct usb_serial_port *port)
{ … }
static int cypress_hidcom_port_probe(struct usb_serial_port *port)
{ … }
static int cypress_ca42v2_port_probe(struct usb_serial_port *port)
{ … }
static void cypress_port_remove(struct usb_serial_port *port)
{ … }
static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void cypress_dtr_rts(struct usb_serial_port *port, int on)
{ … }
static void cypress_close(struct usb_serial_port *port)
{ … }
static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count)
{ … }
static void cypress_send(struct usb_serial_port *port)
{ … }
static unsigned int cypress_write_room(struct tty_struct *tty)
{ … }
static int cypress_tiocmget(struct tty_struct *tty)
{ … }
static int cypress_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static void cypress_earthmate_init_termios(struct tty_struct *tty)
{ … }
static void cypress_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static unsigned int cypress_chars_in_buffer(struct tty_struct *tty)
{ … }
static void cypress_throttle(struct tty_struct *tty)
{ … }
static void cypress_unthrottle(struct tty_struct *tty)
{ … }
static void cypress_read_int_callback(struct urb *urb)
{ … }
static void cypress_write_int_callback(struct urb *urb)
{ … }
module_usb_serial_driver(…);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
module_param(stats, bool, 0644);
MODULE_PARM_DESC(…) …;
module_param(interval, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(unstable_bauds, bool, 0644);
MODULE_PARM_DESC(…) …;