KFunc hid_bpf_hw_output_report
Send an output report to a HID device
Definition
Parameters
ctx
: the HID-BPF context previously allocated in hid_bpf_allocate_context()
buf
: a PTR_TO_MEM
buffer
buf__sz
: the size of the data to transfer
Returns
Returns the number of bytes transferred on success, a negative error code otherwise.
int hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx, __u8 *buf, size_t buf__sz)
Note
This function may sleep, and therefore can only be used from sleepable programs.
This is only true when not used from BPF_PROG_TYPE_SYSCALL
programs.
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_LSM
Until v6.11BPF_PROG_TYPE_TRACING
Until v6.11BPF_PROG_TYPE_STRUCT_OPS
Since v6.11BPF_PROG_TYPE_SYSCALL
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome