tb_port_wait_for_link_width(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, so this is tb_port_wait_for_link_width(9) from the kernel API manual β€” yes, the kernel manual, we're doing big-brain hours rn 🧠✨ β€” and it's literally just "sit there and wait until the link gets as wide as you asked for." That's the whole vibe. Let's get into it πŸŽ€


✨ NAME ✨

tb_port_wait_for_link_width β€” wait until the link reaches a specific width, no cap, just vibes and patience ⏳


πŸ¦‹ SYNOPSIS πŸ¦‹

int tb_port_wait_for_link_width (struct tb_port *port , unsigned int
width , int timeout_msec );

look at that signature. chef's kiss. very demure, very mindful πŸ‘‘


🌸 ARGUMENTS 🌸

  • port β€” the port you're waiting on 🫢 like, this is the main character of the whole call
  • width β€” the expected link width, which is a bitmask bestie, not just a plain number, iykyk πŸŽ€
  • timeout_msec β€” timeout in ms, aka how long you're willing to stand there waiting before you give up πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• β€” this one should be used after both ends of the link have been bonded, or after bonding has been disabled, to wait until the link actually reaches the expected state. it's giving "we set it up, now we manifest it" energy ✨

and the fun part: you can pass it a mask of expected widths. so it's not one single width, it's a whole lil squad of acceptable widths 🌈


πŸ”₯ RETURN πŸ”₯

the way this function is so straightforward, obsessed:

  • 0 β€” if the link reaches any of the specified widths. periodt, we love a success πŸ’–
  • -ETIMEDOUT β€” if the link does not reach the specified width. it just didn't happen for us 😭
  • Negative errno β€” another error occurred. yeah, something else went sideways, no further explanation, that's the whole note πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file ./drivers/thunderbolt/switch.c β€” go read it, bestie, it's the source of truth πŸ“– β€” plus this absolutely stacked friend group of related calls:

like, that's a whole friend group and every single one of them got an invite πŸ’Œ


anyway that's the page 🫢 and before you go β€” this lil baddie lives in ./drivers/thunderbolt and it's dated October 2026, so go forth, wait for your link width, and slay πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from