Skip to content
Snippets Groups Projects
Commit 37a6f017 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Add a vendor report helper


A macro to generate a vendor-specific padding-only
report with Report ID 0xac of the given size in bytes.

HID-BPF requires that at least one report has
the same size as the original report from the device.
Without that events are silently discarded by the kernel.

The easy way to ensure that is to add this
macro so we have a report that's the expected size:

  static __u8 fixed_rdesc = [
     UsagePage_Generic_Desktop
     Usage_GD_Keyboard
     CollectionApplication(
         ... intended rdesc items go here ...
         FixedSizeVendorReport(12)
     )
  ];

Side-effect: if placed outside an Application Collection this will show
up as another device that doesn't send events so let's document this.

The Report Id 0xac was picked with the guess that very
few actual devices use this Report Id so it shouldn't clash. And even
where it does the Report Id can be changed during the event fixup.

Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 2b1ccd93
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment