834da375 | 07-Feb-2025 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: add a v6.11+ compatible BPF fixup for the XPPen ACK05 remote
With v6.11+, we can actually call hid_hw_output_report() and put the device into raw mode, thus getting accurate events without
HID: bpf: add a v6.11+ compatible BPF fixup for the XPPen ACK05 remote
With v6.11+, we can actually call hid_hw_output_report() and put the device into raw mode, thus getting accurate events without being messed up.
Technically we could do the same on v6.10, but given that wayland, gnome and KDE are still not capable of handling the dial, and that v6.10 is EOL, we can safely save a little bit of compilation by only allowing v6.11+.
We can easily export the battery information to userspace by adding a dedicated report. However, we need to cheat on the kernel to force it not to query the battery by making the physical collection a stylus. The kernel will then only rely on the events it gets from the device.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/133 Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20250207-bpf-import-2025-02-07-v1-7-6048fdd5a206@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
4a94deb9 | 07-Feb-2025 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: new hid_bpf_async.h common header
The purpose is to simplify the use of bpf_wq to defer blocking operations in a sleepable context. Compared to a more "classic" async approach, there is no
HID: bpf: new hid_bpf_async.h common header
The purpose is to simplify the use of bpf_wq to defer blocking operations in a sleepable context. Compared to a more "classic" async approach, there is no sync mechanism to wait for the async to finish.
The "simple" API is the following:
```
static int HID_BPF_ASYNC(async_fun)(struct hid_bpf_ctx *hctx) { bpf_printk("%s", __fun__); return 0; }
SEC("syscall") int probe(struct hid_bpf_probe_args *ctx) { ctx->retval = HID_BPF_ASYNC_INIT(async_fun); return 0; }
SEC(HID_BPF_DEVICE_EVENT) int BPF_PROG(event_handler, struct hid_bpf_ctx *hctx) { /* async_fun() can be called now, it's not a sleepable * function in this example */ async_fun(hctx);
/* but we can also delay the call by 10 ms */ HID_BPF_ASYNC_DELAYED_CALL(async_fun, hctx, 10);
return 0; }
HID_BPF_OPS(xppen_ack05_remote) = { .hid_device_event = (void *)event_handler, }; ```
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/133 Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20250207-bpf-import-2025-02-07-v1-6-6048fdd5a206@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
91bb3115 | 07-Feb-2025 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: import new kfunc from v6.10 & v6.11
These kfunc are all in v6.10 except for the hid_bpf_try_input_report() which will be in v6.11. Import their definition once now so we can make use of it
HID: bpf: import new kfunc from v6.10 & v6.11
These kfunc are all in v6.10 except for the hid_bpf_try_input_report() which will be in v6.11. Import their definition once now so we can make use of it.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/114 Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20250207-bpf-import-2025-02-07-v1-5-6048fdd5a206@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
4be93352 | 07-Feb-2025 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: add support for the XP-Pen Artist Pro 19 (gen2)
The device behaves the same than the 16" and 14" models, so let's just add support for it too.
Link: https://gitlab.freedesktop.org/libevde
HID: bpf: add support for the XP-Pen Artist Pro 19 (gen2)
The device behaves the same than the 16" and 14" models, so let's just add support for it too.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/145 Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20250207-bpf-import-2025-02-07-v1-4-6048fdd5a206@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
531a1cc6 | 07-Feb-2025 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Added updated Kamvas Pro 19 descriptor
This adds an updated HID descriptor for the Huion Kamvas Pro 19 that is present on newer firmware revisions, while also trying to keep compat with th
HID: bpf: Added updated Kamvas Pro 19 descriptor
This adds an updated HID descriptor for the Huion Kamvas Pro 19 that is present on newer firmware revisions, while also trying to keep compat with the older versions.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/164 Signed-off-by: Aki Van Ness <aki@lethalbit.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20250207-bpf-import-2025-02-07-v1-3-6048fdd5a206@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
43db1911 | 07-Feb-2025 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Suppress bogus F13 trigger on Sirius keyboard full fan shortcut
The TUXEDO Sirius 16 Gen1 and the TUXEDO Sirius 16 Gen2 Notebooks have an additional "fan" key next to F12.
Pressing it alo
HID: bpf: Suppress bogus F13 trigger on Sirius keyboard full fan shortcut
The TUXEDO Sirius 16 Gen1 and the TUXEDO Sirius 16 Gen2 Notebooks have an additional "fan" key next to F12.
Pressing it alone sends a F14 key press which can be bound by user space.
Pressing it while holding the FN key triggers two things: - The EC firmware locks the fan speed of the internal fans at 100% - F13 key press is registered which by default is already bound in xkb and desktop environments (e.g. in KDE Plasma it launches system settings)
To avoid this unexpected double duty of the FN shortcut, this bpf program suppresses the F13 key press.
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/166 Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20250207-bpf-import-2025-02-07-v1-2-6048fdd5a206@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
b6d8c474 | 17-Oct-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: drop use of Logical|Physical|UsageRange
Replace with individual Minimum/Maximum calls to match the HID report descriptor - HID doesn't have a Range field. Abstracting this is good for hand
HID: bpf: drop use of Logical|Physical|UsageRange
Replace with individual Minimum/Maximum calls to match the HID report descriptor - HID doesn't have a Range field. Abstracting this is good for hand-written descriptors but almost all tools will output min/max instead so let's stick with that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20241017-import_bpf_6-13-v2-3-6a7acb89a97f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
cee9faff | 17-Oct-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Fix Rapoo M50 Plus Silent side buttons
The Rapoo M50 Plus Silent mouse has 2 side buttons in addition to the left, right and middles buttons. However, its original HID descriptor has a Usa
HID: bpf: Fix Rapoo M50 Plus Silent side buttons
The Rapoo M50 Plus Silent mouse has 2 side buttons in addition to the left, right and middles buttons. However, its original HID descriptor has a Usage Maximum of 3, preventing the side buttons to work.
This HID-BPF driver changes that usage to 5.
Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/1015 Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/116 Signed-off-by: José Expósito <jose.exposito89@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://patch.msgid.link/20241017-import_bpf_6-13-v2-2-6a7acb89a97f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
f58e7f40 | 27-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Thrustmaster TCA Yoke Boeing joystick fix
This joystick's original HID descriptor is wrong & it shows a ABS_MISC axis in Linux that doesn't exist on the hardware.
Link: https://gitlab.fre
HID: bpf: Thrustmaster TCA Yoke Boeing joystick fix
This joystick's original HID descriptor is wrong & it shows a ABS_MISC axis in Linux that doesn't exist on the hardware.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/82 Signed-off-by: K S Iyer <kumar.s.iyer65@gmail.com> Link: https://patch.msgid.link/20240627-import-bpf-v1-6-0dbcda4a5b1f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
9b52d811 | 27-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Add Huion Dial 2 bpf fixup
Pretty much similar to the Inspiroy 2, but with 2 wheels and 8 buttons.
This bpf also works in both normal and vendor mode. If the device is switched into vendo
HID: bpf: Add Huion Dial 2 bpf fixup
Pretty much similar to the Inspiroy 2, but with 2 wheels and 8 buttons.
This bpf also works in both normal and vendor mode. If the device is switched into vendor mode by huion-switcher, a udev property is set which is then retrieved by this bpf object. This allows to hide the now unused normal collections.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/103 Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/104 Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/111 Link: https://patch.msgid.link/20240627-import-bpf-v1-5-0dbcda4a5b1f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
f0374154 | 27-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Add support for the XP-PEN Deco Mini 4
The XP-PEN Deco Mini 4 is a UGEE device with a frame with 6 buttons. Its pen has 2 buttons and supports pressure reporting.
Fix their report descrip
HID: bpf: Add support for the XP-PEN Deco Mini 4
The XP-PEN Deco Mini 4 is a UGEE device with a frame with 6 buttons. Its pen has 2 buttons and supports pressure reporting.
Fix their report descriptors and transform the frame button events to support it.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/88 Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patch.msgid.link/20240627-import-bpf-v1-4-0dbcda4a5b1f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
c4015aa7 | 27-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: move the BIT() macro to hid_bpf_helpers.h
This macro can be useful in mopre than one place
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/commit/7970a9c17aa0756bad63e89fccb6
HID: bpf: move the BIT() macro to hid_bpf_helpers.h
This macro can be useful in mopre than one place
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/commit/7970a9c17aa0756bad63e89fccb6ee4f2ec83ccc Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patch.msgid.link/20240627-import-bpf-v1-3-0dbcda4a5b1f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
09c555fa | 27-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: add a driver for the Huion Inspiroy 2S (H641P)
This is a a driver for the Huion Inspiroy 2S in both modes (firmware mode and tablet mode). This device has 6 buttons and a wheel, all of whi
HID: bpf: add a driver for the Huion Inspiroy 2S (H641P)
This is a a driver for the Huion Inspiroy 2S in both modes (firmware mode and tablet mode). This device has 6 buttons and a wheel, all of which send key combinations (see the comments for the defaults). Luckily the device is quite limited in that it only supports one button down at a time, so with this BPF we can simply remap the 8 possible report IDs to our own custom-built report descriptor.
If the device is in tablet mode (e.g. using huion-switcher it sends everything through the vendor report instead). This BPF program converts both, depending which devices you attach to you get both. Or if you attach to all hid devices you get a duplicate device but it'll work either way.
This BPF should be mostly compatible for the M and L as well though they have more buttons so the rdescs will need some minor rework.
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/85 Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/109 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Link: https://patch.msgid.link/20240627-import-bpf-v1-2-0dbcda4a5b1f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
8a89db51 | 27-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: Add a HID report composition helper macros
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 ne
HID: bpf: Add a HID report composition helper macros
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
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/92 Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/96 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Link: https://patch.msgid.link/20240627-import-bpf-v1-1-0dbcda4a5b1f@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
9e16bada | 25-Jun-2024 |
Luis Felipe Hernandez <luis.hernandez093@gmail.com> |
hid: bpf: Fix grammar
* spelling fix: XBox -> Xbox, lowercase 'b' as per Microsoft branding * rephrase: paddle -> paddles, the controller itself has more than one paddle * rephrase: replace usage of
hid: bpf: Fix grammar
* spelling fix: XBox -> Xbox, lowercase 'b' as per Microsoft branding * rephrase: paddle -> paddles, the controller itself has more than one paddle * rephrase: replace usage of "those" in favor of explicitly making reference to the paddles * grammatical fix: report -> reports, use present tense verb. * spelling fix: interpret * consistency: capitalize the first word in bullet points
Signed-off-by: Luis Felipe Hernandez <luis.hernandez093@gmail.com> Link: https://patch.msgid.link/20240625105553.50830-1-luis.hernandez093@gmail.com [bentiss: renamed the file into Xbox, not XBox] Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
c94ae218 | 08-Jun-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: error on warnings when compiling bpf objects
There is no real reasons to paper over warnings for such small programs.
Link: https://lore.kernel.org/r/20240608-hid_bpf_struct_ops-v3-13-6ac
HID: bpf: error on warnings when compiling bpf objects
There is no real reasons to paper over warnings for such small programs.
Link: https://lore.kernel.org/r/20240608-hid_bpf_struct_ops-v3-13-6ac6ade58329@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
0cd1465c | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: add in-tree HID-BPF fix for the Raptor Mach 2
This device is already fixed by "HID: do not assume HAT Switch logical max < 8", but for people without the fix already, having the HID-BPF lo
HID: bpf: add in-tree HID-BPF fix for the Raptor Mach 2
This device is already fixed by "HID: do not assume HAT Switch logical max < 8", but for people without the fix already, having the HID-BPF locally can fix the device while they wait for their distribution to update.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-9-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
9f1bf4c2 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: add in-tree HID-BPF fix for the Huion Kamvas Pro 19
This tablets gets a lot of things wrong: - the secondary button is reported through Secondary Tip Switch - the third button is reported
HID: bpf: add in-tree HID-BPF fix for the Huion Kamvas Pro 19
This tablets gets a lot of things wrong: - the secondary button is reported through Secondary Tip Switch - the third button is reported through Invert
Fortunately, before entering eraser mode, (so Invert = 1), the tablet always sends an out-of-proximity event. So we can detect that single event and: - if there was none but the invert bit was toggled: this is the third button - if there was this out-of-proximity event, we are entering eraser mode, and we will until the next out-of-proximity.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-8-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
1c046d09 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
HID: bpf: add in-tree HID-BPF fix for the XBox Elite 2 over Bluetooth
When using the XBox Wireless Controller Elite 2 over Bluetooth, the device exports the paddle on the back of the device as a sin
HID: bpf: add in-tree HID-BPF fix for the XBox Elite 2 over Bluetooth
When using the XBox Wireless Controller Elite 2 over Bluetooth, the device exports the paddle on the back of the device as a single bitfield value of usage "Assign Selection".
The kernel doesn't process those usages properly and report KEY_UNKNOWN for it.
SDL doesn't know how to interprete that KEY_UNKNOWN and thus ignores the paddles.
Given that over USB the kernel uses BTN_TRIGGER_HAPPY[5-8], we can tweak the report descriptor to make the kernel interprete it properly: - we need an application collection of gamepad (so we have to close the current Consumer Control one) - we need to change the usage to be buttons from 0x15 to 0x18
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-7-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|