linux/drivers/usb/misc/adutux.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * adutux - driver for ADU devices from Ontrak Control Systems
 * This is an experimental driver. Use at your own risk.
 * This driver is not supported by Ontrak Control Systems.
 *
 * Copyright (c) 2003 John Homppi (SCO, leave this notice here)
 *
 * derived from the Lego USB Tower driver 0.56:
 * Copyright (c) 2003 David Glance <[email protected]>
 *               2001 Juergen Stuber <[email protected]>
 * that was derived from USB Skeleton driver - 0.5
 * Copyright (c) 2001 Greg Kroah-Hartman ([email protected])
 *
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/sched/signal.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/uaccess.h>

#define DRIVER_AUTHOR
#define DRIVER_DESC

/* Define these values to match your device */
#define ADU_VENDOR_ID
#define ADU_PRODUCT_ID

/* table of devices that work with this driver */
static const struct usb_device_id device_table[] =;

MODULE_DEVICE_TABLE(usb, device_table);

#ifdef CONFIG_USB_DYNAMIC_MINORS
#define ADU_MINOR_BASE
#else
#define ADU_MINOR_BASE
#endif

/* we can have up to this number of device plugged in at once */
#define MAX_DEVICES

#define COMMAND_TIMEOUT

/*
 * The locking scheme is a vanilla 3-lock:
 *   adu_device.buflock: A spinlock, covers what IRQs touch.
 *   adutux_mutex:       A Static lock to cover open_count. It would also cover
 *                       any globals, but we don't have them in 2.6.
 *   adu_device.mtx:     A mutex to hold across sleepers like copy_from_user.
 *                       It covers all of adu_device, except the open_count
 *                       and what .buflock covers.
 */

/* Structure to hold all of our device specific stuff */
struct adu_device {};

static DEFINE_MUTEX(adutux_mutex);

static struct usb_driver adu_driver;

static inline void adu_debug_data(struct device *dev, const char *function,
				  int size, const unsigned char *data)
{}

/*
 * adu_abort_transfers
 *      aborts transfers and frees associated data structures
 */
static void adu_abort_transfers(struct adu_device *dev)
{}

static void adu_delete(struct adu_device *dev)
{}

static void adu_interrupt_in_callback(struct urb *urb)
{}

static void adu_interrupt_out_callback(struct urb *urb)
{}

static int adu_open(struct inode *inode, struct file *file)
{}

static void adu_release_internal(struct adu_device *dev)
{}

static int adu_release(struct inode *inode, struct file *file)
{}

static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
			loff_t *ppos)
{}

static ssize_t adu_write(struct file *file, const __user char *buffer,
			 size_t count, loff_t *ppos)
{}

/* file operations needed when we register this driver */
static const struct file_operations adu_fops =;

/*
 * usb class driver info in order to get a minor number from the usb core,
 * and to have the device registered with devfs and the driver core
 */
static struct usb_class_driver adu_class =;

/*
 * adu_probe
 *
 * Called by the usb core when a new device is connected that it thinks
 * this driver might be interested in.
 */
static int adu_probe(struct usb_interface *interface,
		     const struct usb_device_id *id)
{}

/*
 * adu_disconnect
 *
 * Called by the usb core when the device is removed from the system.
 */
static void adu_disconnect(struct usb_interface *interface)
{}

/* usb specific object needed to register this driver with the usb subsystem */
static struct usb_driver adu_driver =;

module_usb_driver();

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