drivers/hid/bpf/progs/XPPen__Deco02.bpf.c
Source file repositories/reference/linux-study-clean/drivers/hid/bpf/progs/XPPen__Deco02.bpf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/bpf/progs/XPPen__Deco02.bpf.c- Extension
.c- Size
- 14447 bytes
- Lines
- 360
- Domain
- Driver Families
- Bucket
- drivers/hid
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmlinux.hhid_bpf.hhid_bpf_helpers.hhid_report_helpers.hbpf/bpf_tracing.h
Detected Declarations
function BPF_PROGfunction BPF_PROGfunction probe
Annotated Snippet
switch (data[d]) {
case 0x2e:
dial_code = 1;
break;
case 0x2d:
dial_code = -1;
break;
/* below are buttons, top to bottom */
case 0x05:
button_mask |= BIT(0);
break;
case 0x2c:
button_mask |= BIT(1);
break;
case 0x08:
button_mask |= BIT(2);
break;
case 0x0c:
button_mask |= BIT(3);
break;
case 0x1d:
button_mask |= BIT(4);
break;
case 0x16:
button_mask |= BIT(05);
break;
default:
break;
}
}
__u8 report[8] = { REPORT_ID_BUTTONS, dial_code, button_mask, 0x00 };
__builtin_memcpy(data, report, sizeof(report));
return 0;
}
HID_BPF_OPS(xppen_deco02) = {
.hid_rdesc_fixup = (void *)xppen_deco02_rdesc_fixup,
.hid_device_event = (void *)xppen_deco02_device_event,
};
SEC("syscall")
int probe(struct hid_bpf_probe_args *ctx)
{
ctx->retval = ctx->rdesc_size != RDESC_SIZE_PAD ? -EINVAL : 0;
return 0;
}
char _license[] SEC("license") = "GPL";
Annotation
- Immediate include surface: `vmlinux.h`, `hid_bpf.h`, `hid_bpf_helpers.h`, `hid_report_helpers.h`, `bpf/bpf_tracing.h`.
- Detected declarations: `function BPF_PROG`, `function BPF_PROG`, `function probe`.
- Atlas domain: Driver Families / drivers/hid.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.