next_desc(9)
π next_desc(9) β like, the Kernel API Manual page you actually wanna read π
okay so bestie, this is next_desc(9) from the Kernel API Manual and it's literally a tiny little iterator helper for USB gadget descriptor arrays. lowkey one of those pages where the whole thing fits in a text message, but we're gonna make it cute anyway β¨
π¦ NAME π¦
next_desc β advance to the next desc_type descriptor. that's it. that's the whole job. she's a one-trick pony and she ate π
πΈ SYNOPSIS πΈ
struct usb_descriptor_header** next_desc (struct usb_descriptor_header
**t , u8 desc_type );
that's the whole signature, no cap β note the double pointer energy, she's giving ** twice because she's dramatic like that π₯
β¨ ARGUMENTS β¨
tβ currect pointer within descriptor array. yes, "currect" β that's a typo straight from the original manpage, screenshot it and put it in the group chat π (the actual meaning: it's your current pointer, chugging along inside the descriptor array)desc_typeβ descriptor type. the thing you're hunting for. the vibe you're looking for in the crowd π΅οΈββοΈ
π«Ά RETURN π«Ά
next desc_type descriptor or NULL. if she finds one she hands it to you, and if she doesn't, you get NULL β no consolation prize, no explanation, just NULL π
π DESCRIPTION π
Iterate over t until either desc_type descriptor found or NULL (that indicates end of list) encountered.
basically she walks the array for you, step by step, checking vibe after vibe, and she keeps going until she either finds the desc_type you asked for or smacks into a NULL β which is the universal signal for "end of list, ma'am, nothing more to see here" π
like a bestie scanning the party for the one person you actually came to see, and if they're not there she just shrugs and reports back NULL π
π SEE ALSO π
Kernel file ./drivers/usb/gadget/composite.c and, like, the entire extended USB gadget family β she runs with a big crew π:
struct usb_os_string(9)function_descriptors(9)config_ep_by_speed_and_alt(9)config_ep_by_speed(9)usb_add_function(9)usb_function_deactivate(9)usb_function_activate(9)usb_interface_id(9)usb_func_wakeup(9)bos_desc(9)usb_add_config(9)usb_string_id(9)usb_string_ids_tab(9)usb_gstrings_attach(9)usb_string_ids_n(9)usb_composite_probe(9)usb_composite_unregister(9)usb_composite_setup_continue(9)
fr fr go read the others too, this whole lil friend group lives in ./drivers/usb/gadget and they all reference each other, iykyk π¦
k bye bestie, this page came to you from ./drivers/usb/gadget, dated October 2026, signed next_desc(9) β slay, stay hydrated, and may all your pointers find their descriptor πβ¨π
π¦ 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