2005-01-27 23:26:12

by Nico Huber

[permalink] [raw]
Subject: Logitech Cordeless Desktop Keyboard fails to report class descriptor

--- a/drivers/usb/input/hid-core.c 2005-01-27 23:59:52.000000000 +0100
+++ b/drivers/usb/input/hid-core.c 2005-01-28 00:06:31.000000000 +0100
@@ -1282,12 +1282,15 @@
unsigned char type, void *buf, int size)
{
int result, retries = 4;
+
+ memset(buf,0,size); // Make sure we parse really received data
+
do {
result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_DESCRIPTOR, USB_RECIP_INTERFACE | USB_DIR_IN,
(type << 8), ifnum, buf, size, HZ * USB_CTRL_GET_TIMEOUT);
retries--;
- } while (result < 0 && retries);
+ } while (result < size && retries);
return result;
}

@@ -1650,7 +1653,7 @@
printk("\n");
#endif

- if (!(hid = hid_parse_report(rdesc, rsize))) {
+ if (!(hid = hid_parse_report(rdesc, n))) {
dbg("parsing report descriptor failed");
kfree(rdesc);
return NULL;


Attachments:
linux-2.6.11-rc2-hid-class-descriptor.patch (829.00 B)