usb_alloc_streams(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ usb_alloc_streams(9) ✨

okay so bestie, this is a page from the Kernel API Manual and it's literally all about usb_alloc_streams β€” giving your bulk endpoints their very own stream IDs πŸŽ€


🌸 SYNOPSIS 🌸

int usb_alloc_streams (struct usb_interface *interface , struct
usb_host_endpoint **eps , unsigned int num_eps , unsigned int
num_streams , gfp_t mem_flags );

like, that's the whole signature, no cap πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • interface β€” the alternate setting that includes all the endpoints. yep, all of them, she's the main character here πŸ‘‘
  • eps β€” an array of the endpoints that need streams. it's giving "a little squad of endpoints" 🫢
  • num_eps β€” how many endpoints are in that array, fr fr. gotta tell her the headcount
  • num_streams β€” the number of streams to allocate. the actual ask πŸ’–
  • mem_flags β€” the flags the hcd should use to allocate memory ⭐

πŸ’œ DESCRIPTION πŸ’œ

so what she does is set up a group of bulk endpoints so they each have num_streams stream IDs available. iconic behavior honestly ✨

and then β€” this is the fun part β€” drivers may queue multiple transfers to different stream IDs, and those transfers may complete in a different order than they were queued 😭 like yes bestie they can finish out of order, that's the whole vibe, don't @ me


πŸ”₯ RETURN πŸ”₯

  • On success β†’ the number of allocated streams πŸ’–
  • On failure β†’ a negative error code πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/usb/core/hcd.c β€” plus the whole friend group:

ascii2desc(9), rh_string(9), usb_bus_init(9), usb_register_bus(9), usb_deregister_bus(9), register_root_hub(9), usb_calc_bus_time(9), usb_hcd_link_urb_to_ep(9), usb_hcd_check_unlink_urb(9), usb_hcd_unlink_urb_from_ep(9), usb_hcd_giveback_urb(9), usb_hcd_alloc_bandwidth(9), usb_hcd_reset_endpoint(9), usb_free_streams(9), usb_hcd_resume_root_hub(9), usb_bus_start_enum(9), usb_hcd_irq(9), usb_hc_died(9), usb_create_shared_hcd(9), usb_create_hcd(9), usb_stop_hcd(9), usb_add_hcd(9), usb_remove_hcd(9)


🫢 and that's the whole page!! this one lives in ./drivers/usb/core and the date on it is October 2026 β€” slay, go forth and stream, bestie πŸ§šπŸ’–

πŸ“¦ where this page comes from