linux/drivers/usb/serial/iuu_phoenix.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Infinity Unlimited USB Phoenix driver
 *
 * Copyright (C) 2010 James Courtier-Dutton ([email protected])

 * Copyright (C) 2007 Alain Degreffe ([email protected])
 *
 * Original code taken from iuutool (Copyright (C) 2006 Juan Carlos Borrás)
 *
 *  And tested with help of WB Electronics
 */
#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 "iuu_phoenix.h"
#include <linux/random.h>

#define DRIVER_DESC

static const struct usb_device_id id_table[] =;
MODULE_DEVICE_TABLE(usb, id_table);

/* turbo parameter */
static int boost =;
static int clockmode =;
static int cdmode =;
static int iuu_cardin;
static int iuu_cardout;
static bool xmas;
static int vcc_default =;

static int iuu_create_sysfs_attrs(struct usb_serial_port *port);
static int iuu_remove_sysfs_attrs(struct usb_serial_port *port);
static void read_rxcmd_callback(struct urb *urb);

struct iuu_private {};

static int iuu_port_probe(struct usb_serial_port *port)
{}

static void iuu_port_remove(struct usb_serial_port *port)
{}

static int iuu_tiocmset(struct tty_struct *tty,
			unsigned int set, unsigned int clear)
{}

/* This is used to provide a carrier detect mechanism
 * When a card is present, the response is 0x00
 * When no card , the reader respond with TIOCM_CD
 * This is known as CD autodetect mechanism
 */
static int iuu_tiocmget(struct tty_struct *tty)
{}

static void iuu_rxcmd(struct urb *urb)
{}

static int iuu_reset(struct usb_serial_port *port, u8 wt)
{}

/* Status Function
 * Return value is
 * 0x00 = no card
 * 0x01 = smartcard
 * 0x02 = sim card
 */
static void iuu_update_status_callback(struct urb *urb)
{}

static void iuu_status_callback(struct urb *urb)
{}

static int iuu_status(struct usb_serial_port *port)
{}

static int bulk_immediate(struct usb_serial_port *port, u8 *buf, u8 count)
{}

static int read_immediate(struct usb_serial_port *port, u8 *buf, u8 count)
{}

static int iuu_led(struct usb_serial_port *port, unsigned int R,
		   unsigned int G, unsigned int B, u8 f)
{}

static void iuu_rgbf_fill_buffer(u8 *buf, u8 r1, u8 r2, u8 g1, u8 g2, u8 b1,
				 u8 b2, u8 freq)
{}

static void iuu_led_activity_on(struct urb *urb)
{}

static void iuu_led_activity_off(struct urb *urb)
{}



static int iuu_clk(struct usb_serial_port *port, int dwFrq)
{}

static int iuu_uart_flush(struct usb_serial_port *port)
{}

static void read_buf_callback(struct urb *urb)
{}

static int iuu_bulk_write(struct usb_serial_port *port)
{}

static int iuu_read_buf(struct usb_serial_port *port, int len)
{}

static void iuu_uart_read_callback(struct urb *urb)
{}

static int iuu_uart_write(struct tty_struct *tty, struct usb_serial_port *port,
			  const u8 *buf, int count)
{}

static void read_rxcmd_callback(struct urb *urb)
{}

static int iuu_uart_on(struct usb_serial_port *port)
{}

/*  Disables the IUU UART (a.k.a. the Phoenix voiderface) */
static int iuu_uart_off(struct usb_serial_port *port)
{}

static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base,
			 u32 *actual, u8 parity)
{}

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

static void iuu_close(struct usb_serial_port *port)
{}

static void iuu_init_termios(struct tty_struct *tty)
{}

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

/* how to change VCC */
static int iuu_vcc_set(struct usb_serial_port *port, unsigned int vcc)
{}

/*
 * Sysfs Attributes
 */

static ssize_t vcc_mode_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static ssize_t vcc_mode_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(vcc_mode);

static int iuu_create_sysfs_attrs(struct usb_serial_port *port)
{}

static int iuu_remove_sysfs_attrs(struct usb_serial_port *port)
{}

/*
 * End Sysfs Attributes
 */

static struct usb_serial_driver iuu_device =;

static struct usb_serial_driver * const serial_drivers[] =;

module_usb_serial_driver();

MODULE_AUTHOR();

MODULE_DESCRIPTION();
MODULE_LICENSE();

module_param(xmas, bool, 0644);
MODULE_PARM_DESC();

module_param(boost, int, 0644);
MODULE_PARM_DESC();

module_param(clockmode, int, 0644);
MODULE_PARM_DESC();

module_param(cdmode, int, 0644);
MODULE_PARM_DESC();

module_param(vcc_default, int, 0644);
MODULE_PARM_DESC();