#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/jiffies.h>
#include <linux/serial.h>
#include <linux/serial_reg.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <asm/unaligned.h>
#define MX_USBSERIAL_VID …
#define MX_UPORT1250_PID …
#define MX_UPORT1251_PID …
#define MX_UPORT1410_PID …
#define MX_UPORT1450_PID …
#define MX_UPORT1451_PID …
#define MX_UPORT1618_PID …
#define MX_UPORT1658_PID …
#define MX_UPORT1613_PID …
#define MX_UPORT1653_PID …
#define HEADER_SIZE …
#define EVENT_LENGTH …
#define DOWN_BLOCK_SIZE …
#define VER_ADDR_1 …
#define VER_ADDR_2 …
#define VER_ADDR_3 …
#define RQ_VENDOR_NONE …
#define RQ_VENDOR_SET_BAUD …
#define RQ_VENDOR_SET_LINE …
#define RQ_VENDOR_SET_CHARS …
#define RQ_VENDOR_SET_RTS …
#define RQ_VENDOR_SET_DTR …
#define RQ_VENDOR_SET_XONXOFF …
#define RQ_VENDOR_SET_RX_HOST_EN …
#define RQ_VENDOR_SET_OPEN …
#define RQ_VENDOR_PURGE …
#define RQ_VENDOR_SET_MCR …
#define RQ_VENDOR_SET_BREAK …
#define RQ_VENDOR_START_FW_DOWN …
#define RQ_VENDOR_STOP_FW_DOWN …
#define RQ_VENDOR_QUERY_FW_READY …
#define RQ_VENDOR_SET_FIFO_DISABLE …
#define RQ_VENDOR_SET_INTERFACE …
#define RQ_VENDOR_SET_HIGH_PERFOR …
#define RQ_VENDOR_ERASE_BLOCK …
#define RQ_VENDOR_WRITE_PAGE …
#define RQ_VENDOR_PREPARE_WRITE …
#define RQ_VENDOR_CONFIRM_WRITE …
#define RQ_VENDOR_LOCATE …
#define RQ_VENDOR_START_ROM_DOWN …
#define RQ_VENDOR_ROM_DATA …
#define RQ_VENDOR_STOP_ROM_DOWN …
#define RQ_VENDOR_FW_DATA …
#define RQ_VENDOR_RESET_DEVICE …
#define RQ_VENDOR_QUERY_FW_CONFIG …
#define RQ_VENDOR_GET_VERSION …
#define RQ_VENDOR_GET_PAGE …
#define RQ_VENDOR_GET_ROM_PROC …
#define RQ_VENDOR_GET_INQUEUE …
#define RQ_VENDOR_GET_OUTQUEUE …
#define RQ_VENDOR_GET_MSR …
#define UPORT_EVENT_NONE …
#define UPORT_EVENT_TXBUF_THRESHOLD …
#define UPORT_EVENT_SEND_NEXT …
#define UPORT_EVENT_MSR …
#define UPORT_EVENT_LSR …
#define UPORT_EVENT_MCR …
#define SERIAL_EV_CTS …
#define SERIAL_EV_DSR …
#define SERIAL_EV_RLSD …
#define SERIAL_EV_XOFF …
#define MX_WORDLENGTH_5 …
#define MX_WORDLENGTH_6 …
#define MX_WORDLENGTH_7 …
#define MX_WORDLENGTH_8 …
#define MX_PARITY_NONE …
#define MX_PARITY_ODD …
#define MX_PARITY_EVEN …
#define MX_PARITY_MARK …
#define MX_PARITY_SPACE …
#define MX_STOP_BITS_1 …
#define MX_STOP_BITS_1_5 …
#define MX_STOP_BITS_2 …
#define MX_RTS_DISABLE …
#define MX_RTS_ENABLE …
#define MX_RTS_HW …
#define MX_RTS_NO_CHANGE …
#define MX_INT_RS232 …
#define MX_INT_2W_RS485 …
#define MX_INT_RS422 …
#define MX_INT_4W_RS485 …
#define MX_WAIT_FOR_CTS …
#define MX_WAIT_FOR_DSR …
#define MX_WAIT_FOR_DCD …
#define MX_WAIT_FOR_XON …
#define MX_WAIT_FOR_START_TX …
#define MX_WAIT_FOR_UNTHROTTLE …
#define MX_WAIT_FOR_LOW_WATER …
#define MX_WAIT_FOR_SEND_NEXT …
#define MX_UPORT_2_PORT …
#define MX_UPORT_4_PORT …
#define MX_UPORT_8_PORT …
#define MX_UPORT_16_PORT …
struct mxuport_port { … };
static const struct usb_device_id mxuport_idtable[] = …;
MODULE_DEVICE_TABLE(usb, mxuport_idtable);
static int mxuport_prepare_write_buffer(struct usb_serial_port *port,
void *dest, size_t size)
{ … }
static int mxuport_recv_ctrl_urb(struct usb_serial *serial,
u8 request, u16 value, u16 index,
u8 *data, size_t size)
{ … }
static int mxuport_send_ctrl_data_urb(struct usb_serial *serial,
u8 request,
u16 value, u16 index,
u8 *data, size_t size)
{ … }
static int mxuport_send_ctrl_urb(struct usb_serial *serial,
u8 request, u16 value, u16 index)
{ … }
static void mxuport_throttle(struct tty_struct *tty)
{ … }
static void mxuport_unthrottle(struct tty_struct *tty)
{ … }
static void mxuport_process_read_urb_data(struct usb_serial_port *port,
char *data, int size)
{ … }
static void mxuport_msr_event(struct usb_serial_port *port, u8 buf[4])
{ … }
static void mxuport_lsr_event(struct usb_serial_port *port, u8 buf[4])
{ … }
static void mxuport_process_read_urb_event(struct usb_serial_port *port,
u8 buf[4], u32 event)
{ … }
static void mxuport_process_read_urb_demux_data(struct urb *urb)
{ … }
static void mxuport_process_read_urb_demux_event(struct urb *urb)
{ … }
static void mxuport_process_read_urb(struct urb *urb)
{ … }
static bool mxuport_tx_empty(struct usb_serial_port *port)
{ … }
static int mxuport_set_mcr(struct usb_serial_port *port, u8 mcr_state)
{ … }
static int mxuport_set_dtr(struct usb_serial_port *port, int on)
{ … }
static int mxuport_set_rts(struct usb_serial_port *port, u8 state)
{ … }
static void mxuport_dtr_rts(struct usb_serial_port *port, int on)
{ … }
static int mxuport_tiocmset(struct tty_struct *tty, unsigned int set,
unsigned int clear)
{ … }
static int mxuport_tiocmget(struct tty_struct *tty)
{ … }
static int mxuport_set_termios_flow(struct tty_struct *tty,
const struct ktermios *old_termios,
struct usb_serial_port *port,
struct usb_serial *serial)
{ … }
static void mxuport_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static int mxuport_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static int mxuport_get_fw_version(struct usb_serial *serial, u32 *version)
{ … }
static int mxuport_download_fw(struct usb_serial *serial,
const struct firmware *fw_p)
{ … }
static int mxuport_probe(struct usb_serial *serial,
const struct usb_device_id *id)
{ … }
static int mxuport_port_probe(struct usb_serial_port *port)
{ … }
static int mxuport_attach(struct usb_serial *serial)
{ … }
static void mxuport_release(struct usb_serial *serial)
{ … }
static int mxuport_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void mxuport_close(struct usb_serial_port *port)
{ … }
static int mxuport_break_ctl(struct tty_struct *tty, int break_state)
{ … }
static int mxuport_resume(struct usb_serial *serial)
{ … }
static struct usb_serial_driver mxuport_device = …;
static struct usb_serial_driver *const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;