linux/drivers/hid/hidraw.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * HID raw devices, giving access to raw HID events.
 *
 * In comparison to hiddev, this device does not process the
 * hid events at all (no parsing, no lookups). This lets applications
 * to work on raw hid events as they want to, and avoids a need to
 * use a transport-specific userspace libhid/libusb libraries.
 *
 *  Copyright (c) 2007-2014 Jiri Kosina
 */


#define pr_fmt(fmt)

#include <linux/fs.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <linux/poll.h>
#include <linux/device.h>
#include <linux/major.h>
#include <linux/slab.h>
#include <linux/hid.h>
#include <linux/mutex.h>
#include <linux/sched/signal.h>
#include <linux/string.h>

#include <linux/hidraw.h>

static int hidraw_major;
static struct cdev hidraw_cdev;
static const struct class hidraw_class =;
static struct hidraw *hidraw_table[HIDRAW_MAX_DEVICES];
static DECLARE_RWSEM(minors_rwsem);

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

/*
 * The first byte of the report buffer is expected to be a report number.
 */
static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, size_t count, unsigned char report_type)
{}

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


/*
 * This function performs a Get_Report transfer over the control endpoint
 * per section 7.2.1 of the HID specification, version 1.1.  The first byte
 * of buffer is the report number to request, or 0x0 if the device does not
 * use numbered reports. The report_type parameter can be HID_FEATURE_REPORT
 * or HID_INPUT_REPORT.
 */
static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t count, unsigned char report_type)
{}

static __poll_t hidraw_poll(struct file *file, poll_table *wait)
{}

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

static int hidraw_fasync(int fd, struct file *file, int on)
{}

static void drop_ref(struct hidraw *hidraw, int exists_bit)
{}

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

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

static const struct file_operations hidraw_ops =;

int hidraw_report_event(struct hid_device *hid, u8 *data, int len)
{}
EXPORT_SYMBOL_GPL();

int hidraw_connect(struct hid_device *hid)
{}
EXPORT_SYMBOL_GPL();

void hidraw_disconnect(struct hid_device *hid)
{}
EXPORT_SYMBOL_GPL();

int __init hidraw_init(void)
{}

void hidraw_exit(void)
{}