// SPDX-License-Identifier: GPL-2.0-or-later /* * USB HID driver for Glorious PC Gaming Race * Glorious Model O, O- and D mice. * * Copyright (c) 2020 Samuel Čavoj <sammko@sammserver.com>
*/
/*
*/
#include <linux/hid.h> #include <linux/module.h>
#include"hid-ids.h"
MODULE_AUTHOR("Samuel Čavoj ");
MODULE_DESCRIPTION("HID driver for Glorious PC Gaming Race mice");
/* * Glorious Model O and O- specify the const flag in the consumer input * report descriptor, which leads to inputs being ignored. Fix this * by patching the descriptor. * * Glorious Model I incorrectly specifes the Usage Minimum for its * keyboard HID report, causing keycodes to be misinterpreted. * Fix this by setting Usage Minimum to 0 in that report.
*/ staticconst __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsignedint *rsize)
{ if (*rsize == 213 &&
rdesc[84] == 129 && rdesc[112] == 129 && rdesc[140] == 129 &&
rdesc[85] == 3 && rdesc[113] == 3 && rdesc[141] == 3) {
hid_info(hdev, "patching Glorious Model O consumer control report descriptor\n");
rdesc[85] = rdesc[113] = rdesc[141] = \
HID_MAIN_ITEM_VARIABLE | HID_MAIN_ITEM_RELATIVE;
} if (*rsize == 156 && rdesc[41] == 1) {
hid_info(hdev, "patching Glorious Model I keyboard report descriptor\n");
rdesc[41] = 0;
} return rdesc;
}
switch (hdev->product) { case USB_DEVICE_ID_GLORIOUS_MODEL_O:
model = "Model O"; break; case USB_DEVICE_ID_GLORIOUS_MODEL_D:
model = "Model D"; break; case USB_DEVICE_ID_GLORIOUS_MODEL_I:
model = "Model I"; break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.