Skip to content

Commit

Permalink
HID: pass numbered reports properly to hidraw
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jiri Kosina committed Apr 22, 2008
1 parent 671d994 commit b54ec3c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b54ec3c

Please sign in to comment.