#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)
{ … }
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)
{ … }
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)
{ … }