#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/serial.h>
#include <asm/unaligned.h>
#define DEFAULT_BAUD_RATE …
#define DEFAULT_TIMEOUT …
#define CH341_BIT_RTS …
#define CH341_BIT_DTR …
#define CH341_MULT_STAT …
#define CH341_BIT_CTS …
#define CH341_BIT_DSR …
#define CH341_BIT_RI …
#define CH341_BIT_DCD …
#define CH341_BITS_MODEM_STAT …
#define CH341_REQ_READ_VERSION …
#define CH341_REQ_WRITE_REG …
#define CH341_REQ_READ_REG …
#define CH341_REQ_SERIAL_INIT …
#define CH341_REQ_MODEM_CTRL …
#define CH341_REG_BREAK …
#define CH341_REG_PRESCALER …
#define CH341_REG_DIVISOR …
#define CH341_REG_LCR …
#define CH341_REG_LCR2 …
#define CH341_NBREAK_BITS …
#define CH341_LCR_ENABLE_RX …
#define CH341_LCR_ENABLE_TX …
#define CH341_LCR_MARK_SPACE …
#define CH341_LCR_PAR_EVEN …
#define CH341_LCR_ENABLE_PAR …
#define CH341_LCR_STOP_BITS_2 …
#define CH341_LCR_CS8 …
#define CH341_LCR_CS7 …
#define CH341_LCR_CS6 …
#define CH341_LCR_CS5 …
#define CH341_QUIRK_LIMITED_PRESCALER …
#define CH341_QUIRK_SIMULATE_BREAK …
static const struct usb_device_id id_table[] = …;
MODULE_DEVICE_TABLE(usb, id_table);
struct ch341_private { … };
static void ch341_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios);
static int ch341_control_out(struct usb_device *dev, u8 request,
u16 value, u16 index)
{ … }
static int ch341_control_in(struct usb_device *dev,
u8 request, u16 value, u16 index,
char *buf, unsigned bufsize)
{ … }
#define CH341_CLKRATE …
#define CH341_CLK_DIV(ps, fact) …
#define CH341_MIN_RATE(ps) …
static const speed_t ch341_min_rates[] = …;
#define CH341_MIN_BPS …
#define CH341_MAX_BPS …
static int ch341_get_divisor(struct ch341_private *priv, speed_t speed)
{ … }
static int ch341_set_baudrate_lcr(struct usb_device *dev,
struct ch341_private *priv,
speed_t baud_rate, u8 lcr)
{ … }
static int ch341_set_handshake(struct usb_device *dev, u8 control)
{ … }
static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv)
{ … }
static int ch341_configure(struct usb_device *dev, struct ch341_private *priv)
{ … }
static int ch341_detect_quirks(struct usb_serial_port *port)
{ … }
static int ch341_port_probe(struct usb_serial_port *port)
{ … }
static void ch341_port_remove(struct usb_serial_port *port)
{ … }
static int ch341_carrier_raised(struct usb_serial_port *port)
{ … }
static void ch341_dtr_rts(struct usb_serial_port *port, int on)
{ … }
static void ch341_close(struct usb_serial_port *port)
{ … }
static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void ch341_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static int ch341_simulate_break(struct tty_struct *tty, int break_state)
{ … }
static int ch341_break_ctl(struct tty_struct *tty, int break_state)
{ … }
static int ch341_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static void ch341_update_status(struct usb_serial_port *port,
unsigned char *data, size_t len)
{ … }
static void ch341_read_int_callback(struct urb *urb)
{ … }
static int ch341_tiocmget(struct tty_struct *tty)
{ … }
static int ch341_reset_resume(struct usb_serial *serial)
{ … }
static struct usb_serial_driver ch341_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_LICENSE(…) …;