Module Name:    src
Committed By:   snj
Date:           Thu Sep 29 14:41:43 UTC 2022

Modified Files:
        src/sys/dev/pci [netbsd-8]: mfii.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1768):
        sys/dev/pci/mfii.c: 1.28
Convert from pci_intr_map() to pci_intr_alloc(); makes the driver use
MSI/MSI-x when available. Tested by Edgar Fu?.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.6 -r1.3.2.7 src/sys/dev/pci/mfii.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/mfii.c
diff -u src/sys/dev/pci/mfii.c:1.3.2.6 src/sys/dev/pci/mfii.c:1.3.2.7
--- src/sys/dev/pci/mfii.c:1.3.2.6	Fri Sep 16 18:30:15 2022
+++ src/sys/dev/pci/mfii.c	Thu Sep 29 14:41:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfii.c,v 1.3.2.6 2022/09/16 18:30:15 martin Exp $ */
+/* $NetBSD: mfii.c,v 1.3.2.7 2022/09/29 14:41:43 snj Exp $ */
 /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.3.2.6 2022/09/16 18:30:15 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.3.2.7 2022/09/29 14:41:43 snj Exp $");
 
 #include "bio.h"
 
@@ -654,7 +654,7 @@ mfii_attach(device_t parent, device_t se
 	struct mfii_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
 	pcireg_t memtype;
-	pci_intr_handle_t ih;
+	pci_intr_handle_t *ihp;
 	char intrbuf[PCI_INTRSTR_LEN];
 	const char *intrstr;
 	u_int32_t status, scpad2, scpad3;
@@ -704,12 +704,12 @@ mfii_attach(device_t parent, device_t se
 	/* disable interrupts */
 	mfii_write(sc, MFI_OMSK, 0xffffffff);
 
-	if (pci_intr_map(pa, &ih) != 0) {
+	if (pci_intr_alloc(pa, &ihp, NULL, 0)) {
 		aprint_error(": unable to map interrupt\n");
 		goto pci_unmap;
 	}
-	intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
-	pci_intr_setattr(pa->pa_pc, &ih, PCI_INTR_MPSAFE, true);
+	intrstr = pci_intr_string(pa->pa_pc, ihp[0], intrbuf, sizeof(intrbuf));
+	pci_intr_setattr(pa->pa_pc, &ihp[0], PCI_INTR_MPSAFE, true);
 
 	/* lets get started */
 	if (mfii_transition_firmware(sc))
@@ -818,7 +818,7 @@ mfii_attach(device_t parent, device_t se
 	aprint_normal("\n");
 	aprint_naive("\n");
 
-	sc->sc_ih = pci_intr_establish_xname(sc->sc_pc, ih, IPL_BIO,
+	sc->sc_ih = pci_intr_establish_xname(sc->sc_pc, ihp[0], IPL_BIO,
 	    mfii_intr, sc, DEVNAME(sc));
 	if (sc->sc_ih == NULL) {
 		aprint_error_dev(self, "can't establish interrupt");

Reply via email to