// SPDX-License-Identifier: GPL-2.0-or-later /* * HID driver for Holtek gaming mice * Copyright (c) 2013 Christian Ohm * Heavily inspired by various other HID drivers that adjust the report * descriptor. */ /* */ #include <linux/hid.h> #include <linux/module.h> #include <linux/usb.h> #include "hid-ids.h" /* * The report descriptor of some Holtek based gaming mice specifies an * excessively large number of consumer usages (2^15), which is more than * HID_MAX_USAGES. This prevents proper parsing of the report descriptor. * * This driver fixes the report descriptor for: * - USB ID 04d9:a067, sold as Sharkoon Drakonia and Perixx MX-2000 * - USB ID 04d9:a04a, sold as Tracer Sniper TRM-503, NOVA Gaming Slider X200 * and Zalman ZM-GM1 * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse * - USB ID 04d9:a072, sold as LEETGION Hellion Gaming Mouse * - USB ID 04d9:a0c2, sold as ETEKCITY Scroll T-140 Gaming Mouse */ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { … } static int holtek_mouse_probe(struct hid_device *hdev, const struct hid_device_id *id) { … } static const struct hid_device_id holtek_mouse_devices[] = …; MODULE_DEVICE_TABLE(hid, holtek_mouse_devices); static struct hid_driver holtek_mouse_driver = …; module_hid_driver(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …;