Utilizzo di programmi BPF per risolvere problemi nei dispositivi di input

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 with HID (Human Input Device) interface input devices or change their behavior based on user preferences. The HID-BPF subsystem, which appeared in the Linux kernel 6.3, is applied for creating handlers for HID devices such as keyboards and mice, enabling the development of input device drivers in the form of BPF programs or the handling of various events within the HID subsystem.

The udev-hid-bpf utility can be used alongside the udev mechanism to automatically activate BPF programs when new input devices are connected or to load BPF programs manually. Two main categories of BPF programs are distinguished for use with udev-hid-bpf: programs aimed at fixing hardware or firmware issues, and programs that alter device behavior according to user preferences.

In the first case, tasks address the elimination of shortcomings and errors in devices, such as inverted coordinate axes, incorrect value ranges (for example, claiming the presence of 8 buttons instead of 5), and illogical event sequences. In the second case, the focus is on changing device settings; for instance, BPF programs can be used to swap buttons. It is anticipated that BPF programs with fixes will eventually be included in the main kernel, thus eliminating the need for adding patches or separate drivers to the kernel.

Fonte: opennet.ru

Acquista un hosting affidabile per siti web con protezione DDoS, VPS VDS server 🔥 Acquista un hosting affidabile per siti web con protezione DDoS, VPS VDS server | ProHoster