tb_maximum_bandwidth(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_maximum_bandwidth πŸ’…

okay so first things first, bestie: this is a page from the Kernel API Manual β€” section 9, kernel API land β€” and it's all about tb_maximum_bandwidth, which is literally the Maximum bandwidth over a single link. no cap. ✨


🌸 SYNOPSIS 🌸

int tb_maximum_bandwidth (struct tb *tb , struct tb_port *src_port ,
struct tb_port *dst_port , struct tb_port *port , int *max_up , int
*max_down , bool include_asym );

that's the whole vibe right there. one function, seven things you gotta hand it. slay. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • tb β€” the domain structure, aka the whole Thunderbolt situation you're poking at πŸ‘‘
  • src_port β€” the source protocol adapter. where the traffic's coming from, iykyk πŸ’«
  • dst_port β€” the destination protocol adapter. where it's headed πŸ¦‹
  • port β€” the USB4 port that the total bandwidth is calculated for. this is the main character of the calculation, fr πŸ”₯
  • max_up β€” maximum upstream bandwidth, measured in Mb/s ⬆️
  • max_down β€” maximum downstream bandwidth, also in Mb/s ⬇️
  • include_asym β€” a bool that says: include bandwidth if the link is switched from symmetric to asymmetric. so like, do we count the extra juice you get when the link flips into asymmetric mode? honestly iconic that you even get to choose 🧚

✨ DESCRIPTION ✨

so what does it actually do. okay. it returns the maximum possible bandwidth β€” dropping it into max_up and max_down β€” over a single link at port. that's the tea. πŸ“

and if include_asym is set, it also includes the additional bandwidth you'd get if the links were transitioned into asymmetric toward the direction from src_port to dst_port. so you're not just getting today's bandwidth, you're getting the what if we went asymmetric bandwidth too. lowkey obsessed with that. πŸ’œ


πŸ’€ RETURN πŸ’€

  • 0 on success β€” we love a clean exit, periodt πŸ’…
  • a negative errno otherwise β€” not the vibe, but at least it tells you what went wrong 😭
ngl bestie, always check that return value. 0 = good, negative = go read your errno. don't be out here ignoring it πŸ™ˆ

🌈 SEE ALSO 🌈

the whole bandwidth friend group honestly, go read all of them πŸ’–


aaaand that's the page!! sourced straight from ./drivers/thunderbolt, dated October 2026, and filed right here in section 9 of the Kernel API Manual. mwah. go configure some bandwidth bestie πŸŒΈβ­πŸŽ€

πŸ“¦ where this page comes from