Some reports embeds multiple report IDs inside the same collection
authoranton <anton@openbsd.org>
Sun, 29 Aug 2021 18:20:18 +0000 (18:20 +0000)
committeranton <anton@openbsd.org>
Sun, 29 Aug 2021 18:20:18 +0000 (18:20 +0000)
commit4e984ffc3513a0515ac58821ae97194401123df4
tree0865ed5ebb0f91b0c0ac2d84be19c2e7a469094a
parentcae1a3da3f32451b11a58fd1416f5d01aa002e4f
Some reports embeds multiple report IDs inside the same collection
causing ucc to only being able to attach to the last report ID. This in
turn is caused by hid_is_collection() only being able to observe an end
of collection item with the last report ID for the same collection.

Instead, change the matching of ucc to only consider report IDs with at
least one corresponding Consumer Control usage.

Fixes gnezdo@'s Google Pixel earbuds.
sys/dev/usb/ucc.c