OSDN Git Service

samples/hid: add new hid BPF example
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 3 Nov 2022 15:57:54 +0000 (16:57 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 15 Nov 2022 15:28:40 +0000 (16:28 +0100)
commit6008105b4f4e470da0e9159a3a74ca7ff6e869ba
treec92d7cc2eb6742894183b99c44f574eb8a844adf
parent80e189f2af37d383b4840f3f89896071392cb58f
samples/hid: add new hid BPF example

Everything should be available in the selftest part of the tree, but
providing an example without uhid and hidraw will be more easy to
follow for users.

This example will probably ever only work on the Etekcity Scroll 6E
because we need to adapt the various raw values to the actual device.

On that device, the X and Y axis will be swapped and inverted, and on
any other device, chances are high that the device will not work until
Ctrl-C is hit.

The Makefiles are taken from samples/bpf to not reinvent the wheel and
to force using in-kernel libbpf and bpftool.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
MAINTAINERS
samples/hid/.gitignore [new file with mode: 0644]
samples/hid/Makefile [new file with mode: 0644]
samples/hid/Makefile.target [new file with mode: 0644]
samples/hid/hid_bpf_attach.bpf.c [new file with mode: 0644]
samples/hid/hid_bpf_attach.h [new file with mode: 0644]
samples/hid/hid_bpf_helpers.h [new file with mode: 0644]
samples/hid/hid_mouse.bpf.c [new file with mode: 0644]
samples/hid/hid_mouse.c [new file with mode: 0644]