pci_enable_msi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pci_enable_msi(9) πŸ’…

okay so we're deep in the Kernel API Manual today bestie, and this one is literally the classic "enable MSI interrupts on your PCI device" situation ✨


🌸 NAME 🌸

pci_enable_msi β€” Enable MSI interrupt mode on device

Like, that's it. That's the whole job. It turns on MSI interrupt mode for a device. Slay πŸŽ€


✨ SYNOPSIS ✨

int pci_enable_msi (struct pci_dev *dev );

one function, one argument, one int coming back at you πŸ’–


🫢 ARGUMENTS 🫢

  • dev β€” the PCI device to operate on. just... the device. the one you want to mess with. no cap πŸ¦‹

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜• β€” this is the legacy device driver API for enabling MSI interrupts mode on a device and allocating a single interrupt vector. both things, one call. iconic behavior honestly.

on success, the allocated vector's Linux IRQ gets saved at dev->irq, so that's where you go look for it πŸ‘€

and listen β€” the driver must invoke pci_disable_msi on cleanup. that's not optional, that's a whole commitment. you enabled it, you clean it up. periodt πŸ’…


⚠️ NOTE ⚠️

bestie. hear me. the newer pci_alloc_irq_vectors / pci_free_irq_vectors API pair should, in general, be used instead. like β€” in general. we're just being honest with you here πŸ™ˆ

this is the legacy path! the docs themselves are telling you the newer pair is the move. no drama, just facts πŸ’œ

🌈 RETURN 🌈

  • 0 on success πŸŽ‰
  • errno otherwise 😭

πŸ’€ SEE ALSO πŸ’€

Kernel file ./drivers/pci/msi/api.c β€” and all the sibling functions, because family is everything 🫢


okay that's the whole page bestie, go enable those interrupts responsibly πŸ’–

signing off from ./drivers/pci/msi β€” October 2026 edition, pci_enable_msi(9), mwah πŸ‘‘βœ¨

πŸ“¦ where this page comes from