- Jun 05, 2024
-
-
Signed-off-by:
José Expósito <jose.exposito89@gmail.com>
-
- May 31, 2024
-
-
Peter Hutterer authored
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:
Peter Hutterer <peter.hutterer@who-t.net>
-
- May 30, 2024
-
-
Peter Hutterer authored
Fixes: e9522cd0 ("Add a HID report composition helper macros") Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
These macros make it slightly easier and more modular to create a HID report descriptor from scratch. Since they carry the annotation we don't need to comment it and they cannot get stale. For comparison, before we had this: 0x15, 0x00, // Logical Minimum (0) 0x25, 0x01, // Logical Maximum (1) 0x95, 0x04, // Report Count (4) 0x75, 0x01, // Report Size (1) Now we can write this as: LogicalRange_i8(0, 1) ReportCount(4) ReportSize(1) Because these macros are for creating new report descriptors, some bits aren't directly exposed. e.g in the example above: there is a logical range as one macro that sets both min and max. There is seldom a good use case for skipping either anyway. These macros will need to be expanded over time. For Usage Pages and Usage IDs, we use a tool to parse the HUT JSON (attached to the HUT 1.5 PDF [1]) and generate all #defines for all usage pages and usages in the form: #define UsagePage_Foo_Bar #define Usage_FB_SomeOrOther Where the FB is simply the acronym based on the capital letters in the Usage Page name or the first three letters, whichever makes slightly more sense. [1] https://usb.org/document-library/hid-usage-tables-15 Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- May 28, 2024
-
-
Benjamin Tissoires authored
And also mention about meson.build Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
This prevent some basic warnings like unused variable or such Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
Better ensure we don't get it wrongly spelled by having a macro. This also will allow us to switch to struct_ops with fewer changes. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
We need initial_value_mut() of OpenMap for struct_ops support, which is only available in 0.23+ `.clang_args` changed to take an iterator, so a couple of changes are required in build.rs Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
udev-hid-bpf add foo bar - xyz uvw Loads BPF objects xyz and uvw for the two devices foo and bar. A single dash separator is needed, Clap stops parsing at -- and we need some separator to maintain backwards compatibility. The behavior for one argument (device only) or two arguments (device + object path) remains as-is. Likewise, to remove BPF programs from multiple devices use: udev-hid-bpf remove foo bar Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Makes things easier for debugging since we no longer need a separate udev-hid-bpf remove call. Removing pinned BPFs is asynchronous so we need to sleep for a bit after removing the files to ensure they're really gone. Without the sleep loading the same BPF immediately after will fail. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Since we want to return an ExitCode we need to convert our results to that. And that's a lot easier when we have a simple main wrapper and our actual code just questions everything. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
warning: variable ‘n’ set but not used [-Wunused-but-set-variable] warning: unused variable ‘tilt’ [-Wunused-variable] Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- May 15, 2024
-
-
Benjamin Tissoires authored
Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
Without this, the CI fails as 10-HP__Elite-Presenter.bpf.c is now in stable, and we weren't sjipping it anymore. But it makes sense to overwrite the system ones in case a manual install is done, so let's provide everything. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
When the MR is opened. This also allows drive by contributors to not require being added to CI-OK Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
or https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/jobs/58642092 : ``` [ 230.657758] uhid-test.sh[99]: + exists_or_fail /builds/libevdev/udev-hid-bpf/build_dir/_inst/lib/firmware/hid/bpf [ 230.657956] uhid-test.sh[99]: + file=/builds/libevdev/udev-hid-bpf/build_dir/_inst/lib/firmware/hid/bpf [ 230.658019] uhid-test.sh[99]: + '[' -e /builds/libevdev/udev-hid-bpf/build_dir/_inst/lib/firmware/hid/bpf ']' [ 230.658555] uhid-test.sh[99]: + die 'Missing required file: /builds/libevdev/udev-hid-bpf/build_dir/_inst/lib/firmware/hid/bpf' [ 230.658604] uhid-test.sh[99]: + echo 'Missing required file: /builds/libevdev/udev-hid-bpf/build_dir/_inst/lib/firmware/hid/bpf' [ 230.658641] uhid-test.sh[99]: Missing required file: /builds/libevdev/udev-hid-bpf/build_dir/_inst/lib/firmware/hid/bpf [ 230.658663] uhid-test.sh[99]: + exit 1 ``` Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
it is now in stable, so things have changed a bit Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
reported by @KSI65 Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
They are in https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/log/?h=for-6.10/hid-bpf Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
error[E0308]: mismatched types --> src/bpf.rs:39:13 | 39 | sz: std::mem::size_of::<libbpf_sys::bpf_test_run_opts>() as u64, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64` Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- May 02, 2024
-
-
Peter Hutterer authored
And make the uname run check more robust against failures. Closes #24 Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- May 01, 2024
-
-
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
This should require one less round trip to ask the reporter if something goes wrong during the build. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
prefix is already used for our install prefix, let's not re-use that. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- Apr 30, 2024
-
-
Peter Hutterer authored
Some users have older meson versions which won't work. Closes #22 Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- Apr 18, 2024
-
-
Benjamin Tissoires authored
Looks like we have an issue with our target dir in test mode. It rebuilds everything, because `cargo_options` has a different `--target-dir`. Remove that extra `--target-dir` so we can run `meson test` without recompilation. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Otherwise the whole paragraph shows up in udev-hid-bpf --help which looks a bit odd. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- Apr 17, 2024
-
-
Benjamin Tissoires authored
Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
We should only care about `bpf_dirs` when the path is not provided. Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
This is less verbose and bails out properly if no files are found Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Benjamin Tissoires authored
Currently, each install of `udev-hid-bpf` is hiding any other installation path for finding their bpf object files. This is problematic when we need users to test a branch, because this way we hide any system-wide installation of `udev-hid-bpf` and any bpf object files shipped with it. Supply the default list of BPF lookup directories from meson but make them configurable. Use the most common directories as defaults but users can override those if they need to. This way, a manual reinstallation should still be able to reach the system-wide installation while keeping the new files around. Closes #20 Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-
Fix typos, reword a few things (some for better line breaks), add a link to the gitlab repo and issue tracker, reference the license, etc. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
A case-changing rename of BPF files may happen (we had one from xppen to XPPen already) so let's make the stem matching case-insensitive so we keep loading existing installed files, if any. Closes #21 Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- Apr 16, 2024
-
-
Peter Hutterer authored
Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
As the docs state [1]: > log = "^1.2.3" is exactly equivalent to log = "1.2.3". [1] https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Peter Hutterer authored
We should be fine using the normal version requirement here. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- Apr 11, 2024
-
-
Benjamin Tissoires authored
Signed-off-by:
Benjamin Tissoires <benjamin.tissoires@gmail.com>
-