xref: /linux/drivers/hid/bpf/hid_bpf_dispatch.h (revision e7d759f31ca295d589f7420719c311870bb3166f)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _BPF_HID_BPF_DISPATCH_H
4 #define _BPF_HID_BPF_DISPATCH_H
5 
6 #include <linux/hid.h>
7 
8 struct hid_bpf_ctx_kern {
9 	struct hid_bpf_ctx ctx;
10 	u8 *data;
11 };
12 
13 int hid_bpf_preload_skel(void);
14 void hid_bpf_free_links_and_skel(void);
15 int hid_bpf_get_prog_attach_type(int prog_fd);
16 int __hid_bpf_attach_prog(struct hid_device *hdev, enum hid_bpf_prog_type prog_type, int prog_fd,
17 			  __u32 flags);
18 void __hid_bpf_destroy_device(struct hid_device *hdev);
19 int hid_bpf_prog_run(struct hid_device *hdev, enum hid_bpf_prog_type type,
20 		     struct hid_bpf_ctx_kern *ctx_kern);
21 int hid_bpf_reconnect(struct hid_device *hdev);
22 
23 struct bpf_prog;
24 
25 #endif
26