Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 805d84eb authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by jianzhou
Browse files

HID: core: move Usage Page concatenation to Main item



[ 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.

Change-Id: I6580ed3ca583c740090a8fa9ae9f9ca450da3af0
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: default avatarTerry Junge <terry.junge@poly.com>
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Git-commit: 58e75155009cc800005629955d3482f36a1e0eec
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git


[jianzhou@codeaurora.org: resolved trivial conflict in drivers/hid/hid-core.c]
Signed-off-by: default avatarjianzhou <jianzhou@codeaurora.org>
parent 2e230aee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment