April 2012
Intermediate to advanced
352 pages
8h
English
Unlike with previous topics, I’m going to take a holistic approach here. Namely, I’m going to show an example first, and then I’ll describe the MSI family of functions.
The following function, named ciss_setup_msix and defined in /sys/dev/ciss/ciss.c, sets up MSI for the ciss(4) driver.
This function was chosen solely because it’s simple. The fact that it’s from ciss(4) is irrelevant.
static int
ciss_setup_msix(struct ciss_softc *sc)
{
int i, count, error;
i = ciss_lookup(sc->ciss_dev);
if (ciss_vendor_data[i].flags & CISS_BOARD_NOMSI)
return (EINVAL);
count = pci_msix_count(sc->ciss_dev); if (count < CISS_MSI_COUNT) { count = ...