Skip to contentSkip to conversation

HID: kye: Add report fixup for Genius Manticore Keyboard

DISCUSSION Dave Jones 3 participants 5 messages Nov 30, 2013 – Dec 2, 2013 1 message not in the archive HID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dave Jones

author
#1 lore raw
Quoted 11 lines
Commit:     4a2c94c9b6c03af61b04993340bd9559e2277de4
Author:     Benjamin Tissoires <[email protected]>
AuthorDate: Wed Nov 20 09:49:41 2013 -0500
Committer:  Jiri Kosina <[email protected]>
CommitDate: Thu Nov 21 10:28:58 2013 +0100

HID: kye: Add report fixup for Genius Manticore Keyboard

Genius Manticore Keyboard presents the same problem in its report descriptors than Genius Gila Gaming Mouse and Genius Imperator Keyboard. Use the same fixup.

..

drivers/hid/hid-kye.c static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, · line 347

Quoted 12 lines
drivers/hid/hid-kye.c +3 -0
index 7384512..35a4f9c 100644
@@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
 					"Genius Gx Imperator Keyboard");
+	case USB_DEVICE_ID_GENIUS_MANTICORE:
+		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
+					"Genius Manticore Keyboard");
 		break;

Is the IMPERATOR case supposed to fall-through to MANTICORE here, or is there a missing break ? The commit text describes using the same fixup, but has this alternative case.

Dave

#2 lore raw
Quoted 14 lines · Dave Jones
Quoted 11 lines
Commit:     4a2c94c9b6c03af61b04993340bd9559e2277de4
Author:     Benjamin Tissoires <[email protected]>
AuthorDate: Wed Nov 20 09:49:41 2013 -0500
Committer:  Jiri Kosina <[email protected]>
CommitDate: Thu Nov 21 10:28:58 2013 +0100

HID: kye: Add report fixup for Genius Manticore Keyboard

Genius Manticore Keyboard presents the same problem in its report descriptors than Genius Gila Gaming Mouse and Genius Imperator Keyboard. Use the same fixup.

..

Quoted 16 lines

drivers/hid/hid-kye.c static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, · line 347

Quoted 12 lines
drivers/hid/hid-kye.c +3 -0
index 7384512..35a4f9c 100644
@@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
 					"Genius Gx Imperator Keyboard");
+	case USB_DEVICE_ID_GENIUS_MANTICORE:
+		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
+					"Genius Manticore Keyboard");
 		break;

Is the IMPERATOR case supposed to fall-through to MANTICORE here, or is there a missing break ? The commit text describes using the same fixup, but has this alternative case.

I am almost certain that the missing break is a mistake, and the offsets in both report descriptors are just different, and there is no need for two fixups.

I am queuing this for 3.13 still, but having final confirmation from Benjamin would of course be nice.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
author
#3 lore raw
Quoted 33 lines · Jiri Kosina
Quoted 14 lines · Dave Jones
Quoted 11 lines
Commit:     4a2c94c9b6c03af61b04993340bd9559e2277de4
Author:     Benjamin Tissoires <[email protected]>
AuthorDate: Wed Nov 20 09:49:41 2013 -0500
Committer:  Jiri Kosina <[email protected]>
CommitDate: Thu Nov 21 10:28:58 2013 +0100

HID: kye: Add report fixup for Genius Manticore Keyboard

Genius Manticore Keyboard presents the same problem in its report descriptors than Genius Gila Gaming Mouse and Genius Imperator Keyboard. Use the same fixup.

..

Quoted 16 lines

drivers/hid/hid-kye.c static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, · line 347

Quoted 12 lines
drivers/hid/hid-kye.c +3 -0
index 7384512..35a4f9c 100644
@@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
 					"Genius Gx Imperator Keyboard");
+	case USB_DEVICE_ID_GENIUS_MANTICORE:
+		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
+					"Genius Manticore Keyboard");
 		break;

Is the IMPERATOR case supposed to fall-through to MANTICORE here, or is there a missing break ? The commit text describes using the same fixup, but has this alternative case.

Quoted 6 lines

I am almost certain that the missing break is a mistake, and the offsets in both report descriptors are just different, and there is no need for two fixups.

I am queuing this for 3.13 still, but having final confirmation from Benjamin would of course be nice.

If that is the case..

Signature · 4 lines
Commit 4a2c94c9b6 inadvertantly removed a break from the GENIUS_GX_IMPERATOR case.
Spotted by Coverity.

Signed-off-by: Dave Jones <[email protected]>
drivers/hid/hid-kye.c +1 -0
index ecb5ca669e97..e77696367591 100644
@@ -341,6 +341,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
 					"Genius Gx Imperator Keyboard");
+		break;
 	case USB_DEVICE_ID_GENIUS_MANTICORE:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
 					"Genius Manticore Keyboard");
#4 lore raw
Quoted 10 lines · Dave Jones

Commit 4a2c94c9b6 inadvertantly removed a break from the GENIUS_GX_IMPERATOR case. Spotted by Coverity.

drivers/hid/hid-kye.c +0 -0
index ecb5ca669e97..e77696367591 100644

drivers/hid/hid-kye.c static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, · line 346

Quoted 6 lines
drivers/hid/hid-kye.c +1 -0
@@ -341,6 +341,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
 					"Genius Gx Imperator Keyboard");
+		break;
 	case USB_DEVICE_ID_GENIUS_MANTICORE:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,

I've already taken Ben's original patch:

https://git.kernel.org/cgit/linux/kernel/git/jikos/hid.git/commit/?h=for-3.13/upstream-fixes

Signature · 2 lines
Jiri Kosina
SUSE Labs
#5 lore raw
In reply to Dave Jones
Quoted 34 lines · Dave Jones
Quoted 33 lines · Jiri Kosina
Quoted 30 lines · Dave Jones
Quoted 11 lines
Commit:     4a2c94c9b6c03af61b04993340bd9559e2277de4
Author:     Benjamin Tissoires <[email protected]>
AuthorDate: Wed Nov 20 09:49:41 2013 -0500
Committer:  Jiri Kosina <[email protected]>
CommitDate: Thu Nov 21 10:28:58 2013 +0100

HID: kye: Add report fixup for Genius Manticore Keyboard

Genius Manticore Keyboard presents the same problem in its report descriptors than Genius Gila Gaming Mouse and Genius Imperator Keyboard. Use the same fixup.

..

drivers/hid/hid-kye.c static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, · line 347

Quoted 12 lines
drivers/hid/hid-kye.c +3 -0
index 7384512..35a4f9c 100644
@@ -341,6 +341,9 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 	case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
 		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
 					"Genius Gx Imperator Keyboard");
+	case USB_DEVICE_ID_GENIUS_MANTICORE:
+		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
+					"Genius Manticore Keyboard");
 		break;

Is the IMPERATOR case supposed to fall-through to MANTICORE here, or is there a missing break ? The commit text describes using the same fixup, but has this alternative case.

Quoted 9 lines
Quoted 6 lines

I am almost certain that the missing break is a mistake, and the offsets in both report descriptors are just different, and there is no need for two fixups.

I am queuing this for 3.13 still, but having final confirmation from Benjamin would of course be nice.

If that is the case..

Hi guys,

(sorry for the late answer, last week was Thanksgiving, and I was enjoying US public holidays)

Definitively, this is my mistake. Thanks Dave for spotting it.

Jiri, I'll try to hold on the 3.12 stable queue on this one too (or ask to add Dave's patch).

Cheers,
Benjamin