diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-10-12 16:35:53 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-10-12 16:35:53 +0000 |
commit | ceb8e7fc2476b3fef728bffeacd7694ec28ce742 (patch) | |
tree | be64faa6d099220b50b47cfe27a9ee27abfd4c84 /sys | |
parent | 9c7b7f1d9fe940ad2f99599f6bc1f660651a587d (diff) |
Add a symbolic name parameter to cardbus_intr_establish().
Count cardbus devices interrupts in cbb(4) using evcount(9).
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 9 | ||||
-rw-r--r-- | sys/dev/cardbus/cardbusvar.h | 6 | ||||
-rw-r--r-- | sys/dev/cardbus/com_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/ehci_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_acx_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_ath_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_atw_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_dc_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_fxp_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_pgt_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_ral_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_re_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_rl_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_rtw_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/if_xl_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/ohci_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/puc_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/uhci_cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/pccbb.c | 28 | ||||
-rw-r--r-- | sys/dev/pci/pccbbvar.h | 3 |
20 files changed, 61 insertions, 49 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index c98e8c58da7..6872db34054 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus.c,v 1.33 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: cardbus.c,v 1.34 2006/10/12 16:35:51 grange Exp $ */ /* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -650,7 +650,7 @@ cardbus_detach_card(struct cardbus_softc *sc) } /* - * void *cardbus_intr_establish(cc, cf, irq, level, func, arg) + * void *cardbus_intr_establish(cc, cf, irq, level, func, arg, name) * Interrupt handler of pccard. * args: * cardbus_chipset_tag_t *cc @@ -658,11 +658,12 @@ cardbus_detach_card(struct cardbus_softc *sc) */ void * cardbus_intr_establish(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf, - cardbus_intr_handle_t irq, int level, int (*func)(void *), void *arg) + cardbus_intr_handle_t irq, int level, int (*func)(void *), void *arg, + const char *name) { DPRINTF(("- cardbus_intr_establish: irq %d\n", irq)); - return (*cf->cardbus_intr_establish)(cc, irq, level, func, arg); + return (*cf->cardbus_intr_establish)(cc, irq, level, func, arg, name); } /* diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h index b13673a24a3..e8f706d3d5a 100644 --- a/sys/dev/cardbus/cardbusvar.h +++ b/sys/dev/cardbus/cardbusvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbusvar.h,v 1.11 2006/07/31 11:06:27 mickey Exp $ */ +/* $OpenBSD: cardbusvar.h,v 1.12 2006/10/12 16:35:51 grange Exp $ */ /* $NetBSD: cardbusvar.h,v 1.17 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -182,7 +182,7 @@ typedef struct cardbus_functions { int (*cardbus_space_free)(cardbus_chipset_tag_t, rbus_tag_t, bus_space_handle_t, bus_size_t); void *(*cardbus_intr_establish)(cardbus_chipset_tag_t, int, int, - int (*)(void *), void *); + int (*)(void *), void *, const char *); void (*cardbus_intr_disestablish)(cardbus_chipset_tag_t, void *); int (*cardbus_ctrl)(cardbus_chipset_tag_t, int); int (*cardbus_power)(cardbus_chipset_tag_t, int); @@ -384,7 +384,7 @@ int cardbus_attach_card(struct cardbus_softc *); void cardbus_detach_card(struct cardbus_softc *); void *cardbus_intr_establish(cardbus_chipset_tag_t, cardbus_function_tag_t, cardbus_intr_handle_t irq, int level, int (*func) (void *), - void *arg); + void *arg, const char *); void cardbus_intr_disestablish(cardbus_chipset_tag_t, cardbus_function_tag_t, void *handler); diff --git a/sys/dev/cardbus/com_cardbus.c b/sys/dev/cardbus/com_cardbus.c index d3bae2a6ff0..813fa2c681e 100644 --- a/sys/dev/cardbus/com_cardbus.c +++ b/sys/dev/cardbus/com_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_cardbus.c,v 1.25 2006/06/02 20:11:48 fkr Exp $ */ +/* $OpenBSD: com_cardbus.c,v 1.26 2006/10/12 16:35:51 grange Exp $ */ /* $NetBSD: com_cardbus.c,v 1.4 2000/04/17 09:21:59 joda Exp $ */ /* @@ -347,7 +347,7 @@ com_cardbus_enable(struct com_softc *sc) /* establish the interrupt. */ csc->cc_ih = cardbus_intr_establish(cc, cf, psc->sc_intrline, - IPL_TTY, comintr, sc); + IPL_TTY, comintr, sc, DEVNAME(csc)); if (csc->cc_ih == NULL) { printf("%s: couldn't establish interrupt\n", DEVNAME(csc)); return (1); diff --git a/sys/dev/cardbus/ehci_cardbus.c b/sys/dev/cardbus/ehci_cardbus.c index d2454e90fa9..c822a29397c 100644 --- a/sys/dev/cardbus/ehci_cardbus.c +++ b/sys/dev/cardbus/ehci_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci_cardbus.c,v 1.7 2006/07/12 06:26:34 jolan Exp $ */ +/* $OpenBSD: ehci_cardbus.c,v 1.8 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: ehci_cardbus.c,v 1.6.6.3 2004/09/21 13:27:25 skrll Exp $ */ /* @@ -145,7 +145,7 @@ ehci_cardbus_attach(struct device *parent, struct device *self, void *aux) EOWRITE2(&sc->sc, EHCI_USBINTR, 0); sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline, - IPL_USB, ehci_intr, sc); + IPL_USB, ehci_intr, sc, devname); if (sc->sc_ih == NULL) { printf(": unable to establish interrupt\n"); return; diff --git a/sys/dev/cardbus/if_acx_cardbus.c b/sys/dev/cardbus/if_acx_cardbus.c index c11a3e2d058..c3e65eeb503 100644 --- a/sys/dev/cardbus/if_acx_cardbus.c +++ b/sys/dev/cardbus/if_acx_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_acx_cardbus.c,v 1.9 2006/08/19 23:17:12 mglocker Exp $ */ +/* $OpenBSD: if_acx_cardbus.c,v 1.10 2006/10/12 16:35:52 grange Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -229,7 +229,7 @@ acx_cardbus_enable(struct acx_softc *sc) /* map and establish the interrupt handler */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - acx_intr, sc); + acx_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf("%s: could not establish interrupt at %d\n", sc->sc_dev.dv_xname, csc->sc_intrline); diff --git a/sys/dev/cardbus/if_ath_cardbus.c b/sys/dev/cardbus/if_ath_cardbus.c index 5ea1e0153b0..9e0fbed7ec4 100644 --- a/sys/dev/cardbus/if_ath_cardbus.c +++ b/sys/dev/cardbus/if_ath_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ath_cardbus.c,v 1.9 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: if_ath_cardbus.c,v 1.10 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: if_ath_cardbus.c,v 1.4 2004/08/02 19:14:28 mycroft Exp $ */ /* @@ -244,7 +244,7 @@ ath_cardbus_enable(struct ath_softc *sc) * Map and establish the interrupt. */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - ath_intr, sc); + ath_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf(": unable to establish irq %d\n", csc->sc_intrline); diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c index a692372e9b7..539de21a5bc 100644 --- a/sys/dev/cardbus/if_atw_cardbus.c +++ b/sys/dev/cardbus/if_atw_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atw_cardbus.c,v 1.13 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: if_atw_cardbus.c,v 1.14 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: if_atw_cardbus.c,v 1.9 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -287,7 +287,7 @@ atw_cardbus_enable(struct atw_softc *sc) * Map and establish the interrupt. */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - atw_intr, sc); + atw_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf("%s: unable to establish interrupt at %d\n", sc->sc_dev.dv_xname, csc->sc_intrline); diff --git a/sys/dev/cardbus/if_dc_cardbus.c b/sys/dev/cardbus/if_dc_cardbus.c index 96d51a26b5d..e62b8095278 100644 --- a/sys/dev/cardbus/if_dc_cardbus.c +++ b/sys/dev/cardbus/if_dc_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dc_cardbus.c,v 1.22 2006/04/23 19:33:28 brad Exp $ */ +/* $OpenBSD: if_dc_cardbus.c,v 1.23 2006/10/12 16:35:52 grange Exp $ */ #include <sys/param.h> #include <sys/systm.h> @@ -195,7 +195,7 @@ dc_cardbus_attach(parent, self, aux) } sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline, IPL_NET, - dc_intr, csc); + dc_intr, csc, sc->sc_dev.dv_xname); if (sc->sc_ih == NULL) { printf(": can't establish interrupt at %d\n", ca->ca_intrline); diff --git a/sys/dev/cardbus/if_fxp_cardbus.c b/sys/dev/cardbus/if_fxp_cardbus.c index 432e2072011..37223d7ae18 100644 --- a/sys/dev/cardbus/if_fxp_cardbus.c +++ b/sys/dev/cardbus/if_fxp_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_fxp_cardbus.c,v 1.17 2006/07/01 21:48:08 brad Exp $ */ +/* $OpenBSD: if_fxp_cardbus.c,v 1.18 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: if_fxp_cardbus.c,v 1.12 2000/05/08 18:23:36 thorpej Exp $ */ /* @@ -181,7 +181,7 @@ fxp_cardbus_attach(struct device *parent, struct device *self, void *aux) /* Map and establish the interrupt. */ sc->sc_ih = cardbus_intr_establish(cc, cf, psc->sc_intrline, IPL_NET, - fxp_intr, sc); + fxp_intr, sc, sc->sc_dev.dv_xname); if (NULL == sc->sc_ih) { printf(": couldn't establish interrupt"); printf("at %d\n", ca->ca_intrline); diff --git a/sys/dev/cardbus/if_pgt_cardbus.c b/sys/dev/cardbus/if_pgt_cardbus.c index d181916cd6e..553b452c27f 100644 --- a/sys/dev/cardbus/if_pgt_cardbus.c +++ b/sys/dev/cardbus/if_pgt_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pgt_cardbus.c,v 1.4 2006/10/09 20:45:27 mglocker Exp $ */ +/* $OpenBSD: if_pgt_cardbus.c,v 1.5 2006/10/12 16:35:52 grange Exp $ */ /* * Copyright (c) 2006 Marcus Glocker <mglocker@openbsd.org> @@ -186,7 +186,7 @@ pgt_cardbus_enable(struct pgt_softc *sc) /* map and establish the interrupt handler */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - pgt_intr, sc); + pgt_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf("%s: could not establish interrupt at %d\n", sc->sc_dev.dv_xname, csc->sc_intrline); diff --git a/sys/dev/cardbus/if_ral_cardbus.c b/sys/dev/cardbus/if_ral_cardbus.c index 29130a099be..91050eb3652 100644 --- a/sys/dev/cardbus/if_ral_cardbus.c +++ b/sys/dev/cardbus/if_ral_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral_cardbus.c,v 1.7 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: if_ral_cardbus.c,v 1.8 2006/10/12 16:35:52 grange Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -206,7 +206,7 @@ ral_cardbus_enable(struct rt2560_softc *sc) /* map and establish the interrupt handler */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - csc->sc_opns->intr, sc); + csc->sc_opns->intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf("%s: could not establish interrupt at %d\n", sc->sc_dev.dv_xname, csc->sc_intrline); diff --git a/sys/dev/cardbus/if_re_cardbus.c b/sys/dev/cardbus/if_re_cardbus.c index 1adcf334e41..41d75db40d7 100644 --- a/sys/dev/cardbus/if_re_cardbus.c +++ b/sys/dev/cardbus/if_re_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_re_cardbus.c,v 1.9 2006/09/19 07:23:02 mickey Exp $ */ +/* $OpenBSD: if_re_cardbus.c,v 1.10 2006/10/12 16:35:52 grange Exp $ */ /* * Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org> @@ -150,7 +150,7 @@ re_cardbus_attach(struct device *parent, struct device *self, void *aux) /* Allocate interrupt */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, - IPL_NET, re_intr, sc); + IPL_NET, re_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf(": couldn't establish interrupt at %s", ca->ca_intrline); diff --git a/sys/dev/cardbus/if_rl_cardbus.c b/sys/dev/cardbus/if_rl_cardbus.c index 2b73ed846fc..520270f42f7 100644 --- a/sys/dev/cardbus/if_rl_cardbus.c +++ b/sys/dev/cardbus/if_rl_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl_cardbus.c,v 1.13 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: if_rl_cardbus.c,v 1.14 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: if_rl_cardbus.c,v 1.3.8.3 2001/11/14 19:14:02 nathanw Exp $ */ /* @@ -198,7 +198,7 @@ rl_cardbus_attach(parent, self, aux) * Map and establish the interrupt. */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - rl_intr, sc); + rl_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf(": couldn't establish interrupt\n"); Cardbus_function_disable(csc->sc_ct); diff --git a/sys/dev/cardbus/if_rtw_cardbus.c b/sys/dev/cardbus/if_rtw_cardbus.c index 5ab049f07e1..face717b170 100644 --- a/sys/dev/cardbus/if_rtw_cardbus.c +++ b/sys/dev/cardbus/if_rtw_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rtw_cardbus.c,v 1.10 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: if_rtw_cardbus.c,v 1.11 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: if_rtw_cardbus.c,v 1.4 2004/12/20 21:05:34 dyoung Exp $ */ /*- @@ -342,7 +342,7 @@ rtw_cardbus_enable(struct rtw_softc *sc) * Map and establish the interrupt. */ csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET, - rtw_intr, sc); + rtw_intr, sc, sc->sc_dev.dv_xname); if (csc->sc_ih == NULL) { printf("%s: unable to establish interrupt at %d\n", sc->sc_dev.dv_xname, csc->sc_intrline); diff --git a/sys/dev/cardbus/if_xl_cardbus.c b/sys/dev/cardbus/if_xl_cardbus.c index eff00c04d4d..c32295198c4 100644 --- a/sys/dev/cardbus/if_xl_cardbus.c +++ b/sys/dev/cardbus/if_xl_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xl_cardbus.c,v 1.17 2006/08/10 20:10:19 brad Exp $ */ +/* $OpenBSD: if_xl_cardbus.c,v 1.18 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: if_xl_cardbus.c,v 1.13 2000/03/07 00:32:52 mycroft Exp $ */ /* @@ -283,7 +283,7 @@ xl_cardbus_attach(struct device *parent, struct device *self, void *aux) /* Map and establish the interrupt. */ sc->xl_intrhand = cardbus_intr_establish(cc, cf, ca->ca_intrline, - IPL_NET, xl_intr, csc); + IPL_NET, xl_intr, csc, self->dv_xname); if (sc->xl_intrhand == NULL) { printf(": couldn't establish interrupt"); diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c index d0c09e25d40..5df15b2f135 100644 --- a/sys/dev/cardbus/ohci_cardbus.c +++ b/sys/dev/cardbus/ohci_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci_cardbus.c,v 1.7 2006/07/12 06:26:34 jolan Exp $ */ +/* $OpenBSD: ohci_cardbus.c,v 1.8 2006/10/12 16:35:52 grange Exp $ */ /* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */ /* @@ -144,7 +144,7 @@ ohci_cardbus_attach(struct device *parent, struct device *self, void *aux) | CARDBUS_COMMAND_MEM_ENABLE); sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline, - IPL_USB, ohci_intr, sc); + IPL_USB, ohci_intr, sc, devname); if (sc->sc_ih == NULL) { printf("%s: couldn't establish interrupt\n", devname); return; diff --git a/sys/dev/cardbus/puc_cardbus.c b/sys/dev/cardbus/puc_cardbus.c index c56c6224d71..a8ea3f65335 100644 --- a/sys/dev/cardbus/puc_cardbus.c +++ b/sys/dev/cardbus/puc_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: puc_cardbus.c,v 1.1 2006/07/31 11:06:27 mickey Exp $ */ +/* $OpenBSD: puc_cardbus.c,v 1.2 2006/10/12 16:35:52 grange Exp $ */ /* * Copyright (c) 2006 Michael Shalayeff @@ -161,7 +161,7 @@ puc_cardbus_intr_establish(struct puc_attach_args *paa, int type, struct cardbus_devfunc *ct = sc->ct; return (cardbus_intr_establish(ct->ct_cc, ct->ct_cf, sc->intrline, - type, func, arg)); + type, func, arg, name)); } int diff --git a/sys/dev/cardbus/uhci_cardbus.c b/sys/dev/cardbus/uhci_cardbus.c index e1010a5eb4c..2e297d7dd48 100644 --- a/sys/dev/cardbus/uhci_cardbus.c +++ b/sys/dev/cardbus/uhci_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci_cardbus.c,v 1.4 2006/07/12 06:26:34 jolan Exp $ */ +/* $OpenBSD: uhci_cardbus.c,v 1.5 2006/10/12 16:35:52 grange Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ uhci_cardbus_attach(struct device *parent, struct device *self, void *aux) | CARDBUS_COMMAND_IO_ENABLE); sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline, - IPL_USB, uhci_intr, sc); + IPL_USB, uhci_intr, sc, devname); if (sc->sc_ih == NULL) { printf("%s: couldn't establish interrupt\n", devname); return; diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index e0e3fcc66c9..00cc9912487 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbb.c,v 1.46 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: pccbb.c,v 1.47 2006/10/12 16:35:51 grange Exp $ */ /* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */ /* @@ -48,6 +48,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/errno.h> +#include <sys/evcount.h> #include <sys/ioctl.h> #include <sys/syslog.h> #include <sys/device.h> @@ -116,11 +117,11 @@ int pccbb_ctrl(cardbus_chipset_tag_t, int); int pccbb_power(cardbus_chipset_tag_t, int); int pccbb_cardenable(struct pccbb_softc * sc, int function); void *pccbb_intr_establish(struct pccbb_softc *, int irq, int level, - int (*ih) (void *), void *sc); + int (*ih) (void *), void *sc, const char *); void pccbb_intr_disestablish(struct pccbb_softc *, void *ih); void *pccbb_cb_intr_establish(cardbus_chipset_tag_t, int irq, int level, - int (*ih) (void *), void *sc); + int (*ih) (void *), void *sc, const char *); void pccbb_cb_intr_disestablish(cardbus_chipset_tag_t ct, void *ih); cardbustag_t pccbb_make_tag(cardbus_chipset_tag_t, int, int, int); @@ -1056,6 +1057,8 @@ pccbbintr_function(sc) } val = (*pil->pil_func)(pil->pil_arg); + if (val != 0) + pil->pil_count.ec_count++; if (splchanged != 0) { splx(s); @@ -1531,7 +1534,8 @@ pccbb_cardenable(sc, function) * int irq, * int level, * int (* func)(void *), - * void *arg) + * void *arg, + * const char *name) * * This function registers an interrupt handler at the bridge, in * order not to call the interrupt handlers of child devices when @@ -1540,15 +1544,16 @@ pccbb_cardenable(sc, function) * The arguments irq is not used because pccbb selects intr vector. */ void * -pccbb_cb_intr_establish(ct, irq, level, func, arg) +pccbb_cb_intr_establish(ct, irq, level, func, arg, name) cardbus_chipset_tag_t ct; int irq, level; int (*func)(void *); void *arg; + const char *name; { struct pccbb_softc *sc = (struct pccbb_softc *)ct; - return pccbb_intr_establish(sc, irq, level, func, arg); + return pccbb_intr_establish(sc, irq, level, func, arg, name); } @@ -1574,7 +1579,8 @@ pccbb_cb_intr_disestablish(ct, ih) * int irq, * int level, * int (* func)(void *), - * void *arg) + * void *arg, + * const char *name) * * This function registers an interrupt handler at the bridge, in * order not to call the interrupt handlers of child devices when @@ -1583,11 +1589,12 @@ pccbb_cb_intr_disestablish(ct, ih) * The arguments irq and level are not used. */ void * -pccbb_intr_establish(sc, irq, level, func, arg) +pccbb_intr_establish(sc, irq, level, func, arg, name) struct pccbb_softc *sc; int irq, level; int (*func)(void *); void *arg; + const char *name; { struct pccbb_intrhand_list *pil, *newpil; pcireg_t reg; @@ -1621,6 +1628,8 @@ pccbb_intr_establish(sc, irq, level, func, arg) newpil->pil_func = func; newpil->pil_arg = arg; newpil->pil_level = level; + evcount_attach(&newpil->pil_count, name, &sc->sc_intrline, + &evcount_intr); newpil->pil_next = NULL; if (sc->sc_pil == NULL) { @@ -1656,6 +1665,7 @@ pccbb_intr_disestablish(sc, ih) for (pil = sc->sc_pil; pil != NULL; pil = pil->pil_next) { if (pil == ih) { + evcount_detach(&pil->pil_count); *pil_prev = pil->pil_next; free(pil, M_DEVBUF); DPRINTF(("pccbb_intr_disestablish frees one pil\n")); @@ -2672,7 +2682,7 @@ pccbb_pcmcia_intr_establish(pch, pf, ipl, func, arg, xname) */ } - return pccbb_intr_establish(sc, -1, ipl, func, arg); + return pccbb_intr_establish(sc, -1, ipl, func, arg, xname); } /* diff --git a/sys/dev/pci/pccbbvar.h b/sys/dev/pci/pccbbvar.h index 5ce6e8b8de0..894161851db 100644 --- a/sys/dev/pci/pccbbvar.h +++ b/sys/dev/pci/pccbbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbbvar.h,v 1.11 2006/06/21 11:27:03 fkr Exp $ */ +/* $OpenBSD: pccbbvar.h,v 1.12 2006/10/12 16:35:51 grange Exp $ */ /* $NetBSD: pccbbvar.h,v 1.13 2000/06/08 10:28:29 haya Exp $ */ /* * Copyright (c) 1999 HAYAKAWA Koichi. All rights reserved. @@ -183,6 +183,7 @@ struct pccbb_intrhand_list { int (*pil_func)(void *); void *pil_arg; int pil_level; + struct evcount pil_count; struct pccbb_intrhand_list *pil_next; }; |