linux/drivers/hid/usbhid/hid-core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  USB HID support for Linux
 *
 *  Copyright (c) 1999 Andreas Gal
 *  Copyright (c) 2000-2005 Vojtech Pavlik <[email protected]>
 *  Copyright (c) 2005 Michael Haboustak <[email protected]> for Concept2, Inc
 *  Copyright (c) 2007-2008 Oliver Neukum
 *  Copyright (c) 2006-2010 Jiri Kosina
 */

/*
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/property.h>
#include <linux/spinlock.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
#include <linux/input.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/string.h>

#include <linux/usb.h>

#include <linux/hid.h>
#include <linux/hiddev.h>
#include <linux/hid-debug.h>
#include <linux/hidraw.h>
#include "usbhid.h"

/*
 * Version Information
 */

#define DRIVER_DESC

/*
 * Module parameters.
 */

static unsigned int hid_mousepoll_interval;
module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
MODULE_PARM_DESC();

static unsigned int hid_jspoll_interval;
module_param_named(jspoll, hid_jspoll_interval, uint, 0644);
MODULE_PARM_DESC();

static unsigned int hid_kbpoll_interval;
module_param_named(kbpoll, hid_kbpoll_interval, uint, 0644);
MODULE_PARM_DESC();

static unsigned int ignoreled;
module_param_named(ignoreled, ignoreled, uint, 0644);
MODULE_PARM_DESC();

/* Quirks specified at module load time */
static char *quirks_param[MAX_USBHID_BOOT_QUIRKS];
module_param_array_named();
MODULE_PARM_DESC();
/*
 * Input submission and I/O error handler.
 */
static void hid_io_error(struct hid_device *hid);
static int hid_submit_out(struct hid_device *hid);
static int hid_submit_ctrl(struct hid_device *hid);
static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid);

/* Start up the input URB */
static int hid_start_in(struct hid_device *hid)
{}

/* I/O retry timer routine */
static void hid_retry_timeout(struct timer_list *t)
{}

/* Workqueue routine to reset the device or clear a halt */
static void hid_reset(struct work_struct *work)
{}

/* Main I/O error handler */
static void hid_io_error(struct hid_device *hid)
{}

static void usbhid_mark_busy(struct usbhid_device *usbhid)
{}

static int usbhid_restart_out_queue(struct usbhid_device *usbhid)
{}

static int usbhid_restart_ctrl_queue(struct usbhid_device *usbhid)
{}

/*
 * Input interrupt completion handler.
 */

static void hid_irq_in(struct urb *urb)
{}

static int hid_submit_out(struct hid_device *hid)
{}

static int hid_submit_ctrl(struct hid_device *hid)
{}

/*
 * Output interrupt completion handler.
 */

static void hid_irq_out(struct urb *urb)
{}

/*
 * Control pipe completion handler.
 */

static void hid_ctrl(struct urb *urb)
{}

static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *report,
				   unsigned char dir)
{}

static void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
{}

static int usbhid_wait_io(struct hid_device *hid)
{}

static int hid_set_idle(struct usb_device *dev, int ifnum, int report, int idle)
{}

static int hid_get_class_descriptor(struct usb_device *dev, int ifnum,
		unsigned char type, void *buf, int size)
{}

static int usbhid_open(struct hid_device *hid)
{}

static void usbhid_close(struct hid_device *hid)
{}

/*
 * Initialize all reports
 */

void usbhid_init_reports(struct hid_device *hid)
{}

/*
 * Reset LEDs which BIOS might have left on. For now, just NumLock (0x01).
 */
static int hid_find_field_early(struct hid_device *hid, unsigned int page,
    unsigned int hid_code, struct hid_field **pfield)
{}

static void usbhid_set_leds(struct hid_device *hid)
{}

/*
 * Traverse the supplied list of reports and find the longest
 */
static void hid_find_max_report(struct hid_device *hid, unsigned int type,
		unsigned int *max)
{}

static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid)
{}

static int usbhid_get_raw_report(struct hid_device *hid,
		unsigned char report_number, __u8 *buf, size_t count,
		unsigned char report_type)
{}

static int usbhid_set_raw_report(struct hid_device *hid, unsigned int reportnum,
				 __u8 *buf, size_t count, unsigned char rtype)
{}

static int usbhid_output_report(struct hid_device *hid, __u8 *buf, size_t count)
{}

static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid)
{}

static int usbhid_parse(struct hid_device *hid)
{}

static int usbhid_start(struct hid_device *hid)
{}

static void usbhid_stop(struct hid_device *hid)
{}

static int usbhid_power(struct hid_device *hid, int lvl)
{}

static void usbhid_request(struct hid_device *hid, struct hid_report *rep, int reqtype)
{}

static int usbhid_raw_request(struct hid_device *hid, unsigned char reportnum,
			      __u8 *buf, size_t len, unsigned char rtype,
			      int reqtype)
{}

static int usbhid_idle(struct hid_device *hid, int report, int idle,
		int reqtype)
{}

static bool usbhid_may_wakeup(struct hid_device *hid)
{}

static const struct hid_ll_driver usb_hid_driver =;

bool hid_is_usb(const struct hid_device *hdev)
{}
EXPORT_SYMBOL_GPL();

static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id)
{}

static void usbhid_disconnect(struct usb_interface *intf)
{}

static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
{}

static void hid_cease_io(struct usbhid_device *usbhid)
{}

static void hid_restart_io(struct hid_device *hid)
{}

/* Treat USB reset pretty much the same as suspend/resume */
static int hid_pre_reset(struct usb_interface *intf)
{}

/* Same routine used for post_reset and reset_resume */
static int hid_post_reset(struct usb_interface *intf)
{}

static int hid_resume_common(struct hid_device *hid, bool driver_suspended)
{}

static int hid_suspend(struct usb_interface *intf, pm_message_t message)
{}

static int hid_resume(struct usb_interface *intf)
{}

static int hid_reset_resume(struct usb_interface *intf)
{}

static const struct usb_device_id hid_usb_ids[] =;

MODULE_DEVICE_TABLE (usb, hid_usb_ids);

static struct usb_driver hid_driver =;

struct usb_interface *usbhid_find_interface(int minor)
{}

static int __init hid_init(void)
{}

static void __exit hid_exit(void)
{}

module_init();
module_exit(hid_exit);

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