HID: samples: fix the 2 struct_ops definitions
Turns out that this is not compiling anymore because the hid_bpf_ops
struct_ops definition had a change during the revisions.
Fixes: e342d6f6f7
("HID: samples: convert the 2 HID-BPF samples into struct_ops")
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
This commit is contained in:
parent
3a904d2c77
commit
a67a1deb11
@ -67,7 +67,7 @@ static int hid_x_event(struct hid_bpf_ctx *hctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEC("struct_ops/device_event")
|
SEC("struct_ops/hid_device_event")
|
||||||
int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type)
|
int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type)
|
||||||
{
|
{
|
||||||
int ret = hid_y_event(hctx);
|
int ret = hid_y_event(hctx);
|
||||||
@ -79,7 +79,7 @@ int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SEC("struct_ops/rdesc_fixup")
|
SEC("struct_ops/hid_rdesc_fixup")
|
||||||
int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
|
int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
|
||||||
{
|
{
|
||||||
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */);
|
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */);
|
||||||
@ -121,8 +121,8 @@ int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
|
|||||||
|
|
||||||
SEC(".struct_ops.link")
|
SEC(".struct_ops.link")
|
||||||
struct hid_bpf_ops mouse_invert = {
|
struct hid_bpf_ops mouse_invert = {
|
||||||
.rdesc_fixup = (void *)hid_rdesc_fixup,
|
.hid_rdesc_fixup = (void *)hid_rdesc_fixup,
|
||||||
.device_event = (void *)hid_event,
|
.hid_device_event = (void *)hid_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#define HID_UP_BUTTON 0x0009
|
#define HID_UP_BUTTON 0x0009
|
||||||
#define HID_GD_WHEEL 0x0038
|
#define HID_GD_WHEEL 0x0038
|
||||||
|
|
||||||
SEC("struct_ops/device_event")
|
SEC("struct_ops/hid_device_event")
|
||||||
int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx)
|
int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx)
|
||||||
{
|
{
|
||||||
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 9 /* size */);
|
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 9 /* size */);
|
||||||
@ -101,7 +101,7 @@ int set_haptic(struct haptic_syscall_args *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Convert REL_DIAL into REL_WHEEL */
|
/* Convert REL_DIAL into REL_WHEEL */
|
||||||
SEC("struct_ops/rdesc_fixup")
|
SEC("struct_ops/hid_rdesc_fixup")
|
||||||
int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
|
int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
|
||||||
{
|
{
|
||||||
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */);
|
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */);
|
||||||
@ -132,8 +132,8 @@ int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
|
|||||||
|
|
||||||
SEC(".struct_ops.link")
|
SEC(".struct_ops.link")
|
||||||
struct hid_bpf_ops surface_dial = {
|
struct hid_bpf_ops surface_dial = {
|
||||||
.rdesc_fixup = (void *)hid_rdesc_fixup,
|
.hid_rdesc_fixup = (void *)hid_rdesc_fixup,
|
||||||
.device_event = (void *)hid_event,
|
.hid_device_event = (void *)hid_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
Loading…
Reference in New Issue
Block a user