tb_xdomain_...y_link_depth(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, so this is a page straight out of the Kernel API Manual and it's literally about finding an XDomain. yes, that kind of XDomain. Thunderbolt drama. let's get into it πŸ¦‹


✨ NAME ✨

tb_xdomain_find_by_link_depth β€” Find an XDomain by link and depth

like, that's it. that's the whole job. iconic behavior honestly πŸ‘‘


🌸 SYNOPSIS 🌸

struct tb_xdomain * tb_xdomain_find_by_link_depth (struct tb *tb , u8
link , u8 depth );

here's your signature, no cap, copied exactly so don't come for me πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • tb β€” the Domain where the XDomain belongs to. your home base, your main character setting 🏠
  • link β€” Root switch link number. yes, root. the top of the tree, the CEO of the link hierarchy ✨
  • depth β€” Depth in the link. how far down we're digging. lowkey a metaphor for life ngl πŸ’€

πŸ”₯ DESCRIPTION πŸ”₯

so what does it actually do? it Finds XDomain by walking through the Thunderbolt topology below tb. like, literally walking the tree. very "going on a little journey" of it 🌈

and here's the important bit, bestie β€” the returned XDomain will have its reference count increased so the caller needs to call tb_xdomain_put when it is done with the object. do NOT forget the tb_xdomain_put. that's a leak and leaks are not slay, they're giving chaos πŸ™ˆ

🫢 this will find all XDomains including the ones that are not yet added to the bus (handshake is still in progress). so yeah, mid-handshake XDomains are still invited to the party πŸ’…
⚠️ okay this one's serious: the caller needs to hold tb->lock. hold the lock. HOLD the lock. no lock, no vibes, periodt.

⭐ RETURN ⭐

Pointer to struct tb_xdomain β€” or NULL if not found. that's it. found it or you didn't. very binary of it πŸ’€


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/thunderbolt/xdomain.c β€” go read the source, it's the whole vibe πŸ”

and here's the entire friend group, all in their (9) era:


later bestie β€” this page lives in ./drivers/thunderbolt, dated October 2026, and it's filed under tb_xdomain_...y_link_depth(9) in the Kernel API Manual. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from