next_desc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ‘‘:


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