#include <linux/kernel.h>
#include <linux/jiffies.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/serial.h>
#include <linux/swab.h>
#include <linux/kfifo.h>
#include <linux/ioctl.h>
#include <linux/firmware.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include "io_16654.h"
#include "io_usbvend.h"
#include "io_ti.h"
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define EPROM_PAGE_SIZE …
#define HARDWARE_TYPE_930 …
#define HARDWARE_TYPE_TIUMP …
#define TI_MODE_CONFIGURING …
#define TI_MODE_BOOT …
#define TI_MODE_DOWNLOAD …
#define TI_MODE_TRANSITIONING …
#define EDGE_READ_URB_RUNNING …
#define EDGE_READ_URB_STOPPING …
#define EDGE_READ_URB_STOPPED …
struct product_info { … } __packed;
struct edgeport_fw_hdr { … } __packed;
struct edgeport_port { … };
struct edgeport_serial { … };
static const struct usb_device_id edgeport_1port_id_table[] = …;
static const struct usb_device_id edgeport_2port_id_table[] = …;
static const struct usb_device_id id_table_combined[] = …;
MODULE_DEVICE_TABLE(usb, id_table_combined);
static bool ignore_cpu_rev;
static int default_uart_mode;
static void edge_tty_recv(struct usb_serial_port *port, unsigned char *data,
int length);
static void stop_read(struct edgeport_port *edge_port);
static int restart_read(struct edgeport_port *edge_port);
static void edge_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios);
static void edge_send(struct usb_serial_port *port, struct tty_struct *tty);
static int do_download_mode(struct edgeport_serial *serial,
const struct firmware *fw);
static int do_boot_mode(struct edgeport_serial *serial,
const struct firmware *fw);
static int edge_create_sysfs_attrs(struct usb_serial_port *port);
static int edge_remove_sysfs_attrs(struct usb_serial_port *port);
#define FW_HEARTBEAT_VERSION_CUTOFF …
#define FW_HEARTBEAT_SECS …
#define TI_VSEND_TIMEOUT_DEFAULT …
#define TI_VSEND_TIMEOUT_FW_DOWNLOAD …
static int ti_vread_sync(struct usb_device *dev, u8 request, u16 value,
u16 index, void *data, int size)
{ … }
static int ti_vsend_sync(struct usb_device *dev, u8 request, u16 value,
u16 index, void *data, int size, int timeout)
{ … }
static int read_port_cmd(struct usb_serial_port *port, u8 command, u16 value,
void *data, int size)
{ … }
static int send_port_cmd(struct usb_serial_port *port, u8 command, u16 value,
void *data, int size)
{ … }
static int purge_port(struct usb_serial_port *port, u16 mask)
{ … }
static int read_download_mem(struct usb_device *dev, int start_address,
int length, u8 address_type, u8 *buffer)
{ … }
static int read_ram(struct usb_device *dev, int start_address,
int length, u8 *buffer)
{ … }
static int read_boot_mem(struct edgeport_serial *serial,
int start_address, int length, u8 *buffer)
{ … }
static int write_boot_mem(struct edgeport_serial *serial,
int start_address, int length, u8 *buffer)
{ … }
static int write_i2c_mem(struct edgeport_serial *serial,
int start_address, int length, u8 address_type, u8 *buffer)
{ … }
static int tx_active(struct edgeport_port *port)
{ … }
static int choose_config(struct usb_device *dev)
{ … }
static int read_rom(struct edgeport_serial *serial,
int start_address, int length, u8 *buffer)
{ … }
static int write_rom(struct edgeport_serial *serial, int start_address,
int length, u8 *buffer)
{ … }
static int get_descriptor_addr(struct edgeport_serial *serial,
int desc_type, struct ti_i2c_desc *rom_desc)
{ … }
static int valid_csum(struct ti_i2c_desc *rom_desc, u8 *buffer)
{ … }
static int check_i2c_image(struct edgeport_serial *serial)
{ … }
static int get_manuf_info(struct edgeport_serial *serial, u8 *buffer)
{ … }
static int build_i2c_fw_hdr(u8 *header, const struct firmware *fw)
{ … }
static int i2c_type_bootmode(struct edgeport_serial *serial)
{ … }
static int bulk_xfer(struct usb_serial *serial, void *buffer,
int length, int *num_sent)
{ … }
static int download_code(struct edgeport_serial *serial, u8 *image,
int image_length)
{ … }
static int config_boot_dev(struct usb_device *dev)
{ … }
static int ti_cpu_rev(struct edge_ti_manuf_descriptor *desc)
{ … }
static int check_fw_sanity(struct edgeport_serial *serial,
const struct firmware *fw)
{ … }
static int download_fw(struct edgeport_serial *serial)
{ … }
static int do_download_mode(struct edgeport_serial *serial,
const struct firmware *fw)
{ … }
static int do_boot_mode(struct edgeport_serial *serial,
const struct firmware *fw)
{ … }
static int ti_do_config(struct edgeport_port *port, int feature, int on)
{ … }
static int restore_mcr(struct edgeport_port *port, u8 mcr)
{ … }
static u8 map_line_status(u8 ti_lsr)
{ … }
static void handle_new_msr(struct edgeport_port *edge_port, u8 msr)
{ … }
static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data,
u8 lsr, u8 data)
{ … }
static void edge_interrupt_callback(struct urb *urb)
{ … }
static void edge_bulk_in_callback(struct urb *urb)
{ … }
static void edge_tty_recv(struct usb_serial_port *port, unsigned char *data,
int length)
{ … }
static void edge_bulk_out_callback(struct urb *urb)
{ … }
static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void edge_close(struct usb_serial_port *port)
{ … }
static int edge_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *data, int count)
{ … }
static void edge_send(struct usb_serial_port *port, struct tty_struct *tty)
{ … }
static unsigned int edge_write_room(struct tty_struct *tty)
{ … }
static unsigned int edge_chars_in_buffer(struct tty_struct *tty)
{ … }
static bool edge_tx_empty(struct usb_serial_port *port)
{ … }
static void edge_throttle(struct tty_struct *tty)
{ … }
static void edge_unthrottle(struct tty_struct *tty)
{ … }
static void stop_read(struct edgeport_port *edge_port)
{ … }
static int restart_read(struct edgeport_port *edge_port)
{ … }
static void change_port_settings(struct tty_struct *tty,
struct edgeport_port *edge_port, const struct ktermios *old_termios)
{ … }
static void edge_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static int edge_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static int edge_tiocmget(struct tty_struct *tty)
{ … }
static int edge_break(struct tty_struct *tty, int break_state)
{ … }
static void edge_heartbeat_schedule(struct edgeport_serial *edge_serial)
{ … }
static void edge_heartbeat_work(struct work_struct *work)
{ … }
static int edge_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static int edge_startup(struct usb_serial *serial)
{ … }
static void edge_disconnect(struct usb_serial *serial)
{ … }
static void edge_release(struct usb_serial *serial)
{ … }
static int edge_port_probe(struct usb_serial_port *port)
{ … }
static void edge_port_remove(struct usb_serial_port *port)
{ … }
static ssize_t uart_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t uart_mode_store(struct device *dev,
struct device_attribute *attr, const char *valbuf, size_t count)
{ … }
static DEVICE_ATTR_RW(uart_mode);
static int edge_create_sysfs_attrs(struct usb_serial_port *port)
{ … }
static int edge_remove_sysfs_attrs(struct usb_serial_port *port)
{ … }
#ifdef CONFIG_PM
static int edge_suspend(struct usb_serial *serial, pm_message_t message)
{ … }
static int edge_resume(struct usb_serial *serial)
{ … }
#endif
static struct usb_serial_driver edgeport_1port_device = …;
static struct usb_serial_driver edgeport_2port_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…) …;
module_param(ignore_cpu_rev, bool, 0644);
MODULE_PARM_DESC(…) …;
module_param(default_uart_mode, int, 0644);
MODULE_PARM_DESC(…) …;