#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 …
static int buffer_size;
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);
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)
{ … }
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(…) …;