STRUCT TB_XDOMAIN(9)
π struct tb_xdomain β Cross-domain (XDomain) connection π
okay so this is a page straight out of the Kernel API Manual, and it's all about struct tb_xdomain, bestie. it's giving "two hosts, one very cute connection" energy. let's get into it β¨
β¨ SYNOPSIS β¨
struct tb_xdomain {
struct device dev;
struct tb *tb;
uuid_t *remote_uuid;
const uuid_t *local_uuid;
u64 route;
u16 vendor;
u16 device;
unsigned int local_max_hopid;
unsigned int remote_max_hopid;
struct mutex lock;
const char *vendor_name;
const char *device_name;
unsigned int link_speed;
enum tb_link_width link_width;
bool link_usb4;
bool is_unplugged;
bool removing;
bool needs_uuid;
struct ida service_ids;
struct ida in_hopids;
struct ida out_hopids;
u32 *local_property_block;
u32 local_property_block_gen;
u32 local_property_block_len;
struct tb_property_dir *remote_properties;
u32 remote_property_block_gen;
int state;
struct delayed_work state_work;
int state_retries;
struct delayed_work properties_changed_work;
int properties_changed_retries;
bool bonding_possible;
u8 target_link_width;
atomic_t ntunnels;
u8 link;
u8 depth;
};
π«Ά MEMBERS π«Ά
like, every single field, no skips, fr fr π
devβ the XDomain device itself, main character energytbβ pointer to the domainremote_uuidβ the UUID of the remote domain (the host)local_uuidβ our own UUID, cached so we don't gotta go fetch it again πrouteβ the route string the other domain can be reached atvendorβ vendor ID of the remote domaindeviceβ device ID of the demote domainlocal_max_hopidβ maximum input HopID of this hostremote_max_hopidβ maximum input HopID of the remote hostlockβ the lock that serializes access to the following fields of this structure (yes bestie, the following ones β respect the lock or perish π)vendor_nameβ name of the vendor (orNULLif it's not known)device_nameβ name of the device (orNULLif it's not known)link_speedβ speed of the link, in Gb/slink_widthβ width of the downstream facing linklink_usb4β is the downstream link USB4? this flag says yes/no β¨is_unpluggedβ the XDomain is unplugged π«removingβ set bytb_xdomain_removeunder lock, so concurrent delayed work queueing can't sneak inneeds_uuidβ if the XDomain doesn't have aremote_uuid, it will be queried firstservice_idsβ used to generate IDs for the servicesin_hopidsβ input HopIDs for DMA tunnelingout_hopidsβ output HopIDs for DMA tunnelinglocal_property_blockβ local block of propertieslocal_property_block_genβ generation oflocal_property_blocklocal_property_block_lenβ length of thelocal_property_block, in dwordsremote_propertiesβ properties exported by the remote domainremote_property_block_genβ generation ofremote_propertiesstateβ next XDomain discovery state to runstate_workβ work used to run the next statestate_retriesβ number of retries remain for the stateproperties_changed_workβ work used to notify the remote domain that our properties have changedproperties_changed_retriesβ number of times left to send the properties changed notificationbonding_possibleβtrueif lane bonding is possible on the local sidetarget_link_widthβ target link width from the remote hostntunnelsβ keeps track of how many tunnels go through this XDomainlinkβ root switch link the remote domain is connected to (ICM only)depthβ depth in the chain the remote domain is connected at (ICM only)
πΈ DESCRIPTION πΈ
okay so real talk: this structure represents a connection across two domains (hosts). each XDomain contains zero or more services, and those services get exposed as struct tb_service objects. slay π
service drivers may access this structure if they need to enumerate non-standard properties β but they need to hold lock when doing so, because properties can be changed asynchronously in response to changes in the remote domain. no cap, do not skip the lock π
π¦ SEE ALSO π¦
go read these next, i'm obsessed with the whole crew π
Kernel file ./include/linux/thunderbolt.h, enum tb_security_level(9), struct tb(9), struct tb_property_dir(9), struct tb_property(9), enum tb_link_width(9), struct tb_protocol_handler(9), struct tb_service(9), struct tb_service_driver(9), struct tb_nhi(9), struct tb_ring(9), enum ring_desc_flags(9), struct ring_frame(9), tb_ring_rx(9), tb_ring_tx(9), tb_ring_dma_device(9)
and that's the whole page bb π it lives in ./include/linux, dated October 2026 β go forth and tunnel responsibly, ily ππ¦
π¦ 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