Page MenuHomeFreeBSD

hid_locate: do not ignore constant items.
ClosedPublic

Authored by wulf on Dec 23 2020, 9:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 17, 9:19 AM
Unknown Object (File)
Sun, Mar 16, 5:24 PM
Unknown Object (File)
Jan 19 2025, 12:25 PM
Unknown Object (File)
Jan 19 2025, 12:25 PM
Unknown Object (File)
Jan 19 2025, 12:25 PM
Unknown Object (File)
Jan 19 2025, 12:05 PM
Unknown Object (File)
Dec 11 2024, 6:17 PM
Unknown Object (File)
Nov 25 2024, 7:51 AM
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.