HomeFreeBSD

Allow HID report descriptor parser to return more then 1 usage per item

Description

Allow HID report descriptor parser to return more then 1 usage per item

This handles parsing of following descriptor, containing array of
usages:

0x05, 0x01, Usage Page (Generic Desktop Ctrls)
0x09, 0x80,
Usage (Sys Control)
0xA1, 0x01, Collection (Application)
0x75, 0x02,
Report Size (2)
0x95, 0x01, Report Count (1)
0x15, 0x01,
Logical Minimum (1)
0x25, 0x03, Logical Maximum (3)
0x09, 0x82,
Usage (Sys Sleep)
0x09, 0x81, Usage (Sys Power Down)
0x09, 0x83,
Usage (Sys Wake Up)
0x81, 0x60, Input (Data,Array,Abs)
0x75, 0x06,
Report Size (6)
0x81, 0x03, Input (Const,Var,Abs)
0xC0,
End Collection

Our current parser returns only first usage (Sys Sleep) and loses next
two. Set HID_ITEM_MAXUSAGE limit relatively low as existing code
usually allocates hid_item on stack.

Also tweak hid_locate() to support hid items with multiple usages.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D27748

Details

Provenance
wulf_cicgroup.ruAuthored on Dec 24 2020, 11:46 AM
wulfCommitted on Jan 7 2021, 11:18 PM
Reviewer
hselasky
Differential Revision
D27748: hid: Allow HID report descriptor parser to return more then 1 usage per item.
Parents
R10:3f2709285421: hid_locate: do not ignore constant items.
Branches
Unknown
Tags
Unknown