dwc2_hcd_qtd_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dwc2_hcd_qtd_add(9) ✨

okay bestie, welcome to the Kernel API Manual β€” this one's from the DWC2 USB driver and it's honestly kinda iconic πŸ’…


🌸 NAME 🌸

dwc2_hcd_qtd_add β€” adds a QTD to the QTD-list of a QH. also, and this is the part everyone forgets: the caller must hold the driver lock πŸ”’ no cap, that's not optional.


πŸŽ€ SYNOPSIS πŸŽ€

int dwc2_hcd_qtd_add (struct dwc2_hsotg *hsotg , struct dwc2_qtd *qtd ,
       struct dwc2_qh *qh );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • hsotg β€” the DWC HCD structure, your main character struct πŸ‘‘
  • qtd β€” the QTD you're adding, the whole point of the function fr fr
  • qh β€” the queue head to add the qtd to, its new home 🏠

⭐ RETURN ⭐

0 if it worked (slay), and a negative error code otherwise (😭). that's the whole vibe check.


πŸ’– DESCRIPTION πŸ’–

so here's the tea: if the QH that this QTD is being added to is not currently scheduled, it gets placed into the proper schedule based on its EP type. like, it finds its little friend group automatically, we love that for it 🫢


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/usb/dwc2/hcd_queue.c β€” that's where all the lore lives, iykyk:

dwc2_periodic_channel_available(9), dwc2_check_periodic_bandwidth(9), pmap_schedule(9), pmap_unschedule(9), dwc2_get_ls_map(9), dwc2_qh_print(9), dwc2_qh_schedule_print(9), dwc2_ls_pmap_schedule(9), dwc2_ls_pmap_unschedule(9), dwc2_hs_pmap_schedule(9), dwc2_hs_pmap_unschedule(9), dwc2_uframe_schedule_split(9), dwc2_uframe_schedule_hs(9), dwc2_uframe_schedule_ls(9), dwc2_uframe_schedule(9), dwc2_uframe_unschedule(9), dwc2_pick_first_frame(9), dwc2_do_reserve(9), dwc2_do_unreserve(9), dwc2_unreserve_timer_fn(9), dwc2_check_max_xfer_size(9), dwc2_schedule_periodic(9), dwc2_deschedule_periodic(9), dwc2_wait_timer_fn(9), dwc2_qh_init(9), dwc2_hcd_qh_create(9), dwc2_hcd_qh_free(9), dwc2_hcd_qh_add(9), dwc2_hcd_qh_unlink(9), dwc2_next_for_periodic_split(9), dwc2_next_periodic_start(9), dwc2_hcd_qtd_init(9)

quick reminder bestie: lock held, or you're gonna have a bad time πŸ’€

and that's the page!! brought to you by the fine folks over at ./drivers/usb/dwc2, dated October 2026, manual name dwc2_hcd_qtd_add(9) β€” bye luv u, go hold that driver lock πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from