Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/cardbus Introduce Cardbus_intr_establish(cardbus_dev...



details:   https://anonhg.NetBSD.org/src/rev/77a2366ad55c
branches:  trunk
changeset: 752446:77a2366ad55c
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Fri Feb 26 01:12:56 2010 +0000

description:
Introduce Cardbus_intr_establish(cardbus_devfunc_t, ...) and
Cardbus_intr_disestablish(cardbus_devfunc_t, ...) and start using them.

diffstat:

 sys/dev/cardbus/cardbus.c        |  18 ++++++++++++++++--
 sys/dev/cardbus/cardbusvar.h     |   6 +++++-
 sys/dev/cardbus/if_rtw_cardbus.c |  14 +++++---------
 3 files changed, 26 insertions(+), 12 deletions(-)

diffs (126 lines):

diff -r 9e49fab11e94 -r 77a2366ad55c sys/dev/cardbus/cardbus.c
--- a/sys/dev/cardbus/cardbus.c Fri Feb 26 00:57:01 2010 +0000
+++ b/sys/dev/cardbus/cardbus.c Fri Feb 26 01:12:56 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cardbus.c,v 1.105 2010/02/26 00:57:01 dyoung Exp $     */
+/*     $NetBSD: cardbus.c,v 1.106 2010/02/26 01:12:56 dyoung Exp $     */
 
 /*
  * Copyright (c) 1997, 1998, 1999 and 2000
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.105 2010/02/26 00:57:01 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.106 2010/02/26 01:12:56 dyoung Exp $");
 
 #include "opt_cardbus.h"
 
@@ -710,6 +710,14 @@
        free(ct, M_DEVBUF);
 }
 
+void *
+Cardbus_intr_establish(cardbus_devfunc_t ct,
+    cardbus_intr_line_t irq, int level, int (*func)(void *), void *arg)
+{
+       return cardbus_intr_establish(ct->ct_cc, ct->ct_cf, irq, level, func,
+           arg);
+}
+
 /*
  * void *cardbus_intr_establish(cc, cf, irq, level, func, arg)
  *   Interrupt handler of pccard.
@@ -726,6 +734,12 @@
        return ((*cf->cardbus_intr_establish)(cc, irq, level, func, arg));
 }
 
+void
+Cardbus_intr_disestablish(cardbus_devfunc_t ct, void *handler)
+{
+       cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, handler);
+}
+
 /*
  * void cardbus_intr_disestablish(cc, cf, handler)
  *   Interrupt handler of pccard.
diff -r 9e49fab11e94 -r 77a2366ad55c sys/dev/cardbus/cardbusvar.h
--- a/sys/dev/cardbus/cardbusvar.h      Fri Feb 26 00:57:01 2010 +0000
+++ b/sys/dev/cardbus/cardbusvar.h      Fri Feb 26 01:12:56 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cardbusvar.h,v 1.47 2010/02/25 00:47:39 dyoung Exp $   */
+/*     $NetBSD: cardbusvar.h,v 1.48 2010/02/26 01:12:56 dyoung Exp $   */
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -303,6 +303,10 @@
 
 int cardbus_attach_card(struct cardbus_softc *);
 void cardbus_detach_card(struct cardbus_softc *);
+void *
+Cardbus_intr_establish(cardbus_devfunc_t,
+    cardbus_intr_line_t, int, int (*)(void *), void *);
+void Cardbus_intr_disestablish(cardbus_devfunc_t, void *);
 void *cardbus_intr_establish(cardbus_chipset_tag_t, cardbus_function_tag_t,
     cardbus_intr_line_t, int, int (*) (void *), void *arg);
 void cardbus_intr_disestablish(cardbus_chipset_tag_t,
diff -r 9e49fab11e94 -r 77a2366ad55c sys/dev/cardbus/if_rtw_cardbus.c
--- a/sys/dev/cardbus/if_rtw_cardbus.c  Fri Feb 26 00:57:01 2010 +0000
+++ b/sys/dev/cardbus/if_rtw_cardbus.c  Fri Feb 26 01:12:56 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_rtw_cardbus.c,v 1.37 2010/02/25 23:01:48 dyoung Exp $ */
+/* $NetBSD: if_rtw_cardbus.c,v 1.38 2010/02/26 01:12:56 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005 David Young.  All rights reserved.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.37 2010/02/25 23:01:48 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtw_cardbus.c,v 1.38 2010/02/26 01:12:56 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -321,7 +321,7 @@
         * Unhook the interrupt handler.
         */
        if (csc->sc_ih != NULL)
-               cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, csc->sc_ih);
+               Cardbus_intr_disestablish(ct, csc->sc_ih);
 
        /*
         * Release bus space and close window.
@@ -339,13 +339,11 @@
        struct rtw_cardbus_softc *csc = device_private(self);
        struct rtw_softc *sc = &csc->sc_rtw;
        cardbus_devfunc_t ct = csc->sc_ct;
-       cardbus_chipset_tag_t cc = ct->ct_cc;
-       cardbus_function_tag_t cf = ct->ct_cf;
 
        /*
         * Map and establish the interrupt.
         */
-       csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline, IPL_NET,
+       csc->sc_ih = Cardbus_intr_establish(ct, csc->sc_intrline, IPL_NET,
            rtw_intr, sc);
        if (csc->sc_ih == NULL) {
                aprint_error_dev(sc->sc_dev,
@@ -367,8 +365,6 @@
        struct rtw_cardbus_softc *csc = device_private(self);
        struct rtw_softc *sc = &csc->sc_rtw;
        cardbus_devfunc_t ct = csc->sc_ct;
-       cardbus_chipset_tag_t cc = ct->ct_cc;
-       cardbus_function_tag_t cf = ct->ct_cf;
 
        if (!rtw_suspend(self, qual))
                return false;
@@ -379,7 +375,7 @@
        rtw_cardbus_funcregen(&sc->sc_regs, 0);
 
        /* Unhook the interrupt handler. */
-       cardbus_intr_disestablish(cc, cf, csc->sc_ih);
+       Cardbus_intr_disestablish(ct, csc->sc_ih);
        csc->sc_ih = NULL;
        return true;
 }



Home | Main Index | Thread Index | Old Index