I have a buggy USB HID device (APC SmartUPS) in which the designers
forgot that ReportCount is a global item. Consequently, according to the
report descriptor, several reports have multiple copies of the same
usage in each field. When you actually query the device, however, only a
single copy of the usage is returned. hid-core catches the expected vs.
actual length mismatch and fails the transfer. This effectively makes
the buggy reports inaccessible even though enough data is present to
populate one usage (which is all userspace wants anyway).
This patch changes hid-core to only warn (if debug is enabled) on such
reports rather than failing the transfer.
Signed-off-by: Adam Kropelin <[EMAIL PROTECTED]>
--- linux-2.6.9/drivers/usb/input/hid-core.c Mon Oct 18 19:21:26 2004
+++ linux-2.6.9-adk/drivers/usb/input/hid-core.c Thu Nov 4 22:11:30 2004
@@ -892,10 +892,8 @@
size = ((report->size - 1) >> 3) + 1;
- if (len < size) {
+ if (len < size)
dbg("report %d is too short, (%d < %d)", report->id, len, size);
- return -1;
- }
if (hid->claimed & HID_CLAIMED_HIDDEV)
hiddev_report_event(hid, report);
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel