hid_bpf_try_input_report(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hid_bpf_try_input_report(9)

okay so bestie, welcome to the Kernel API Manual πŸŽ€ β€” this one's called hid_bpf_try_input_report, and it's literally the "no cap, just send it" version of injecting a HID report straight from a HID device into the kernel ✨


⭐ NAME ⭐

hid_bpf_try_input_report β€” inject a HID report in the kernel from a HID device πŸ¦‹


✨ SYNOPSIS ✨

__bpf_kfunc int hid_bpf_try_input_report (struct hid_bpf_ctx *ctx , enum
hid_report_type type , u8 *buf , const size_t buf__sz );

like, copy that exactly, don't come for me πŸ™ˆ


🫢 ARGUMENTS 🫢

  • ctx β€” the HID-BPF context that you already made earlier in hid_bpf_allocate_context, bestie. no context, no vibes πŸ’…
  • type β€” the type of the report, and it's one of HID_INPUT_REPORT, HID_FEATURE_REPORT, or HID_OUTPUT_REPORT πŸ‘‘
  • buf β€” a PTR_TO_MEM buffer, iconic
  • buf__sz β€” the size of the data to transfer, fr fr, count it correctly πŸ“

🌸 DESCRIPTION 🌸

Returns 0 on success, and a negative error code otherwise 😭 β€” that's the whole mood.

The way this works: it will immediately fail if the device is not available, so it's totally safe to use in IRQ context πŸ”₯. that's the main character energy right there β€” no blocking, no waiting, just a quick vibe check and out βœ¨πŸ’€


πŸ’œ SEE ALSO πŸ’œ

go read those too, iykyk πŸ“šπŸ¦‹


ngl this page's home directory is ./drivers/hid/bpf and it's dated October 2026 β€” so yeah, mark your calendars and hydrate πŸ’–

that's the whole page bestie, slay, periodt, go inject some reports responsibly πŸŒˆπŸ‘‘πŸ§š

πŸ“¦ where this page comes from