svn commit: r210900 - head/sys/mips/atheros

Oleksandr Tymoshenko gonzo at FreeBSD.org
Thu Aug 5 21:31:30 UTC 2010


Author: gonzo
Date: Thu Aug  5 21:31:29 2010
New Revision: 210900
URL: http://svn.freebsd.org/changeset/base/210900

Log:
  - Add interrupts counter for PCI devices

Modified:
  head/sys/mips/atheros/ar71xx_pci.c

Modified: head/sys/mips/atheros/ar71xx_pci.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_pci.c	Thu Aug  5 21:01:35 2010	(r210899)
+++ head/sys/mips/atheros/ar71xx_pci.c	Thu Aug  5 21:31:29 2010	(r210900)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 
 #include <machine/bus.h>
 #include <machine/cpu.h>
+#include <machine/intr_machdep.h>
 #include <machine/pmap.h>
 
 #include <dev/pci/pcivar.h>
@@ -70,6 +71,7 @@ struct ar71xx_pci_softc {
 	struct rman		sc_irq_rman;
 
 	struct intr_event	*sc_eventstab[AR71XX_PCI_NIRQS];	
+	mips_intrcnt_t		sc_intr_counter[AR71XX_PCI_NIRQS];	
 	struct resource		*sc_irq;
 	void			*sc_ih;
 };
@@ -436,13 +438,20 @@ ar71xx_pci_setup_intr(device_t bus, devi
 	if (event == NULL) {
 		error = intr_event_create(&event, (void *)irq, 0, irq, 
 		    ar71xx_pci_mask_irq, ar71xx_pci_unmask_irq, NULL, NULL,
-		    "ar71xx_pci intr%d:", irq);
+		    "pci intr%d:", irq);
 
-		sc->sc_eventstab[irq] = event;
+		if (error == 0) {
+			sc->sc_eventstab[irq] = event;
+			sc->sc_intr_counter[irq] =
+			    mips_intrcnt_create(event->ie_name);
+		}
+		else
+			return error;
 	}
 
 	intr_event_add_handler(event, device_get_nameunit(child), filt,
 	    handler, arg, intr_priority(flags), flags, cookiep);
+	mips_intrcnt_setname(sc->sc_intr_counter[irq], event->ie_fullname);
 
 	ar71xx_pci_unmask_irq((void*)irq);
 
@@ -497,6 +506,7 @@ ar71xx_pci_intr(void *arg)
 
 			/* TODO: frame instead of NULL? */
 			intr_event_handle(event, NULL);
+			mips_intrcnt_inc(sc->sc_intr_counter[irq]);
 		}
 	}
 


More information about the svn-src-all mailing list