usb4_usb3_p...te_bandwidth(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 usb4_usb3_port_allocate_bandwidth β€” from the Kernel API Manual, bestie πŸ’…

okay so picture this: you're deep in the Thunderbolt/USB4 driver hood, and you need to actually reserve some bandwidth for the USB3 side of things. That's this function. It lives in the kernel API docs (usb4_usb3_port_allocate_bandwidth(9) if you're being formal about it) and honestly it's kind of a baddie for doing exactly one job really well. ✨


✨ SYNOPSIS ✨

int usb4_usb3_port_allocate_bandwidth (struct tb_port *port , int
*upstream_bw , int *downstream_bw );

yeah she takes a port and two little int pointers and gets to work 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • port β€” the USB3 adapter port in question, aka the main character of this whole operation πŸ‘‘
  • upstream_bw β€” the new upstream bandwidth, like what you're asking for going up 🌀️
  • downstream_bw β€” the new downstream bandwidth, same deal but the other direction 🌊

πŸ’– DESCRIPTION πŸ’–

So here's the tea: this is the function you call when you wanna set how much bandwidth is allocated for the USB3 tunneled isochronous traffic. upstream_bw and downstream_bw are the new values that get programmed into the USB3 adapter allocation registers. literal registers. we love a low-level moment 🧚

now, plot twist β€” if the values you pass in are lower than what's currently being consumed, the allocation gets set to what's currently consumed instead. why? because consumed bandwidth cannot be taken away by CM. that's just the rules, no cap. 🚫

and the best part? the actual new values get handed back to you in upstream_bw and downstream_bw, so you always know what you actually ended up with. obsessed with the transparency honestly πŸ’œ


πŸ”₯ RETURN πŸ”₯

0 on success, negative errno otherwise. short king of a return section, we respect it 😌


🌈 SEE ALSO 🌈

Kernel file ./drivers/thunderbolt/usb4.c β€” and here's the full squad of friends, all of them, every single one (iykyk):


lowkey a whole friend group. go read them. or don't, I'm a manpage not a cop 🫢

and that's the whole page, bestie! this one came out of ./drivers/thunderbolt in October 2026 β€” shoutout to the source and version, they ate πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from