STRUCT TB_NHI(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ NAME πŸ’œ

okay so bestie, struct tb_nhi is the thunderbolt native host interface, and this whole page is the struct tb_nhi(9) manual page from the kernel API manual. no cap, it's lowkey iconic. ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct tb_nhi {
    spinlock_t lock;
    struct device *dev;
    const struct tb_nhi_ops *ops;
    void __iomem *iobase;
    struct tb_ring **tx_rings;
    struct tb_ring **rx_rings;
    bool going_away;
    bool iommu_dma_protection;
    struct work_struct interrupt_work;
    u32 hop_count;
    unsigned long quirks;
    struct completion domain_released;
    bool host_reset;
 };

🌸 Members 🌸

  • lock β€” bestie, this spinlock must be held during ring creation/destruction. it is also acquired by interrupt_work when dispatching interrupts to the individual rings. fr fr, it's the vibe-check bouncer for ring lifecycle. πŸ’…
  • dev β€” the device associated with this NHI instance. it's giving main character energy for this little NHI world. 🫢
  • ops β€” NHI specific optional ops. optional? okay lowkey flexible, we love that. ✨
  • iobase β€” MMIO space of the NHI. that's the literal hardware hangout spot. πŸŽ€
  • tx_rings β€” all Tx rings available on this host controller. slay, transmit side is booked and busy. πŸ”₯
  • rx_rings β€” all Rx rings available on this host controller. receive side is also thriving, periodt. 🌈
  • going_away β€” the host controller device is about to disappear 😭 so when this flag is set, avoid touching the hardware anymore. like, do not poke the hardware when it's already leaving the group chat. πŸ’€
  • iommu_dma_protection β€” an IOMMU will isolate external-facing ports. protective queen behavior, honestly. πŸ›‘οΈβœ¨
  • interrupt_work β€” work scheduled to handle ring interrupt when no MSI-X is used. it's the backup plan doing its little work moment. πŸ’…
  • hop_count β€” number of rings (end point hops) supported by NHI. literally the ring headcount, iykyk. πŸŽ€
  • quirks β€” NHI specific quirks if any. every family has its little quirks, no cap. πŸ™ˆ
  • domain_released β€” completed when domain has been fully released. the "we're so done here" completion, iconic. πŸ¦‹
  • host_reset β€” Host router was reset on driver load, or forced on system shutdown/reboot. When set, tb_stop asserts DPR on connected downstream ports to signal disconnect before tearing down the router tree. Only Thunderbolt 3 devices are reset; USB4 routers are skipped. that's the whole rule, bestie, don't skip it. πŸ‘‘

🌈 SEE ALSO 🌈

Kernel file ./include/linux/thunderbolt.h and the whole squad:

  • enum tb_security_level(9)
  • struct tb(9)
  • struct tb_property_dir(9)
  • struct tb_property(9)
  • enum tb_link_width(9)
  • struct tb_xdomain(9)
  • struct tb_protocol_handler(9)
  • struct tb_service(9)
  • struct tb_service_driver(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)

source/version: ./include/linux Β· date: October 2026 Β· manual page: struct tb_nhi(9) πŸŒΈπŸ«ΆπŸ’–

πŸ“¦ where this page comes from