linux/drivers/usb/serial/kl5kusb105.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * KLSI KL5KUSB105 chip RS232 converter driver
 *
 *   Copyright (C) 2010 Johan Hovold <[email protected]>
 *   Copyright (C) 2001 Utz-Uwe Haus <[email protected]>
 *
 * All information about the device was acquired using SniffUSB ans snoopUSB
 * on Windows98.
 * It was written out of frustration with the PalmConnect USB Serial adapter
 * sold by Palm Inc.
 * Neither Palm, nor their contractor (MCCI) or their supplier (KLSI) provided
 * information that was not already available.
 *
 * It seems that KLSI bought some silicon-design information from ScanLogic,
 * whose SL11R processor is at the core of the KL5KUSB chipset from KLSI.
 * KLSI has firmware available for their devices; it is probable that the
 * firmware differs from that used by KLSI in their products. If you have an
 * original KLSI device and can provide some information on it, I would be
 * most interested in adding support for it here. If you have any information
 * on the protocol used (or find errors in my reverse-engineered stuff), please
 * let me know.
 *
 * The code was only tested with a PalmConnect USB adapter; if you
 * are adventurous, try it with any KLSI-based device and let me know how it
 * breaks so that I can fix it!
 */

/* TODO:
 *	check modem line signals
 *	implement handshaking or decide that we do not support it
 */

#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/uaccess.h>
#include <asm/unaligned.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include "kl5kusb105.h"

#define DRIVER_AUTHOR
#define DRIVER_DESC


/*
 * Function prototypes
 */
static int klsi_105_port_probe(struct usb_serial_port *port);
static void klsi_105_port_remove(struct usb_serial_port *port);
static int  klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port);
static void klsi_105_close(struct usb_serial_port *port);
static void klsi_105_set_termios(struct tty_struct *tty,
				 struct usb_serial_port *port,
				 const struct ktermios *old_termios);
static int  klsi_105_tiocmget(struct tty_struct *tty);
static void klsi_105_process_read_urb(struct urb *urb);
static int klsi_105_prepare_write_buffer(struct usb_serial_port *port,
						void *dest, size_t size);

/*
 * All of the device info needed for the KLSI converters.
 */
static const struct usb_device_id id_table[] =;

MODULE_DEVICE_TABLE(usb, id_table);

static struct usb_serial_driver kl5kusb105d_device =;

static struct usb_serial_driver * const serial_drivers[] =;

struct klsi_105_port_settings {};

struct klsi_105_private {};


/*
 * Handle vendor specific USB requests
 */


#define KLSI_TIMEOUT

static int klsi_105_chg_port_settings(struct usb_serial_port *port,
				      struct klsi_105_port_settings *settings)
{}

/*
 * Read line control via vendor command and return result through
 * the state pointer.
 */
static int klsi_105_get_line_state(struct usb_serial_port *port,
				   unsigned long *state)
{}


/*
 * Driver's tty interface functions
 */

static int klsi_105_port_probe(struct usb_serial_port *port)
{}

static void klsi_105_port_remove(struct usb_serial_port *port)
{}

static int  klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
{}

static void klsi_105_close(struct usb_serial_port *port)
{}

/* We need to write a complete 64-byte data block and encode the
 * number actually sent in the first double-byte, LSB-order. That
 * leaves at most 62 bytes of payload.
 */
#define KLSI_HDR_LEN
static int klsi_105_prepare_write_buffer(struct usb_serial_port *port,
						void *dest, size_t size)
{}

/* The data received is preceded by a length double-byte in LSB-first order.
 */
static void klsi_105_process_read_urb(struct urb *urb)
{}

static void klsi_105_set_termios(struct tty_struct *tty,
				 struct usb_serial_port *port,
				 const struct ktermios *old_termios)
{}

static int klsi_105_tiocmget(struct tty_struct *tty)
{}

module_usb_serial_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();