Module Name: src Committed By: jmcneill Date: Sun Oct 21 00:51:12 UTC 2018
Modified Files: src/sys/dev/pci: if_msk.c if_mskvar.h Log Message: Enable MSI support where available. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/if_msk.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_mskvar.h 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/if_msk.c diff -u src/sys/dev/pci/if_msk.c:1.78 src/sys/dev/pci/if_msk.c:1.79 --- src/sys/dev/pci/if_msk.c:1.78 Fri Sep 14 18:46:47 2018 +++ src/sys/dev/pci/if_msk.c Sun Oct 21 00:51:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_msk.c,v 1.78 2018/09/14 18:46:47 jakllsch Exp $ */ +/* $NetBSD: if_msk.c,v 1.79 2018/10/21 00:51:12 jmcneill Exp $ */ /* $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $ */ /* @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.78 2018/09/14 18:46:47 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.79 2018/10/21 00:51:12 jmcneill Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1359,7 +1359,6 @@ mskc_attach(device_t parent, device_t se struct skc_attach_args skca; pci_chipset_tag_t pc = pa->pa_pc; pcireg_t command, memtype; - pci_intr_handle_t ih; const char *intrstr = NULL; int rc, sk_nodenum; u_int8_t hw, pmd; @@ -1431,13 +1430,13 @@ mskc_attach(device_t parent, device_t se DPRINTFN(2, ("mskc_attach: allocate interrupt\n")); /* Allocate interrupt */ - if (pci_intr_map(pa, &ih)) { + if (pci_intr_alloc(pa, &sc->sk_pihp, NULL, 0)) { aprint_error(": couldn't map interrupt\n"); goto fail_1; } - intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf)); - sc->sk_intrhand = pci_intr_establish_xname(pc, ih, IPL_NET, msk_intr, + intrstr = pci_intr_string(pc, sc->sk_pihp[0], intrbuf, sizeof(intrbuf)); + sc->sk_intrhand = pci_intr_establish_xname(pc, sc->sk_pihp[0], IPL_NET, msk_intr, sc, device_xname(sc->sk_dev)); if (sc->sk_intrhand == NULL) { aprint_error(": couldn't establish interrupt"); @@ -1745,6 +1744,11 @@ mskc_detach(device_t self, int flags) sc->sk_intrhand = NULL; } + if (sc->sk_pihp != NULL) { + pci_intr_release(sc->sk_pc, sc->sk_pihp, 1); + sc->sk_pihp = NULL; + } + rv = config_detach_children(self, flags); if (rv != 0) return (rv); Index: src/sys/dev/pci/if_mskvar.h diff -u src/sys/dev/pci/if_mskvar.h:1.19 src/sys/dev/pci/if_mskvar.h:1.20 --- src/sys/dev/pci/if_mskvar.h:1.19 Fri Sep 14 18:46:47 2018 +++ src/sys/dev/pci/if_mskvar.h Sun Oct 21 00:51:12 2018 @@ -1,5 +1,5 @@ /* $OpenBSD: if_mskvar.h,v 1.3 2006/12/28 16:34:42 kettenis Exp $ */ -/* $NetBSD: if_mskvar.h,v 1.19 2018/09/14 18:46:47 jakllsch Exp $ */ +/* $NetBSD: if_mskvar.h,v 1.20 2018/10/21 00:51:12 jmcneill Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -193,6 +193,7 @@ struct sk_softc { bus_space_tag_t sk_btag; /* bus space tag */ bus_size_t sk_bsize; /* bus space size */ void *sk_intrhand; /* irq handler handle */ + pci_intr_handle_t *sk_pihp; pci_chipset_tag_t sk_pc; u_int8_t sk_fibertype; u_int8_t sk_type;