Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci switch to pci_intr_alloc() so this uses MSI/MSI-...



details:   https://anonhg.NetBSD.org/src/rev/15c3e780c1ef
branches:  trunk
changeset: 973572:15c3e780c1ef
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Jul 04 14:49:24 2020 +0000

description:
switch to pci_intr_alloc() so this uses MSI/MSI-X if device supports it

diffstat:

 sys/dev/pci/ciss_pci.c |  14 +++++++-------
 sys/dev/pci/uhci_pci.c |  12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)

diffs (91 lines):

diff -r 2544ea7253a9 -r 15c3e780c1ef sys/dev/pci/ciss_pci.c
--- a/sys/dev/pci/ciss_pci.c    Sat Jul 04 12:04:15 2020 +0000
+++ b/sys/dev/pci/ciss_pci.c    Sat Jul 04 14:49:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss_pci.c,v 1.15 2018/12/09 11:14:01 jdolecek Exp $   */
+/*     $NetBSD: ciss_pci.c,v 1.16 2020/07/04 14:49:24 jdolecek Exp $   */
 /*     $OpenBSD: ciss_pci.c,v 1.9 2005/12/13 15:56:01 brad Exp $       */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.15 2018/12/09 11:14:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.16 2020/07/04 14:49:24 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -263,7 +263,7 @@
        struct ciss_softc *sc = device_private(self);
        struct pci_attach_args *pa = aux;
        bus_size_t size, cfgsz;
-       pci_intr_handle_t ih;
+       pci_intr_handle_t *ih;
        const char *intrstr;
        int cfg_bar, memtype;
        pcireg_t reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
@@ -339,16 +339,16 @@
            bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) | sc->iem);
 #endif
 
-       if (pci_intr_map(pa, &ih)) {
+       if (pci_intr_alloc(pa, &ih, NULL, 0) != 0) {
                aprint_error_dev(self, "can't map interrupt\n");
                bus_space_unmap(sc->sc_iot, sc->sc_ioh, size);
                if (cfg_bar != CISS_BAR)
                        bus_space_unmap(sc->sc_iot, sc->cfg_ioh, cfgsz);
                return;
        }
-       intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
-       sc->sc_ih = pci_intr_establish_xname(pa->pa_pc, ih, IPL_BIO, ciss_intr,
-           sc, device_xname(self));
+       intrstr = pci_intr_string(pa->pa_pc, ih[0], intrbuf, sizeof(intrbuf));
+       sc->sc_ih = pci_intr_establish_xname(pa->pa_pc, ih[0], IPL_BIO,
+           ciss_intr, sc, device_xname(self));
        if (!sc->sc_ih) {
                aprint_error_dev(sc->sc_dev, "can't establish interrupt");
                if (intrstr)
diff -r 2544ea7253a9 -r 15c3e780c1ef sys/dev/pci/uhci_pci.c
--- a/sys/dev/pci/uhci_pci.c    Sat Jul 04 12:04:15 2020 +0000
+++ b/sys/dev/pci/uhci_pci.c    Sat Jul 04 14:49:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci_pci.c,v 1.63 2018/05/10 03:41:00 msaitoh Exp $    */
+/*     $NetBSD: uhci_pci.c,v 1.64 2020/07/04 14:49:24 jdolecek Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.63 2018/05/10 03:41:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.64 2020/07/04 14:49:24 jdolecek Exp $");
 
 #include "ehci.h"
 
@@ -91,7 +91,7 @@
        pci_chipset_tag_t pc = pa->pa_pc;
        pcitag_t tag = pa->pa_tag;
        char const *intrstr;
-       pci_intr_handle_t ih;
+       pci_intr_handle_t *ih;
        pcireg_t csr;
        int s;
        char intrbuf[PCI_INTRSTR_LEN];
@@ -126,12 +126,12 @@
                       csr | PCI_COMMAND_MASTER_ENABLE);
 
        /* Map and establish the interrupt. */
-       if (pci_intr_map(pa, &ih)) {
+       if (pci_intr_alloc(pa, &ih, NULL, 0) != 0) {
                aprint_error_dev(self, "couldn't map interrupt\n");
                return;
        }
-       intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
-       sc->sc_ih = pci_intr_establish_xname(pc, ih, IPL_USB, uhci_intr, sc,
+       intrstr = pci_intr_string(pc, ih[0], intrbuf, sizeof(intrbuf));
+       sc->sc_ih = pci_intr_establish_xname(pc, ih[0], IPL_USB, uhci_intr, sc,
            device_xname(self));
        if (sc->sc_ih == NULL) {
                aprint_error_dev(self, "couldn't establish interrupt");



Home | Main Index | Thread Index | Old Index