linux/drivers/hid/usbhid/hiddev.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (c) 2001 Paul Stewart
 *  Copyright (c) 2001 Vojtech Pavlik
 *
 *  HID char devices, giving access to raw HID device events.
 */

/*
 *
 * Should you need to contact me, the author, you can do so either by
 * e-mail - mail your message to Paul Stewart <[email protected]>
 */

#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/sched/signal.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include <linux/hiddev.h>
#include <linux/compat.h>
#include <linux/vmalloc.h>
#include <linux/nospec.h>
#include "usbhid.h"

#ifdef CONFIG_USB_DYNAMIC_MINORS
#define HIDDEV_MINOR_BASE
#define HIDDEV_MINORS
#else
#define HIDDEV_MINOR_BASE
#define HIDDEV_MINORS
#endif
#define HIDDEV_BUFFER_SIZE

struct hiddev_list {};

/*
 * Find a report, given the report's type and ID.  The ID can be specified
 * indirectly by REPORT_ID_FIRST (which returns the first report of the given
 * type) or by (REPORT_ID_NEXT | old_id), which returns the next report of the
 * given type which follows old_id.
 */
static struct hid_report *
hiddev_lookup_report(struct hid_device *hid, struct hiddev_report_info *rinfo)
{}

/*
 * Perform an exhaustive search of the report table for a usage, given its
 * type and usage id.
 */
static struct hid_field *
hiddev_lookup_usage(struct hid_device *hid, struct hiddev_usage_ref *uref)
{}

static void hiddev_send_event(struct hid_device *hid,
			      struct hiddev_usage_ref *uref)
{}

/*
 * This is where hid.c calls into hiddev to pass an event that occurred over
 * the interrupt pipe
 */
void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
		      struct hid_usage *usage, __s32 value)
{}
EXPORT_SYMBOL_GPL();

void hiddev_report_event(struct hid_device *hid, struct hid_report *report)
{}

/*
 * fasync file op
 */
static int hiddev_fasync(int fd, struct file *file, int on)
{}


/*
 * release file op
 */
static int hiddev_release(struct inode * inode, struct file * file)
{}

static int __hiddev_open(struct hiddev *hiddev, struct file *file)
{}

/*
 * open file op
 */
static int hiddev_open(struct inode *inode, struct file *file)
{}

/*
 * "write" file op
 */
static ssize_t hiddev_write(struct file * file, const char __user * buffer, size_t count, loff_t *ppos)
{}

/*
 * "read" file op
 */
static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t count, loff_t *ppos)
{}

/*
 * "poll" file op
 * No kernel lock - fine
 */
static __poll_t hiddev_poll(struct file *file, poll_table *wait)
{}

/*
 * "ioctl" file op
 */
static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd, void __user *user_arg)
{}

static noinline int hiddev_ioctl_string(struct hiddev *hiddev, unsigned int cmd, void __user *user_arg)
{}

static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}

static const struct file_operations hiddev_fops =;

static char *hiddev_devnode(const struct device *dev, umode_t *mode)
{}

static struct usb_class_driver hiddev_class =;

/*
 * This is where hid.c calls us to connect a hid device to the hiddev driver
 */
int hiddev_connect(struct hid_device *hid, unsigned int force)
{}

/*
 * This is where hid.c calls us to disconnect a hiddev device from the
 * corresponding hid device (usually because the usb device has disconnected)
 */
static struct usb_class_driver hiddev_class;
void hiddev_disconnect(struct hid_device *hid)
{}