]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
HID: core: move Usage Page concatenation to Main item
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Wed, 27 Mar 2019 10:18:48 +0000 (11:18 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit10657924a4a9c47854c5beb6cc2866a3d83bc531
tree822b66ebdef3072c2805d524b418a2be46e908b1
parentbbe18d41b83931e33796ccd597290cc4a4907b04
HID: core: move Usage Page concatenation to Main item

BugLink: https://bugs.launchpad.net/bugs/1838700
[ Upstream commit 58e75155009cc800005629955d3482f36a1e0eec ]

As seen on some USB wireless keyboards manufactured by Primax, the HID
parser was using some assumptions that are not always true. In this case
it's s the fact that, inside the scope of a main item, an Usage Page
will always precede an Usage.

The spec is not pretty clear as 6.2.2.7 states "Any usage that follows
is interpreted as a Usage ID and concatenated with the Usage Page".
While 6.2.2.8 states "When the parser encounters a main item it
concatenates the last declared Usage Page with a Usage to form a
complete usage value." Being somewhat contradictory it was decided to
match Window's implementation, which follows 6.2.2.8.

In summary, the patch moves the Usage Page concatenation from the local
item parsing function to the main item parsing function.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Terry Junge <terry.junge@poly.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-core.c
include/linux/hid.h