KFunc hid_bpf_try_input_report
Inject a HID report in the kernel from a HID device
Definition
Parameters
ctx: the HID-BPF context previously allocated in hid_bpf_allocate_context()
type: the type of the report (HID_INPUT_REPORT, HID_FEATURE_REPORT, HID_OUTPUT_REPORT)
buf: a PTR_TO_MEM buffer
buf__sz: the size of the data to transfer
Returns
Returns 0 on success, a negative error code otherwise. This function will immediately fail if the device is not available, thus can be safely used in IRQ context.
int hid_bpf_try_input_report(struct hid_bpf_ctx *ctx, hid_report_type type, u8 *buf, const size_t buf__sz)
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Program types
The following program types can make use of this kfunc:
BPF_PROG_TYPE_LSMUntil v6.11BPF_PROG_TYPE_TRACINGUntil v6.11BPF_PROG_TYPE_STRUCT_OPSSince v6.11
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome