[patch 42/47] HID: adjust report descriptor fixup for MS 1028 receiver

Greg KH
2009-02-14T01:17:57Z

[-- Attachment #1: hid-adjust-report-descriptor-fixup-for-ms-1028-receiver.patch --]
[-- Type: text/plain, Size: 1934 bytes --]

2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Jiri Kosina <jkosina@suse.cz>

commit 0fb21de0799a985d2da3da14ae5625d724256638 upstream

HID: adjust report descriptor fixup for MS 1028 receiver
[Backport to 2.6.27: cebbert@redhat.com]

Report descriptor fixup for MS 1028 receiver changes also values for
Keyboard and Consumer, which incorrectly trims the range, causing correct
events being thrown away before passing to userspace.

We need to keep the GenDesk usage fixup though, as it reports totally bogus
values about axis.

Reported-by: Lucas Gadani <lgadani@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/hid/usbhid/hid-quirks.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -1130,24 +1130,16 @@ static void usbhid_fixup_button_consumer
}

/*
- * Microsoft Wireless Desktop Receiver (Model 1028) has several
+ * Microsoft Wireless Desktop Receiver (Model 1028) has
* 'Usage Min/Max' where it ought to have 'Physical Min/Max'
*/
static void usbhid_fixup_microsoft_descriptor(unsigned char *rdesc, int rsize)
{
- if (rsize == 571 && rdesc[284] == 0x19
- && rdesc[286] == 0x2a
- && rdesc[304] == 0x19
- && rdesc[306] == 0x29
- && rdesc[352] == 0x1a
- && rdesc[355] == 0x2a
- && rdesc[557] == 0x19
+ if (rsize == 571 && rdesc[557] == 0x19
&& rdesc[559] == 0x29) {
printk(KERN_INFO "Fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n");
- rdesc[284] = rdesc[304] = rdesc[557] = 0x35;
- rdesc[352] = 0x36;
- rdesc[286] = rdesc[355] = 0x46;
- rdesc[306] = rdesc[559] = 0x45;
+ rdesc[557] = 0x35;
+ rdesc[559] = 0x45;
}
}