Peter Hutterer, maintainer of the X.Org input subsystem working at Red Hat, has introduced a new utility called udev-hid-bpf, designed for the automatic loading of BPF programs that fix issues in input devices with a HID (Human Input Device) interface or modify their behavior based on user preferences. The HID-BPF subsystem, introduced in Linux kernel 6.3, is used to create handlers for HID devices such as keyboards and mice, enabling the development of input device drivers in the form of BPF programs or handling various events within the HID subsystem.
The udev-hid-bpf utility can be used in conjunction with the udev mechanism to automatically activate BPF programs when new input devices are connected or for manual loading of BPF programs. There are two main categories of BPF programs for use with udev-hid-bpf: programs for fixing hardware or firmware issues and programs for modifying device behavior as per user preferences.
In the first case, it addresses issues such as inverted coordinate axes, incorrect value ranges (for example, reporting 8 buttons instead of 5), and illogical event sequences. In the second case, it concerns changing device settings, for instance, BPF programs can be used to swap buttons. It is expected that BPF programs with fixes will eventually be integrated into the main kernel and allow for the elimination of patches or separate drivers from the kernel.
Źródło: opennet.ru
