summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/hid/hid_common.h
AgeCommit message (Collapse)Author
2024-10-04selftests/hid: allow to parametrize bus/vid/pid/rdesc on the test deviceBenjamin Tissoires
This will be useful to introduce variants in tests to test the interactions between HID-BPF and some kernel modules. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://patch.msgid.link/20241001-hid-bpf-hid-generic-v3-7-2ef1019468df@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-10-04selftests/hid: cleanup C tests by adding a common struct uhid_deviceBenjamin Tissoires
Allows to have an abstract class uhid_device which handles all of the uhid part without having to mess up with individual fds. struct attach_prog_args is now never used in hid_bpf.c, so drop it as well Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://patch.msgid.link/20241001-hid-bpf-hid-generic-v3-6-2ef1019468df@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-08-29selftests/hid: extract the utility part of hid_bpf.c into its own headerBenjamin Tissoires
When adding new tests programs, we need the same mechanics to create new virtual devices, and read from their matching hidraw node. Extract the common part into its own header so we can easily add new tests C-files. Link: https://patch.msgid.link/20240827-hidraw-revoke-v5-2-d004a7451aea@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>