usb4_usb3_p...te_bandwidth(9)
πΈ 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):
usb4_switch_check_wakes(9)usb4_switch_setup(9)usb4_switch_configuration_valid(9)usb4_switch_read_uid(9)usb4_switch_drom_read(9)usb4_switch_lane_bonding_possible(9)usb4_switch_set_wake(9)usb4_switch_set_sleep(9)usb4_switch_nvm_sector_size(9)usb4_switch_nvm_read(9)usb4_switch_nvm_set_offset(9)usb4_switch_nvm_write(9)usb4_switch_nvm_authenticate(9)usb4_switch_nvm_authenticate_status(9)usb4_switch_credits_init(9)usb4_switch_query_dp_resource(9)usb4_switch_alloc_dp_resource(9)usb4_switch_dealloc_dp_resource(9)usb4_port_index(9)usb4_switch_map_pcie_down(9)usb4_switch_map_usb3_down(9)usb4_switch_add_ports(9)usb4_switch_remove_ports(9)usb4_port_unlock(9)usb4_port_hotplug_enable(9)usb4_port_reset(9)usb4_port_configure(9)usb4_port_unconfigure(9)usb4_port_configure_xdomain(9)usb4_port_unconfigure_xdomain(9)usb4_port_sb_read(9)usb4_port_sb_write(9)usb4_port_router_offline(9)usb4_port_router_online(9)usb4_port_enumerate_retimers(9)usb4_port_clx_supported(9)usb4_port_asym_supported(9)usb4_port_asym_set_link_width(9)usb4_port_asym_start(9)usb4_port_margining_caps(9)usb4_port_hw_margin(9)usb4_port_sw_margin(9)usb4_port_sw_margin_errors(9)usb4_port_retimer_set_inbound_sbtx(9)usb4_port_retimer_unset_inbound_sbtx(9)usb4_port_retimer_is_last(9)usb4_port_retimer_is_cable(9)usb4_port_retimer_nvm_sector_size(9)usb4_port_retimer_nvm_set_offset(9)usb4_port_retimer_nvm_write(9)usb4_port_retimer_nvm_authenticate(9)usb4_port_retimer_nvm_authenticate_status(9)usb4_port_retimer_nvm_read(9)usb4_usb3_port_max_link_rate(9)usb4_usb3_port_allocated_bandwidth(9)usb4_usb3_port_release_bandwidth(9)usb4_dp_port_set_cm_id(9)usb4_dp_port_bandwidth_mode_supported(9)usb4_dp_port_bandwidth_mode_enabled(9)usb4_dp_port_set_cm_bandwidth_mode_supported(9)usb4_dp_port_group_id(9)usb4_dp_port_set_group_id(9)usb4_dp_port_nrd(9)usb4_dp_port_set_nrd(9)usb4_dp_port_granularity(9)usb4_dp_port_set_granularity(9)usb4_dp_port_set_estimated_bandwidth(9)usb4_dp_port_allocated_bandwidth(9)usb4_dp_port_allocate_bandwidth(9)usb4_dp_port_requested_bandwidth(9)usb4_pci_port_set_ext_encapsulation(9)usb4_pci_port_ltssm_state(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms