Skip to Content
FreeBSD Device Drivers
book

FreeBSD Device Drivers

by Joseph Kong
April 2012
Intermediate to advanced
352 pages
8h
English
No Starch Press
Content preview from FreeBSD Device Drivers

Implementing MSI

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.

Note

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 = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Embedded Linux

Embedded Linux

John Lombardo
Essential Linux Device Drivers

Essential Linux Device Drivers

Sreekrishnan Venkateswaran

Publisher Resources

ISBN: 9781457166716Errata