dwc2_host_get_tt_info(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dwc2_host_get_tt_info(9) β€” like, the Kernel API Manual, bestie ✨

okay so real quick β€” this page lives in the Kernel API Manual (that's the manual name, iykyk), and it's all about dwc2_host_get_tt_info. Let's get into it 🫢


🌸 NAME 🌸

dwc2_host_get_tt_info β€” grab the dwc2_tt that's associated with a context ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct dwc2_tt * dwc2_host_get_tt_info (struct dwc2_hsotg *hsotg , void
*context , gfp_t mem_flags , int *ttport );

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


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hsotg β€” the HCD state structure for the DWC OTG controller. your main character struct fr 🫢
  • context β€” the priv pointer from a struct dwc2_hcd_urb. yes bestie, that one.
  • mem_flags β€” flags for allocating memory. the alloc vibes ✨
  • ttport β€” we'll return this device's port number right here. that's used to reference into the bitmap if we're on a multi_tt hub πŸ‘‘

🌈 DESCRIPTION 🌈

so what this does is it gets the dwc2_tt structure (plus the ttport) that's associated with the given context β€” and the context is really just a struct urb pointer, lowkey 🫢

the first time this gets called for a given TT, we allocate memory for our structure. and then when everyone is done and has called dwc2_host_put_tt_info, the refcount for the structure goes to 0 and we free it. iconic cleanup behavior tbh πŸ’…


⭐ RETURN ⭐

returns a pointer to a struct dwc2_tt ✨

🚨 do NOT forget to call dwc2_host_put_tt_info! like actually, bestie, don't leave it hanging 😭

returns NULL upon memory alloc failure πŸ’€


πŸ’œ SEE ALSO πŸ’œ

kernel file ./drivers/usb/dwc2/hcd.c, plus this whole squad of friends 🫢:


🧚 and that's the whole page, bestie! it's from ./drivers/usb/dwc2, dated October 2026, and yes it's literally titled dwc2_host_get_tt_info(9) πŸ’– periodt ✨
πŸ“¦ where this page comes from