#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/mutex.h>
#include <linux/uaccess.h>
#include <asm/termbits.h>
#include <linux/usb.h>
#include <linux/serial_reg.h>
#include <linux/serial.h>
#include <linux/usb/serial.h>
#include <linux/usb/ezusb.h>
#include "whiteheat.h"
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define CONNECT_TECH_VENDOR_ID …
#define CONNECT_TECH_FAKE_WHITE_HEAT_ID …
#define CONNECT_TECH_WHITE_HEAT_ID …
static const struct usb_device_id id_table_std[] = …;
static const struct usb_device_id id_table_prerenumeration[] = …;
static const struct usb_device_id id_table_combined[] = …;
MODULE_DEVICE_TABLE(usb, id_table_combined);
static int whiteheat_firmware_download(struct usb_serial *serial,
const struct usb_device_id *id);
static int whiteheat_firmware_attach(struct usb_serial *serial);
static int whiteheat_attach(struct usb_serial *serial);
static void whiteheat_release(struct usb_serial *serial);
static int whiteheat_port_probe(struct usb_serial_port *port);
static void whiteheat_port_remove(struct usb_serial_port *port);
static int whiteheat_open(struct tty_struct *tty,
struct usb_serial_port *port);
static void whiteheat_close(struct usb_serial_port *port);
static void whiteheat_get_serial(struct tty_struct *tty,
struct serial_struct *ss);
static void whiteheat_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios);
static int whiteheat_tiocmget(struct tty_struct *tty);
static int whiteheat_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear);
static int whiteheat_break_ctl(struct tty_struct *tty, int break_state);
static struct usb_serial_driver whiteheat_fake_device = …;
static struct usb_serial_driver whiteheat_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
struct whiteheat_command_private { … };
struct whiteheat_private { … };
static int start_command_port(struct usb_serial *serial);
static void stop_command_port(struct usb_serial *serial);
static void command_port_write_callback(struct urb *urb);
static void command_port_read_callback(struct urb *urb);
static int firm_send_command(struct usb_serial_port *port, __u8 command,
__u8 *data, __u8 datasize);
static int firm_open(struct usb_serial_port *port);
static int firm_close(struct usb_serial_port *port);
static void firm_setup_port(struct tty_struct *tty);
static int firm_set_rts(struct usb_serial_port *port, __u8 onoff);
static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff);
static int firm_set_break(struct usb_serial_port *port, __u8 onoff);
static int firm_purge(struct usb_serial_port *port, __u8 rxtx);
static int firm_get_dtr_rts(struct usb_serial_port *port);
static int firm_report_tx_done(struct usb_serial_port *port);
#define COMMAND_PORT …
#define COMMAND_TIMEOUT …
#define COMMAND_TIMEOUT_MS …
static int whiteheat_firmware_download(struct usb_serial *serial,
const struct usb_device_id *id)
{ … }
static int whiteheat_firmware_attach(struct usb_serial *serial)
{ … }
static int whiteheat_attach(struct usb_serial *serial)
{ … }
static void whiteheat_release(struct usb_serial *serial)
{ … }
static int whiteheat_port_probe(struct usb_serial_port *port)
{ … }
static void whiteheat_port_remove(struct usb_serial_port *port)
{ … }
static int whiteheat_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void whiteheat_close(struct usb_serial_port *port)
{ … }
static int whiteheat_tiocmget(struct tty_struct *tty)
{ … }
static int whiteheat_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static void whiteheat_get_serial(struct tty_struct *tty, struct serial_struct *ss)
{ … }
static void whiteheat_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static int whiteheat_break_ctl(struct tty_struct *tty, int break_state)
{ … }
static void command_port_write_callback(struct urb *urb)
{ … }
static void command_port_read_callback(struct urb *urb)
{ … }
static int firm_send_command(struct usb_serial_port *port, __u8 command,
__u8 *data, __u8 datasize)
{ … }
static int firm_open(struct usb_serial_port *port)
{ … }
static int firm_close(struct usb_serial_port *port)
{ … }
static void firm_setup_port(struct tty_struct *tty)
{ … }
static int firm_set_rts(struct usb_serial_port *port, __u8 onoff)
{ … }
static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff)
{ … }
static int firm_set_break(struct usb_serial_port *port, __u8 onoff)
{ … }
static int firm_purge(struct usb_serial_port *port, __u8 rxtx)
{ … }
static int firm_get_dtr_rts(struct usb_serial_port *port)
{ … }
static int firm_report_tx_done(struct usb_serial_port *port)
{ … }
static int start_command_port(struct usb_serial *serial)
{ … }
static void stop_command_port(struct usb_serial *serial)
{ … }
module_usb_serial_driver(…);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…) …;
MODULE_FIRMWARE(…) …;