Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci provide intr xname



details:   https://anonhg.NetBSD.org/src/rev/9e64c88a8fc8
branches:  trunk
changeset: 818434:9e64c88a8fc8
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Oct 13 20:05:06 2016 +0000

description:
provide intr xname

diffstat:

 sys/dev/pci/ehci_pci.c    |   7 ++++---
 sys/dev/pci/ichsmb.c      |   8 ++++----
 sys/dev/pci/ixgbe/ixgbe.c |  25 ++++++++++++++++---------
 sys/dev/pci/xhci_pci.c    |   8 ++++----
 4 files changed, 28 insertions(+), 20 deletions(-)

diffs (170 lines):

diff -r f3ef94ea9bea -r 9e64c88a8fc8 sys/dev/pci/ehci_pci.c
--- a/sys/dev/pci/ehci_pci.c    Thu Oct 13 19:10:23 2016 +0000
+++ b/sys/dev/pci/ehci_pci.c    Thu Oct 13 20:05:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci_pci.c,v 1.63 2016/04/23 10:15:31 skrll Exp $      */
+/*     $NetBSD: ehci_pci.c,v 1.64 2016/10/13 20:05:06 jdolecek Exp $   */
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.63 2016/04/23 10:15:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.64 2016/10/13 20:05:06 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -176,7 +176,8 @@
         * Allocate IRQ
         */
        intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
-       sc->sc_ih = pci_intr_establish(pc, ih, IPL_USB, ehci_intr, sc);
+       sc->sc_ih = pci_intr_establish_xname(pc, ih, IPL_USB, ehci_intr, sc,
+           device_xname(self));
        if (sc->sc_ih == NULL) {
                aprint_error_dev(self, "couldn't establish interrupt");
                if (intrstr != NULL)
diff -r f3ef94ea9bea -r 9e64c88a8fc8 sys/dev/pci/ichsmb.c
--- a/sys/dev/pci/ichsmb.c      Thu Oct 13 19:10:23 2016 +0000
+++ b/sys/dev/pci/ichsmb.c      Thu Oct 13 20:05:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ichsmb.c,v 1.46 2016/07/07 06:55:41 msaitoh Exp $      */
+/*     $NetBSD: ichsmb.c,v 1.47 2016/10/13 20:05:06 jdolecek Exp $     */
 /*     $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.46 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.47 2016/10/13 20:05:06 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -175,8 +175,8 @@
                if (pci_intr_map(pa, &ih) == 0) {
                        intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf,
                            sizeof(intrbuf));
-                       sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO,
-                           ichsmb_intr, sc);
+                       sc->sc_ih = pci_intr_establish_xname(pa->pa_pc, ih,
+                           IPL_BIO, ichsmb_intr, sc, device_xname(sc->sc_dev));
                        if (sc->sc_ih != NULL) {
                                aprint_normal_dev(self, "interrupting at %s\n",
                                    intrstr);
diff -r f3ef94ea9bea -r 9e64c88a8fc8 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Thu Oct 13 19:10:23 2016 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Thu Oct 13 20:05:06 2016 +0000
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
-/*$NetBSD: ixgbe.c,v 1.39 2016/07/11 06:14:51 knakahara Exp $*/
+/*$NetBSD: ixgbe.c,v 1.40 2016/10/13 20:05:06 jdolecek Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -2516,8 +2516,8 @@
                intrstr = pci_intr_string(adapter->osdep.pc, ih, intrbuf,
                    sizeof(intrbuf));
        }
-       adapter->osdep.ihs[0] = pci_intr_establish(adapter->osdep.pc, ih,
-           IPL_NET, ixgbe_legacy_irq, que);
+       adapter->osdep.ihs[0] = pci_intr_establish_xname(adapter->osdep.pc, ih,
+           IPL_NET, ixgbe_legacy_irq, que, device_xname(dev));
 #else
        /* Allocation settings */
        max_type = PCI_INTR_TYPE_MSI;
@@ -2533,8 +2533,9 @@
        adapter->osdep.nintrs = 1;
        intrstr = pci_intr_string(adapter->osdep.pc, adapter->osdep.intrs[0],
            intrbuf, sizeof(intrbuf));
-       adapter->osdep.ihs[0] = pci_intr_establish(adapter->osdep.pc,
-           adapter->osdep.intrs[0], IPL_NET, ixgbe_legacy_irq, que);
+       adapter->osdep.ihs[0] = pci_intr_establish_xname(adapter->osdep.pc,
+           adapter->osdep.intrs[0], IPL_NET, ixgbe_legacy_irq, que,
+           device_xname(dev));
        if (adapter->osdep.ihs[0] == NULL) {
                intr_type = pci_intr_type(adapter->osdep.pc,
                    adapter->osdep.intrs[0]);
@@ -2621,6 +2622,7 @@
        struct          tx_ring *txr = adapter->tx_rings;
        pci_chipset_tag_t pc;
        char            intrbuf[PCI_INTRSTR_LEN];
+       char            intr_xname[32];
        const char      *intrstr = NULL;
        int             error, vector = 0;
        int             cpu_id = 0;
@@ -2660,6 +2662,8 @@
 
        kcpuset_create(&affinity, false);
        for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) {
+               snprintf(intr_xname, sizeof(intr_xname), "%s TX/RX",
+                   device_xname(dev));
                intrstr = pci_intr_string(pc, adapter->osdep.intrs[i], intrbuf,
                    sizeof(intrbuf));
 #ifdef IXG_MPSAFE
@@ -2667,8 +2671,9 @@
                    true);
 #endif
                /* Set the handler function */
-               que->res = adapter->osdep.ihs[i] = pci_intr_establish(pc,
-                   adapter->osdep.intrs[i], IPL_NET, ixgbe_msix_que, que);
+               que->res = adapter->osdep.ihs[i] = pci_intr_establish_xname(pc,
+                   adapter->osdep.intrs[i], IPL_NET, ixgbe_msix_que, que,
+                   intr_xname);
                if (que->res == NULL) {
                        pci_intr_release(pc, adapter->osdep.intrs,
                            adapter->osdep.nintrs);
@@ -2729,6 +2734,7 @@
 
        /* and Link */
        cpu_id++;
+       snprintf(intr_xname, sizeof(intr_xname), "%s link", device_xname(dev));
        intrstr = pci_intr_string(pc, adapter->osdep.intrs[vector], intrbuf,
            sizeof(intrbuf));
 #ifdef IXG_MPSAFE
@@ -2736,8 +2742,9 @@
            true);
 #endif
        /* Set the link handler function */
-       adapter->osdep.ihs[vector] = pci_intr_establish(pc,
-           adapter->osdep.intrs[vector], IPL_NET, ixgbe_msix_link, adapter);
+       adapter->osdep.ihs[vector] = pci_intr_establish_xname(pc,
+           adapter->osdep.intrs[vector], IPL_NET, ixgbe_msix_link, adapter,
+           intr_xname);
        if (adapter->osdep.ihs[vector] == NULL) {
                adapter->res = NULL;
                aprint_error_dev(dev, "Failed to register LINK handler\n");
diff -r f3ef94ea9bea -r 9e64c88a8fc8 sys/dev/pci/xhci_pci.c
--- a/sys/dev/pci/xhci_pci.c    Thu Oct 13 19:10:23 2016 +0000
+++ b/sys/dev/pci/xhci_pci.c    Thu Oct 13 20:05:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci_pci.c,v 1.6 2016/05/03 13:14:44 skrll Exp $       */
+/*     $NetBSD: xhci_pci.c,v 1.7 2016/10/13 20:05:06 jdolecek Exp $    */
 /*     OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.6 2016/05/03 13:14:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.7 2016/10/13 20:05:06 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -181,8 +181,8 @@
        }
        intrstr = pci_intr_string(pc, psc->sc_pihp[0], intrbuf,
            sizeof(intrbuf));
-       psc->sc_ih = pci_intr_establish(pc, psc->sc_pihp[0], IPL_USB,
-           xhci_intr, sc);
+       psc->sc_ih = pci_intr_establish_xname(pc, psc->sc_pihp[0], IPL_USB,
+           xhci_intr, sc, device_xname(sc->sc_dev));
        if (psc->sc_ih == NULL) {
                aprint_error_dev(self, "couldn't establish interrupt");
                if (intrstr != NULL)



Home | Main Index | Thread Index | Old Index