HID: vivaldi: fix handling devices not using numbered reports
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 7 Jan 2022 20:09:36 +0000 (12:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:34 +0000 (11:05 +0100)
commit4c979e88b658aba2a08433a8043c685672b5c915
tree6384bc96202b1d4e8987cd34b606e8fbfb3e511f
parentb81f33f1fc3819a10d96c71dcb37d838d781bb21
HID: vivaldi: fix handling devices not using numbered reports

commit 3fe6acd4dc922237b30e55473c9349c6ce0690f3 upstream.

Unfortunately details of USB HID transport bled into HID core and
handling of numbered/unnumbered reports is quite a mess, with
hid_report_len() calculating the length according to USB rules,
and hid_hw_raw_request() adding report ID to the buffer for both
numbered and unnumbered reports.

Untangling it all requres a lot of changes in HID, so for now let's
handle this in the driver.

[jkosina@suse.cz: microoptimize field->report->id to report->id]
Fixes: 14c9c014babe ("HID: add vivaldi HID driver")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Stephen Boyd <swboyd@chromium.org> # CoachZ
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-vivaldi.c