xref: /linux/drivers/hid/bpf/progs/hid_bpf.h (revision ba199dc909a20fe62270ae4e93f263987bb9d119)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2022 Benjamin Tissoires
3  */
4 
5 #ifndef ____HID_BPF__H
6 #define ____HID_BPF__H
7 
8 #define HID_BPF_DEVICE_EVENT "struct_ops/hid_device_event"
9 #define HID_BPF_RDESC_FIXUP  "struct_ops/hid_rdesc_fixup"
10 #define HID_BPF_OPS(name) SEC(".struct_ops.link") \
11 	struct hid_bpf_ops name
12 #define hid_set_name(_hdev, _name) __builtin_memcpy(_hdev->name, _name, sizeof(_name))
13 
14 struct hid_bpf_probe_args {
15 	unsigned int hid;
16 	unsigned int rdesc_size;
17 	unsigned char rdesc[4096];
18 	int retval;
19 };
20 
21 #endif /* ____HID_BPF__H */
22