diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2013-07-02 12:10:09 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-07-03 12:14:33 -0400 |
commit | 3685c18e17f12438d0a83331c1b6a5b00fade7a1 (patch) | |
tree | dd8d084089a8b93e3b1272160335426c05fc0bd1 /drivers/hid | |
parent | a688393bd3fb27690a77f7ae8607b4969039bac5 (diff) |
HID: kye: Add report fixup for Genius Gila Gaming mouse
Genius Gila Gaming Mouse presents an obviously wrong report descriptor.
the Consumer control (report ID 3) is the following:
0x05, 0x0c, // Usage Page (Consumer Devices) 105
0x09, 0x01, // Usage (Consumer Control) 107
0xa1, 0x01, // Collection (Application) 109
0x85, 0x03, // Report ID (3) 111
0x19, 0x00, // Usage Minimum (0) 113
0x2a, 0xff, 0x7f, // Usage Maximum (32767) 115
0x15, 0x00, // Logical Minimum (0) 118
0x26, 0xff, 0x7f, // Logical Maximum (32767) 120
0x75, 0x10, // Report Size (16) 123
0x95, 0x03, // Report Count (3) 125
0x81, 0x00, // Input (Data,Arr,Abs) 127
0x75, 0x08, // Report Size (8) 129
0x95, 0x01, // Report Count (1) 131
0x81, 0x01, // Input (Cnst,Arr,Abs) 133
0xc0, // End Collection 135
So the first input whithin this report has a count of 3 but a usage range
of 32768. So this value is obviously wrong as it should not be greater than
the report count.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=959721
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
-rw-r--r-- | drivers/hid/hid-kye.c | 21 |
3 files changed, 23 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8f616bd81eee..27aa7c76b93d 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1589,6 +1589,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1589 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, | 1589 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, |
1590 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | 1590 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, |
1591 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, | 1591 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, |
1592 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, | ||
1592 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, | 1593 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, |
1593 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, | 1594 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, |
1594 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, | 1595 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 3da75dd4c323..b2b692ea3457 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -474,6 +474,7 @@ | |||
474 | 474 | ||
475 | #define USB_VENDOR_ID_KYE 0x0458 | 475 | #define USB_VENDOR_ID_KYE 0x0458 |
476 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 | 476 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 |
477 | #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 | ||
477 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 | 478 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 |
478 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 | 479 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 |
479 | #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011 | 480 | #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011 |
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c index 6af90dbdc3d4..1e2ee2aa84a0 100644 --- a/drivers/hid/hid-kye.c +++ b/drivers/hid/hid-kye.c | |||
@@ -314,6 +314,25 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
314 | *rsize = sizeof(easypen_m610x_rdesc_fixed); | 314 | *rsize = sizeof(easypen_m610x_rdesc_fixed); |
315 | } | 315 | } |
316 | break; | 316 | break; |
317 | case USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE: | ||
318 | /* | ||
319 | * the fixup that need to be done: | ||
320 | * - change Usage Maximum in the Comsumer Control | ||
321 | * (report ID 3) to a reasonable value | ||
322 | */ | ||
323 | if (*rsize >= 135 && | ||
324 | /* Usage Page (Consumer Devices) */ | ||
325 | rdesc[104] == 0x05 && rdesc[105] == 0x0c && | ||
326 | /* Usage (Consumer Control) */ | ||
327 | rdesc[106] == 0x09 && rdesc[107] == 0x01 && | ||
328 | /* Usage Maximum > 12287 */ | ||
329 | rdesc[114] == 0x2a && rdesc[116] > 0x2f) { | ||
330 | hid_info(hdev, | ||
331 | "fixing up Genius Gila Gaming Mouse " | ||
332 | "report descriptor\n"); | ||
333 | rdesc[116] = 0x2f; | ||
334 | } | ||
335 | break; | ||
317 | } | 336 | } |
318 | return rdesc; | 337 | return rdesc; |
319 | } | 338 | } |
@@ -407,6 +426,8 @@ static const struct hid_device_id kye_devices[] = { | |||
407 | USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, | 426 | USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, |
408 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | 427 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, |
409 | USB_DEVICE_ID_KYE_EASYPEN_M610X) }, | 428 | USB_DEVICE_ID_KYE_EASYPEN_M610X) }, |
429 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | ||
430 | USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, | ||
410 | { } | 431 | { } |
411 | }; | 432 | }; |
412 | MODULE_DEVICE_TABLE(hid, kye_devices); | 433 | MODULE_DEVICE_TABLE(hid, kye_devices); |