#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/serial.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <asm/unaligned.h>
#include "pl2303.h"
#define PL2303_QUIRK_UART_STATE_IDX0 …
#define PL2303_QUIRK_LEGACY …
#define PL2303_QUIRK_ENDPOINT_HACK …
static const struct usb_device_id id_table[] = …;
MODULE_DEVICE_TABLE(usb, id_table);
#define SET_LINE_REQUEST_TYPE …
#define SET_LINE_REQUEST …
#define SET_CONTROL_REQUEST_TYPE …
#define SET_CONTROL_REQUEST …
#define CONTROL_DTR …
#define CONTROL_RTS …
#define BREAK_REQUEST_TYPE …
#define BREAK_REQUEST …
#define BREAK_ON …
#define BREAK_OFF …
#define GET_LINE_REQUEST_TYPE …
#define GET_LINE_REQUEST …
#define VENDOR_WRITE_REQUEST_TYPE …
#define VENDOR_WRITE_REQUEST …
#define VENDOR_WRITE_NREQUEST …
#define VENDOR_READ_REQUEST_TYPE …
#define VENDOR_READ_REQUEST …
#define VENDOR_READ_NREQUEST …
#define UART_STATE_INDEX …
#define UART_STATE_MSR_MASK …
#define UART_STATE_TRANSIENT_MASK …
#define UART_DCD …
#define UART_DSR …
#define UART_BREAK_ERROR …
#define UART_RING …
#define UART_FRAME_ERROR …
#define UART_PARITY_ERROR …
#define UART_OVERRUN_ERROR …
#define UART_CTS …
#define PL2303_FLOWCTRL_MASK …
#define PL2303_READ_TYPE_HX_STATUS …
#define PL2303_HXN_RESET_REG …
#define PL2303_HXN_RESET_UPSTREAM_PIPE …
#define PL2303_HXN_RESET_DOWNSTREAM_PIPE …
#define PL2303_HXN_FLOWCTRL_REG …
#define PL2303_HXN_FLOWCTRL_MASK …
#define PL2303_HXN_FLOWCTRL_NONE …
#define PL2303_HXN_FLOWCTRL_RTS_CTS …
#define PL2303_HXN_FLOWCTRL_XON_XOFF …
static int pl2303_set_break(struct usb_serial_port *port, bool enable);
enum pl2303_type { … };
struct pl2303_type_data { … };
struct pl2303_serial_private { … };
struct pl2303_private { … };
static const struct pl2303_type_data pl2303_type_data[TYPE_COUNT] = …;
static int pl2303_vendor_read(struct usb_serial *serial, u16 value,
unsigned char buf[1])
{ … }
static int pl2303_vendor_write(struct usb_serial *serial, u16 value, u16 index)
{ … }
static int pl2303_update_reg(struct usb_serial *serial, u8 reg, u8 mask, u8 val)
{ … }
static int pl2303_probe(struct usb_serial *serial,
const struct usb_device_id *id)
{ … }
static int pl2303_endpoint_hack(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static int pl2303_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static bool pl2303_supports_hx_status(struct usb_serial *serial)
{ … }
static int pl2303_detect_type(struct usb_serial *serial)
{ … }
static int pl2303_startup(struct usb_serial *serial)
{ … }
static void pl2303_release(struct usb_serial *serial)
{ … }
static int pl2303_port_probe(struct usb_serial_port *port)
{ … }
static void pl2303_port_remove(struct usb_serial_port *port)
{ … }
static int pl2303_set_control_lines(struct usb_serial_port *port, u8 value)
{ … }
static speed_t pl2303_get_supported_baud_rate(speed_t baud)
{ … }
static speed_t pl2303_encode_baud_rate_direct(unsigned char buf[4],
speed_t baud)
{ … }
static speed_t pl2303_encode_baud_rate_divisor(unsigned char buf[4],
speed_t baud)
{ … }
static speed_t pl2303_encode_baud_rate_divisor_alt(unsigned char buf[4],
speed_t baud)
{ … }
static void pl2303_encode_baud_rate(struct tty_struct *tty,
struct usb_serial_port *port,
u8 buf[4])
{ … }
static int pl2303_get_line_request(struct usb_serial_port *port,
unsigned char buf[7])
{ … }
static int pl2303_set_line_request(struct usb_serial_port *port,
unsigned char buf[7])
{ … }
static bool pl2303_termios_change(const struct ktermios *a, const struct ktermios *b)
{ … }
static bool pl2303_enable_xonxoff(struct tty_struct *tty, const struct pl2303_type_data *type)
{ … }
static void pl2303_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static void pl2303_dtr_rts(struct usb_serial_port *port, int on)
{ … }
static void pl2303_close(struct usb_serial_port *port)
{ … }
static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static int pl2303_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static int pl2303_tiocmget(struct tty_struct *tty)
{ … }
static int pl2303_carrier_raised(struct usb_serial_port *port)
{ … }
static int pl2303_set_break(struct usb_serial_port *port, bool enable)
{ … }
static int pl2303_break_ctl(struct tty_struct *tty, int state)
{ … }
static void pl2303_update_line_status(struct usb_serial_port *port,
unsigned char *data,
unsigned int actual_length)
{ … }
static void pl2303_read_int_callback(struct urb *urb)
{ … }
static void pl2303_process_read_urb(struct urb *urb)
{ … }
static struct usb_serial_driver pl2303_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;