uclogic_params_get_str_desc(9)
π uclogic_params_get_str_desc(9) β a Kernel API Manual moment β¨
okay bestie, so this is a page from the Kernel API Manual and it's lowkey one of those little helper functions that does exactly one thing and does it slayfully: it goes and grabs a string descriptor off a HID device interface and drops it into a kmalloc-allocated buffer as is β like, no character encoding conversion, none, zero, we're not touching the bytes, periodt π
πΈ NAME πΈ
uclogic_params_get_str_desc β retrieve a string descriptor from a HID device interface, putting it into a kmalloc-allocated buffer as is, without character encoding conversion. raw bytes stay raw, iykyk π
β¨ SYNOPSIS β¨
int uclogic_params_get_str_desc (__u8 **pbuf , struct hid_device *hdev ,
__u8 idx , size_t len );
π¦ ARGUMENTS π¦
pbufβ the location where the pointer to thekmalloc-allocated buffer goes. that buffer is the one holding the retrieved descriptor, bestie. it is not modified in case of error (so don't go reading a stale pointer, okay? π). and yes, it can beNULLβ do that if you literally want the retrieved descriptor justβ¦ discarded. no thoughts, head empty, bye bytes πhdevβ the HID device of the tablet interface we're retrieving the string descriptor from. cannot beNULL. like, that's the whole vibe, no device no descriptor, fr fr π«Άidxβ the index of the string descriptor to request from the device. which one? that one. the one atidxβlenβ the length of the buffer to allocate and the amount of data to retrieve. two jobs, one argument, main character energy π
π₯ RETURN π₯
so here's the vibe check on what comes back:
- the number of bytes retrieved (
<= len) π -EPIPEif the descriptor was not found π (not found bestie, it's giving empty drawer)- or another negative
errnocode in case of some other error π
π SEE ALSO π
the kernel file lives right here, iconic:
Kernel file ./drivers/hid/hid-uclogic-params.c
and here's the whole friend group, all of them, no one left behind π«Ά:
uclogic_params_pen_inrange_to_str(9)uclogic_params_pen_hid_dbg(9)uclogic_params_frame_hid_dbg(9)uclogic_params_hid_dbg(9)uclogic_params_pen_cleanup(9)uclogic_params_pen_init_v1(9)uclogic_params_get_le24(9)uclogic_params_pen_init_v2(9)uclogic_params_frame_cleanup(9)uclogic_params_frame_init_with_desc(9)uclogic_params_frame_init_v1(9)uclogic_params_cleanup_event_hooks(9)uclogic_params_cleanup(9)uclogic_params_get_desc(9)uclogic_params_init_invalid(9)uclogic_params_init_with_opt_desc(9)uclogic_params_huion_init(9)uclogic_probe_interface(9)uclogic_params_parse_ugee_v2_desc(9)uclogic_params_ugee_v2_init_frame_buttons(9)uclogic_params_ugee_v2_init_frame_dial(9)uclogic_params_ugee_v2_init_frame_mouse(9)uclogic_params_ugee_v2_has_battery(9)uclogic_params_ugee_v2_init_battery(9)uclogic_params_ugee_v2_reconnect_work(9)uclogic_params_ugee_v2_init_event_hooks(9)uclogic_params_ugee_v2_init(9)uclogic_params_init(9)
π§ quick reminder bestie:pbufstays untouched on error, andhdevcan never beNULL. those two are the ones that will bite you if you forget them π
and that's the page!! shipped from ./drivers/hid, dated October 2026, in the Kernel API Manual π¦π mwah, go read your descriptors responsibly β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms