tb_tunnel_alloc_pci(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, meet tb_tunnel_alloc_pci(9) from the Kernel API Manual β€” the function that does exactly what it says on the tin: tb_tunnel_alloc_pci will allocate a pci tunnel. no cap, she’s the tunnel-booking bestie for PCI. πŸŽ€


✨ SYNOPSIS ✨

the signature is giving β€œI know my types,” and here it is verbatim so you can copy-paste like a main character:

struct tb_tunnel * tb_tunnel_alloc_pci (struct tb *tb , struct tb_port
       *up , struct tb_port *down );

🫢 ARGUMENTS 🫢

  • tb β€” pointer to the domain structure. literally the domain context, bestie.
  • up β€” PCIe upstream adapter port. the upward queen. 🌸
  • down β€” PCIe downstream adapter port. the downward queen. πŸ¦‹

🌸 DESCRIPTION 🌸

Allocate a PCI tunnel. The way this works is the ports have to be the right vibe: they must be of type TB_TYPE_PCIE_UP and TB_TYPE_PCIE_DOWN. that’s the requirement, iykyk. ✨

bestie, those port types are mandatory β€” don’t try to make fetch happen with other types. πŸ’…

πŸ’… RETURN πŸ’…

Pointer to struct tb_tunnel β€” or NULL on failure. so if it comes back NULL, that’s the fail-girl moment. 😭


🌈 SEE ALSO 🌈

Kernel file ./drivers/thunderbolt/tunnel.c is the home base. and here’s the whole friend group, in order:


signed off with a sparkle from the ./drivers/thunderbolt source/version corner, stamped October 2026, page tb_tunnel_alloc_pci(9) β€” mwah πŸ’‹πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from