KFunc hid_bpf_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 wait for the device to be available before injecting the event, thus needs to be called in sleepable context.
int hid_bpf_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:
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome