STRUCT TB_PORT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to struct tb_port(9) from the Kernel API Manual β€” this is literally a thunderbolt port, and it’s part of a tb_switch. iconic little kernel struct behavior, no cap. πŸ’…


✨ SYNOPSIS ✨

struct tb_port {
    struct tb_regs_port_header config;
    struct tb_switch *sw;
    struct tb_port *remote;
    struct tb_xdomain *xdomain;
    int cap_phy;
    int cap_tmu;
    int cap_adap;
    int cap_usb4;
    struct usb4_port *usb4;
    u8 port;
    bool disabled;
    bool bonded;
    struct tb_port *dual_link_port;
    u8 link_nr:1;
    struct ida in_hopids;
    struct ida out_hopids;
    struct list_head list;
    unsigned int total_credits;
    unsigned int ctl_credits;
    unsigned int dma_credits;
    struct tb_bandwidth_group *group;
    struct list_head group_list;
    unsigned int max_bw;
    bool redrive;
};

πŸ‘‘ Members πŸ‘‘

  • config β€” cached port configuration read from registers. πŸ’–
  • sw β€” the switch this port belongs to.
  • remote β€” the remote port, or NULL if it’s not connected.
  • xdomain β€” the remote host, or NULL if it’s not connected.
  • cap_phy β€” offset, zero if not found.
  • cap_tmu β€” offset of the adapter-specific TMU capability, or 0 if not present.
  • cap_adap β€” offset of the adapter-specific capability, or 0 if not present.
  • cap_usb4 β€” offset to the USB4 port capability, or 0 if not present.
  • usb4 β€” pointer to the USB4 port structure, only if cap_usb4 is != 0.
  • port β€” port number on the switch.
  • disabled β€” disabled by eeprom, or enabled but not implemented.
  • bonded β€” true if the port is bonded (two lanes combined as one).
  • dual_link_port β€” if the switch is connected using two ports, this points to the other port.
  • link_nr β€” is this the primary or secondary port on the dual_link.
  • in_hopids β€” currently allocated input HopIDs.
  • out_hopids β€” currently allocated output HopIDs.
  • list β€” used to link ports to the DP resources list.
  • total_credits β€” total number of buffers available for this port.
  • ctl_credits β€” buffers reserved for the control path.
  • dma_credits β€” number of credits allocated for DMA tunneling for all DMA paths through this port.
  • group β€” bandwidth allocation group the adapter is assigned to. only used for DP IN adapters for now.
  • group_list β€” the adapter is linked to the group’s list of ports through this.
  • max_bw β€” maximum possible bandwidth through this adapter if set to non-zero.
  • redrive β€” for DP IN, if true the adapter is in redrive mode.

🧚 Description 🧚

In USB4 terminology, this structure represents an adapter β€” protocol or lane adapter. periodt. πŸ¦‹


πŸ’œ SEE ALSO πŸ’œ

mwah πŸ’… β€” source ./drivers/thunderbolt, October 2026.

πŸ“¦ where this page comes from