msi_next_desc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ msi_next_desc ✨

Okay bestie, welcome to msi_next_desc(9) from the Kernel API Manual β€” literally the "gimme the next one" function for MSI descriptors, and she is very particular about how you call her. πŸŽ€


πŸ’œ NAME πŸ’œ

msi_next_desc β€” get the next MSI descriptor of a device. That's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

struct msi_desc * msi_next_desc (struct device *dev , unsigned int domid , enum msi_desc_filter filter );

πŸ‘‘ ARGUMENTS πŸ‘‘

  • dev β€” the device you're operating on. Your main character. πŸ’…
  • domid β€” the id of the interrupt domain that should be walked. Like, which neighborhood we're strolling through.
  • filter β€” the descriptor state filter. This is the vibe check: only descriptors matching your criteria get to come through. ✨

πŸ”₯ DESCRIPTION πŸ”₯

Okay so here's the tea, and you need to hear it. β˜•

The first time you call msi_next_desc, you must have already called __msi_first_desc successfully first β€” no cap. Like, you can't just show up to the function without an invitation. Consecutive invocations are only valid if the previous one was successful. So it's a chain: if a link breaks, the whole thing breaks, and that's on you. 😭

And the biggest rule of all: all of these operations have to be done within the same MSI mutex held region. Same region, bestie. Don't be out here unlocking mid-walk. That's giving undefined behavior energy and we do not stan. πŸ’€


🌈 RETURN 🌈

A pointer to the next MSI descriptor that matches the search criteria. 🫢 And if nothing matches? You get NULL. None found, no descriptor, go home. πŸ™ˆ


⭐ SEE ALSO ⭐

Kernel file ./kernel/irq/msi.c, plus this whole squad right here β€” she keeps good company:


Sources say this one lives in ./kernel/irq and got her glow-up in October 2026 β€” go off, queen. πŸ‘‘βœ¨ Slay, and remember: lock the mutex. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from