]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: bpf: import new kfunc from v6.10 & v6.11
authorBenjamin Tissoires <bentiss@kernel.org>
Fri, 7 Feb 2025 13:56:01 +0000 (14:56 +0100)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 24 Feb 2025 08:25:34 +0000 (09:25 +0100)
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>
drivers/hid/bpf/progs/hid_bpf_helpers.h

index 3ba24d125a081be4b09d88be4a2afcdc6b8c5f00..bf19785a6b06734d9465547e915bf8baeec23350 100644 (file)
@@ -19,6 +19,25 @@ extern int hid_bpf_hw_request(struct hid_bpf_ctx *ctx,
                              size_t buf__sz,
                              enum hid_report_type type,
                              enum hid_class_request reqtype) __ksym;
+extern int hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx,
+                                   __u8 *buf, size_t buf__sz) __weak __ksym;
+extern int hid_bpf_input_report(struct hid_bpf_ctx *ctx,
+                               enum hid_report_type type,
+                               __u8 *data,
+                               size_t buf__sz) __weak __ksym;
+extern int hid_bpf_try_input_report(struct hid_bpf_ctx *ctx,
+                                   enum hid_report_type type,
+                                   __u8 *data,
+                                   size_t buf__sz) __weak __ksym;
+
+/* bpf_wq implementation */
+extern int bpf_wq_init(struct bpf_wq *wq, void *p__map, unsigned int flags) __weak __ksym;
+extern int bpf_wq_start(struct bpf_wq *wq, unsigned int flags) __weak __ksym;
+extern int bpf_wq_set_callback_impl(struct bpf_wq *wq,
+               int (callback_fn)(void *map, int *key, void *value),
+               unsigned int flags__k, void *aux__ign) __ksym;
+#define bpf_wq_set_callback(wq, cb, flags) \
+       bpf_wq_set_callback_impl(wq, cb, flags, NULL)
 
 #define HID_MAX_DESCRIPTOR_SIZE        4096
 #define HID_IGNORE_EVENT       -1