Skip to content

Commit

Permalink
kfuncs: Update HID BPF helper function documentation
Browse files Browse the repository at this point in the history
Apparently the pages for the HID BPF helper functions were not updated
after the sleepable flag was added to the kfuncs data file. So it got
updated when running the `make generate-docs` command for the last
commit.

Signed-off-by: Dylan Reimerink <[email protected]>
  • Loading branch information
dylandreimerink committed Nov 22, 2024
1 parent 2d94028 commit e6418b9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/linux/kfuncs/hid_bpf_allocate_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ A pointer to &struct hid_bpf_ctx on success, `NULL` on error.
!!! note
The pointer returned by the kfunc may be NULL. Hence, it forces the user to do a NULL check on the pointer returned
from the kfunc before making use of it (dereferencing or passing to another helper).

!!! note
This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable).
<!-- [/KFUNC_DEF] -->

## Usage
Expand Down
3 changes: 3 additions & 0 deletions docs/linux/kfuncs/hid_bpf_hw_output_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Returns the number of bytes transferred on success, a negative error code otherw

<!-- [KFUNC_DEF] -->
`#!c 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](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable).
<!-- [/KFUNC_DEF] -->

## Usage
Expand Down
3 changes: 3 additions & 0 deletions docs/linux/kfuncs/hid_bpf_hw_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Communicate with a HID device

<!-- [KFUNC_DEF] -->
`#!c int hid_bpf_hw_request(struct hid_bpf_ctx *ctx, __u8 *buf, size_t buf__sz, hid_report_type rtype, hid_class_request reqtype)`

!!! note
This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable).
<!-- [/KFUNC_DEF] -->

## Usage
Expand Down
3 changes: 3 additions & 0 deletions docs/linux/kfuncs/hid_bpf_input_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Returns `0` on success, a negative error code otherwise. This function will wait

<!-- [KFUNC_DEF] -->
`#!c int hid_bpf_input_report(struct hid_bpf_ctx *ctx, hid_report_type type, u8 *buf, const size_t buf__sz)`

!!! note
This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable).
<!-- [/KFUNC_DEF] -->

## Usage
Expand Down
3 changes: 3 additions & 0 deletions docs/linux/kfuncs/hid_bpf_release_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Release the previously allocated context @ctx
!!! note
This kfunc releases the pointer passed in to it. There can be only one referenced pointer that can be passed in.
All copies of the pointer being released are invalidated as a result of invoking this kfunc.

!!! note
This function may sleep, and therefore can only be used from [sleepable programs](../syscall/BPF_PROG_LOAD.md/#bpf_f_sleepable).
<!-- [/KFUNC_DEF] -->

## Usage
Expand Down

0 comments on commit e6418b9

Please sign in to comment.