usb4_switch_drom_read(9)
π usb4_switch_drom_read β a kernel API manual, but make it cute
okay so this is usb4_switch_drom_read(9) from the Kernel API Manual, and honestly? she's a little icon. let's get into it π
β¨ NAME β¨
usb4_switch_drom_read β read arbitrary bytes from a USB4 router DROM. that's it. that's the whole job. and she does it beautifully π¦
πΈ SYNOPSIS πΈ
int usb4_switch_drom_read (struct tb_switch *sw , unsigned int address ,
void *buf , size_t size );
literally just hand her a router, an address, a buffer and a size and she'll go get your bytes bestie π
π ARGUMENTS π
swβ the USB4 router. your main character, the device you're reading from πaddressβ byte address inside the DROM where the reading starts. like a little bookmark, but for bytes πbufβ the buffer where the DROM content ends up getting stored. she fills it. that's the vibe π«Άsizeβ how many bytes to read from the DROM. be precise, be slay β¨
π DESCRIPTION π
so the way this works: it uses USB4 router operations to read the router DROM. no cap, that's the mechanism π§
for devices this should always work. always always. but for hosts? ok don't panic β it may return -EOPNOTSUPP, and in that case it's because the host router simply does not have a DROM. not a bug, not a her-problem, it's giving "nothing to read here" energy π
heads up bestie: that -EOPNOTSUPP is a real possibility on hosts, so check your return value like the responsible little kernel dev you are π
β RETURN β
0on success β ate, no notes π―- negative errno otherwise β she's telling you something went sideways, listen to her π
π SEE ALSO π
the kernel file lives at ./drivers/thunderbolt/usb4.c β go say hi π
and here is the entire friend group, all of them, nobody left behind (fr fr this is the whole list):
usb4_switch_check_wakes(9)usb4_switch_setup(9)usb4_switch_configuration_valid(9)usb4_switch_read_uid(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_allocate_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)
and that's the whole page, bestie π«Ά this lil manual lives over in ./drivers/thunderbolt and it's dated October 2026 β go read some DROM bytes, you've got this πβ¨π
π¦ 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