Re: bad handling of HID input reports for a Delcom foot pedal
From: Jiri Kosina <hidden>
Date: 2014-06-18 12:13:26
On Mon, 19 May 2014, Benjamin Tissoires wrote:
Hi Jiri, Please have a look at: https://bugzilla.kernel.org/show_bug.cgi?id=76461 To me, this device sends garbage and should not send the modifiers both in a Var input and in an Array input. I can fix it either by amending the report descriptor of the device (one byte to change) or by changing hid-input.c for it to send the events in the array processing no matter what was the previous state (see below). I don't know which one to pick because this seems to be a corner case, so fixing hid-input might not be the place, but I am afraid of removing part of the reports coming from the device (what if the modifiers are actually used for something in the report). Any thoughts on it? For the record, fixing hid-input would just remove the test in hid_input_field: if (value[n] >= min && value[n] <= max - && field->usage[value[n] - min].hid - && search(field->value, value[n], count)) + && field->usage[value[n] - min].hid) hid_process_event(hid, field, &field->usage[value[n] - min], 1, interrupt); } (Sorry, gmail, whitespace damaged and everything)
So if modifying the report descriptor is not the option (which is what I understood from Bryan's mail), I have to say I don't really like this change in hid_input_field(), as it's really rather "non obvious". How about just creating a device specific input event quirk for this? -- Jiri Kosina SUSE Labs