hid_bpf_input_report(9)
π hid_bpf_input_report(9) π
okay so bestie, welcome to the Kernel API Manual entry for hid_bpf_input_report β yes that's the title AND the man page name, iykyk β¨ this one's a kfunc that lets you inject a HID report in the kernel from a HID device, which is honestly kind of iconic of it π«Ά
β¨ SYNOPSIS β¨
__bpf_kfunc int hid_bpf_input_report (struct hid_bpf_ctx *ctx , enum
hid_report_type type , u8 *buf , const size_t buf__sz );
like, look at her. she's a __bpf_kfunc, she returns an int, and she takes four args. main character behavior fr fr π
π ARGUMENTS π
ctxβ the HID-BPF context, and not just any context: the one you previously allocated inhid_bpf_allocate_context. so like, don't just roll up with some random pointer, okay? πtypeβ the type of the report. your options areHID_INPUT_REPORT,HID_FEATURE_REPORT, andHID_OUTPUT_REPORT. pick your girlie wisely πbufβ aPTR_TO_MEMbuffer. that's the vibe check the verifier's gonna run on it, ngl πbuf__szβ the size of the data to transfer. literally just how many bytes you're moving, no cap π
πΈ DESCRIPTION πΈ
Returns 0 on success, a negative error code otherwise. that's it, that's the mood π
okay but here's the part where you gotta listen, bestie β this function will wait for the device to be available before injecting the event. the way that means it needs to be called in sleepable context. like, it's gonna block and chill until the device shows up, so don't you dare call it somewhere that can't sleep. that's not a suggestion, that's the whole deal π₯
π fr fr: sleepable context only. this function waits on the device, so calling it from a non-sleepable spot is a no from her.
π¦ SEE ALSO π¦
- Kernel file
./drivers/hid/bpf/hid_bpf_dispatch.c hid_bpf_get_data(9)hid_bpf_allocate_context(9)hid_bpf_release_context(9)hid_bpf_hw_request(9)hid_bpf_hw_output_report(9)hid_bpf_try_input_report(9)
like yes, go read all of them, they're the friend group and you gotta know the whole squad π
and that's the page!! π§ this little beauty lives in ./drivers/hid/bpf, dated October 2026 β so like, mark your calendar, write it in your journal, whatever π bye bestie, go inject some reports responsibly β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms