pci_walk_bridge(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pci_walk_bridge(9) πŸ’–

okay so this is a page straight out of the Kernel API Manual, and honestly? it's lowkey iconic. it's pci_walk_bridge, and bestie, it's about walking bridges that might be AER affected. no cap. let's get into it 🌸


✨ SYNOPSIS ✨

void pci_walk_bridge (struct pci_dev *bridge , int (*cb)(struct pci_dev
*, void *) , void *userdata );

like yes, that's the whole signature, and yes it's giving function-pointer-in-the-argument-list realness πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • bridge β€” the bridge in question 🫢 and heads up, this "bridge" might not be a bridge-bridge: it could be a Port, an RCEC, or an RCiEP. so like, keep that in mind.
  • cb β€” the callback πŸ¦‹ it gets called for each device found. it's your little function, your moment to shine.
  • userdata β€” an arbitrary pointer that gets passed straight to the callback. literally whatever you want, bestie, it's your vibe to define.

🌈 DESCRIPTION 🌈

so here's the tea β˜• if the device you hand over is a bridge, then we walk the subordinate bus, including any bridged devices on buses under this bus. and then β€” this is the important part β€” we call the provided callback on each device found ✨

but wait, there's a second scenario πŸ‘€ if the device you provided has no subordinate bus β€” e.g., an RCEC or an RCiEP β€” then we just call the callback on the device itself. simple as that. no walking required, we're staying home πŸ πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/pci/pcie/err.c β€” go read it, iykyk πŸ“–

and that's the page, bestie!! πŸ“ this beauty lives in ./drivers/pci/pcie, dated October 2026, and it's pci_walk_bridge(9) forever and always πŸ‘‘ periodt πŸ’…βœ¨

πŸ“¦ where this page comes from