diff options
| author | Benjamin Tissoires <bentiss@kernel.org> | 2026-09-14 18:07:30 +0200 |
|---|---|---|
| committer | Benjamin Tissoires <bentiss@kernel.org> | 2026-09-14 18:07:30 +0200 |
| commit | 3c2a69d2a92a23d3d178bfce1ef2e0f64279a0ab (patch) | |
| tree | 7a14a67022b52bc967d6b7d5988d5c4a22759b2a /drivers/hid | |
| parent | 0c17f622aada5bf66f3fff9ed4d1b7fa93ce2d2f (diff) | |
| parent | 73712e5e815f5a9ce8a9052d6cf9233fd39c46a4 (diff) | |
| download | linux-next-3c2a69d2a92a23d3d178bfce1ef2e0f64279a0ab.tar.gz linux-next-3c2a69d2a92a23d3d178bfce1ef2e0f64279a0ab.zip | |
Merge branch 'for-7.4/bpf' into for-next
Diffstat (limited to 'drivers/hid')
| -rw-r--r-- | drivers/hid/bpf/progs/Huion__Inspiroy-Frego-M.bpf.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/bpf/progs/Huion__Inspiroy-Frego-M.bpf.c b/drivers/hid/bpf/progs/Huion__Inspiroy-Frego-M.bpf.c index e6ba2295dc77..d081b7c0b771 100644 --- a/drivers/hid/bpf/progs/Huion__Inspiroy-Frego-M.bpf.c +++ b/drivers/hid/bpf/progs/Huion__Inspiroy-Frego-M.bpf.c @@ -15,6 +15,12 @@ #define PID_L610 0x2012 #define PEN_RDESC_SIZE 125 +/* + * The L610 pen descriptor is also seen 2 bytes shorter (123 bytes); the + * anchor bytes checked below (offsets 0-3, 16-17) are the same in both + * variants, so accept either length. + */ +#define PEN_RDESC_SIZE_SHORT 123 #define SECONDARY_SWITCH_OFFSET 17 HID_BPF_CONFIG( @@ -44,7 +50,7 @@ int BPF_PROG(fix_secondary_barrel_rdesc, struct hid_bpf_ctx *hctx) if (!data) return 0; /* EPERM check */ - if (hctx->size != PEN_RDESC_SIZE) + if (hctx->size != PEN_RDESC_SIZE && hctx->size != PEN_RDESC_SIZE_SHORT) return 0; if (data[0] != 0x05 || data[1] != 0x0d || /* Usage Page (Digitizers) */ @@ -65,7 +71,8 @@ HID_BPF_OPS(fix_secondary_barrel) = { SEC("syscall") int probe(struct hid_bpf_probe_args *ctx) { - ctx->retval = ctx->rdesc_size != PEN_RDESC_SIZE; + ctx->retval = ctx->rdesc_size != PEN_RDESC_SIZE && + ctx->rdesc_size != PEN_RDESC_SIZE_SHORT; if (ctx->retval) { ctx->retval = -EINVAL; return 0; |
