Page MenuHomeFreeBSD

hid_locate: do not ignore constant items.
ClosedPublic

Authored by wulf on Dec 23 2020, 9:13 PM.
Tags
None
Referenced Files
F102200233: D27747.id81112.diff
Fri, Nov 8, 9:09 PM
F102190320: D27747.diff
Fri, Nov 8, 5:45 PM
Unknown Object (File)
Thu, Oct 31, 3:09 AM
Unknown Object (File)
Wed, Oct 30, 8:31 PM
Unknown Object (File)
Wed, Oct 23, 5:16 PM
Unknown Object (File)
Wed, Oct 23, 10:17 AM
Unknown Object (File)
Wed, Oct 23, 8:43 AM
Unknown Object (File)
Mon, Oct 21, 8:58 PM
Subscribers
None

Details

Summary

hid_locate() currently skips all HID items which tagged as constant,
i.e. bit 0 of main item data is set to 1. See p.6.2.2.4 of hid1_11.pdf [1].
It looks like such an items are treated as padding, but that is wrong. They
can be a features, see: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232040

As p.6.2.2.9 of hid1_11.pdf clearly states: "Reports can be padded to
byte-align fields by declaring the appropriately sized main item and not
declaring a usage for the main item.", we should remove check for constant
from hid_locate(). Comparing of item usage is enough.

[1] https://www.usb.org/sites/default/files/documents/hid1_11.pdf

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Dec 23 2020, 9:13 PM
wulf created this revision.
This revision is now accepted and ready to land.Dec 24 2020, 11:29 AM

Really, Summary is slightly misleading. Const items can be used as byte-padding items too, but we can't blindly count on it. Will try to write it better.

This revision was automatically updated to reflect the committed changes.