Module Name: src Committed By: jdolecek Date: Sat Jul 4 14:49:24 UTC 2020
Modified Files: src/sys/dev/pci: ciss_pci.c uhci_pci.c Log Message: switch to pci_intr_alloc() so this uses MSI/MSI-X if device supports it To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ciss_pci.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/uhci_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ciss_pci.c diff -u src/sys/dev/pci/ciss_pci.c:1.15 src/sys/dev/pci/ciss_pci.c:1.16 --- src/sys/dev/pci/ciss_pci.c:1.15 Sun Dec 9 11:14:01 2018 +++ src/sys/dev/pci/ciss_pci.c Sat Jul 4 14:49:24 2020 @@ -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 @@ ciss_pci_attach(device_t parent, device_ 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 @@ ciss_pci_attach(device_t parent, device_ 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) Index: src/sys/dev/pci/uhci_pci.c diff -u src/sys/dev/pci/uhci_pci.c:1.63 src/sys/dev/pci/uhci_pci.c:1.64 --- src/sys/dev/pci/uhci_pci.c:1.63 Thu May 10 03:41:00 2018 +++ src/sys/dev/pci/uhci_pci.c Sat Jul 4 14:49:24 2020 @@ -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 @@ uhci_pci_attach(device_t parent, device_ 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 @@ uhci_pci_attach(device_t parent, device_ 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");