usb_hcd_link_urb_to_ep(9)
β¨ usb_hcd_link_urb_to_ep(9) β¨
okay so bestie, welcome to the Kernel API Manual β yes we're in kernel land now, bring your sparkle π¦
π NAME π
usb_hcd_link_urb_to_ep β literally just adds an URB to its endpoint queue, that's the whole vibe π
πΈ SYNOPSIS πΈ
int usb_hcd_link_urb_to_ep (struct usb_hcd *hcd , struct urb *urb );
π ARGUMENTS π
hcdβ the host controller thaturbgot submitted to, aka the main character here πurbβ the URB that's being submitted, the little guy we're linking up π«Ά
π DESCRIPTION π
okay so here's the tea: host controller drivers should call this routine inside their enqueue method. no cap, that's where it goes π―
β οΈ the HCD's private spinlock must be held and interrupts must be disabled. like, both. don't skip this, i'm begging π
the actions carried out here are required for URB submission, plus for endpoint shutdown, plus for usb_kill_urb. all three, same little function, iconic behaviour honestly πβ¨
β RETURN β
0β no error, we slayed π- otherwise β a negative error code, and in that case the enqueue method must fail, periodt
and if no error occurs but enqueue fails anyway? then it must call usb_hcd_unlink_urb_from_ep before releasing the private spinlock and returning. do not forget this step bestie, it's giving "required cleanup" π
π§ SEE ALSO π§
kernel file ./drivers/usb/core/hcd.c β go read it, iykyk π
then the whole friend group, in this exact order:
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_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_alloc_streams(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 page!! πΈ this lil gem lives in ./drivers/usb/core, dated October 2026, and it's filed under usb_hcd_link_urb_to_ep(9) in the Kernel API Manual β mwah, go forth and link urbs 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