MSI Management Routines

The FreeBSD kernel provides the following functions for working with MSI:

#include <dev/pci/pcivar.h>

int
pci_msix_count(device_t dev);

int
pci_msi_count(device_t dev);

int
pci_alloc_msix(device_t dev, int *count);

int
pci_alloc_msi(device_t dev, int *count);

int
pci_release_msi(device_t dev);

The pci_msix_count and pci_msi_count functions return the number of unique MSI-X or MSI messages maintained by the device dev.

The pci_alloc_msix and pci_alloc_msi functions allocate count MSI-X or MSI vectors based on dev. If there are not enough free vectors, fewer than count vectors will be allocated. Upon a successful return, count will contain the number of vectors allocated. (MSI-X and MSI vectors were described in Implementing ...

Get FreeBSD Device Drivers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.