summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-03-28 16:11:22 +0300
committerJiri Kosina <jkosina@suse.cz>2008-04-22 13:34:57 +0400
commitb54ec3c13cf77d21bab25d8bb117f642561fdf4f (patch)
tree63783684654bfc93af0046fe0690ef75376e657f /drivers
parent671d994cfbe10a9b2a474d26db2cef3c878846dc (diff)
downloadlinux-b54ec3c13cf77d21bab25d8bb117f642561fdf4f.tar.xz
HID: pass numbered reports properly to hidraw
The numbered reports need to be passed properly to hidraw (i.e. with the first data field indicating the report number), otherwise userspace has no idea about the identification of the report. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index d7b2f6868a6d..10f925b892d7 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -988,8 +988,13 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event)
hid->hiddev_report_event(hid, report);
- if (hid->claimed & HID_CLAIMED_HIDRAW)
- hidraw_report_event(hid, data, size);
+ if (hid->claimed & HID_CLAIMED_HIDRAW) {
+ /* numbered reports need to be passed with the report num */
+ if (report_enum->numbered)
+ hidraw_report_event(hid, data - 1, size + 1);
+ else
+ hidraw_report_event(hid, data, size);
+ }
for (n = 0; n < report->maxfield; n++)
hid_input_field(hid, report->field[n], data, interrupt);