Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+19
+19
drivers/hid/bpf/progs/hid_bpf_helpers.h
··· 19 19 size_t buf__sz, 20 20 enum hid_report_type type, 21 21 enum hid_class_request reqtype) __ksym; 22 + extern int hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx, 23 + __u8 *buf, size_t buf__sz) __weak __ksym; 24 + extern int hid_bpf_input_report(struct hid_bpf_ctx *ctx, 25 + enum hid_report_type type, 26 + __u8 *data, 27 + size_t buf__sz) __weak __ksym; 28 + extern int hid_bpf_try_input_report(struct hid_bpf_ctx *ctx, 29 + enum hid_report_type type, 30 + __u8 *data, 31 + size_t buf__sz) __weak __ksym; 32 + 33 + /* bpf_wq implementation */ 34 + extern int bpf_wq_init(struct bpf_wq *wq, void *p__map, unsigned int flags) __weak __ksym; 35 + extern int bpf_wq_start(struct bpf_wq *wq, unsigned int flags) __weak __ksym; 36 + extern int bpf_wq_set_callback_impl(struct bpf_wq *wq, 37 + int (callback_fn)(void *map, int *key, void *value), 38 + unsigned int flags__k, void *aux__ign) __ksym; 39 + #define bpf_wq_set_callback(wq, cb, flags) \ 40 + bpf_wq_set_callback_impl(wq, cb, flags, NULL) 22 41 23 42 #define HID_MAX_DESCRIPTOR_SIZE 4096 24 43 #define HID_IGNORE_EVENT -1