linux/drivers/usb/serial/ir-usb.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * USB IR Dongle driver
 *
 *	Copyright (C) 2001-2002	Greg Kroah-Hartman ([email protected])
 *	Copyright (C) 2002	Gary Brubaker ([email protected])
 *	Copyright (C) 2010	Johan Hovold ([email protected])
 *
 * This driver allows a USB IrDA device to be used as a "dumb" serial device.
 * This can be useful if you do not have access to a full IrDA stack on the
 * other side of the connection.  If you do have an IrDA stack on both devices,
 * please use the usb-irda driver, as it contains the proper error checking and
 * other goodness of a full IrDA stack.
 *
 * Portions of this driver were taken from drivers/net/irda/irda-usb.c, which
 * was written by Roman Weissgaerber <[email protected]>, Dag Brattli
 * <[email protected]>, and Jean Tourrilhes <[email protected]>
 *
 * See Documentation/usb/usb-serial.rst for more information on using this
 * driver
 */

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.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/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/usb/irda.h>

#define DRIVER_AUTHOR
#define DRIVER_DESC

/* if overridden by the user, then use their value for the size of the read and
 * write urbs */
static int buffer_size;

/* if overridden by the user, then use the specified number of XBOFs */
static int xbof =;

static int  ir_startup (struct usb_serial *serial);
static int ir_write(struct tty_struct *tty, struct usb_serial_port *port,
		const unsigned char *buf, int count);
static unsigned int ir_write_room(struct tty_struct *tty);
static void ir_write_bulk_callback(struct urb *urb);
static void ir_process_read_urb(struct urb *urb);
static void ir_set_termios(struct tty_struct *tty,
			   struct usb_serial_port *port,
			   const struct ktermios *old_termios);

/* Not that this lot means you can only have one per system */
static u8 ir_baud;
static u8 ir_xbof;
static u8 ir_add_bof;

static const struct usb_device_id ir_id_table[] =;

MODULE_DEVICE_TABLE(usb, ir_id_table);

static struct usb_serial_driver ir_device =;

static struct usb_serial_driver * const serial_drivers[] =;

static inline void irda_usb_dump_class_desc(struct usb_serial *serial,
					    struct usb_irda_cs_descriptor *desc)
{}

/*------------------------------------------------------------------*/
/*
 * Function irda_usb_find_class_desc(dev, ifnum)
 *
 *    Returns instance of IrDA class descriptor, or NULL if not found
 *
 * The class descriptor is some extra info that IrDA USB devices will
 * offer to us, describing their IrDA characteristics. We will use that in
 * irda_usb_init_qos()
 *
 * Based on the same function in drivers/net/irda/irda-usb.c
 */
static struct usb_irda_cs_descriptor *
irda_usb_find_class_desc(struct usb_serial *serial, unsigned int ifnum)
{}

static u8 ir_xbof_change(u8 xbof)
{}

static int ir_startup(struct usb_serial *serial)
{}

static int ir_write(struct tty_struct *tty, struct usb_serial_port *port,
		const unsigned char *buf, int count)
{}

static void ir_write_bulk_callback(struct urb *urb)
{}

static unsigned int ir_write_room(struct tty_struct *tty)
{}

static void ir_process_read_urb(struct urb *urb)
{}

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

static int __init ir_init(void)
{}

static void __exit ir_exit(void)
{}


module_init();
module_exit(ir_exit);

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

module_param(xbof, int, 0);
MODULE_PARM_DESC();
module_param(buffer_size, int, 0);
MODULE_PARM_DESC();