Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/cardbus Simplify interrupt (dis)establishment by two...



details:   https://anonhg.NetBSD.org/src/rev/811bbc62c3c7
branches:  trunk
changeset: 752640:811bbc62c3c7
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Mar 02 20:31:14 2010 +0000

description:
Simplify interrupt (dis)establishment by two source transformations:

-       cardbus_intr_disestablish(cc, cf, ih);
+       Cardbus_intr_disestablish(ct, ih);

-       ih = cardbus_intr_establish(cc, cf, ...);
+       ih = Cardbus_intr_establish(ct, ...);

Tested with ath & atw units on a Soekris net4521.

diffstat:

 sys/dev/cardbus/if_ath_cardbus.c |  13 ++++++-------
 sys/dev/cardbus/if_atw_cardbus.c |  14 +++++---------
 2 files changed, 11 insertions(+), 16 deletions(-)

diffs (103 lines):

diff -r 3781d409743c -r 811bbc62c3c7 sys/dev/cardbus/if_ath_cardbus.c
--- a/sys/dev/cardbus/if_ath_cardbus.c  Tue Mar 02 20:04:16 2010 +0000
+++ b/sys/dev/cardbus/if_ath_cardbus.c  Tue Mar 02 20:31:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ath_cardbus.c,v 1.40 2010/02/25 23:40:39 dyoung Exp $ */
+/*     $NetBSD: if_ath_cardbus.c,v 1.41 2010/03/02 20:31:14 dyoung Exp $ */
 /*
  * Copyright (c) 2003
  *     Ichiro FUKUHARA <ichiro%ichiro.org@localhost>.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.40 2010/02/25 23:40:39 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.41 2010/03/02 20:31:14 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -115,8 +115,7 @@
 
        ath_suspend(&csc->sc_ath);
        if (csc->sc_ih != NULL) {
-               cardbus_intr_disestablish(csc->sc_ct->ct_cc, csc->sc_ct->ct_cf,
-                   csc->sc_ih);
+               Cardbus_intr_disestablish(csc->sc_ct, csc->sc_ih);
                csc->sc_ih = NULL;
        }
        return true;
@@ -127,8 +126,8 @@
 {
        struct ath_cardbus_softc *csc = device_private(self);
 
-       csc->sc_ih = cardbus_intr_establish(csc->sc_ct->ct_cc,
-           csc->sc_ct->ct_cf, csc->sc_intrline, IPL_NET, ath_intr,
+       csc->sc_ih = Cardbus_intr_establish(csc->sc_ct,
+           csc->sc_intrline, IPL_NET, ath_intr,
            &csc->sc_ath);
 
        if (csc->sc_ih == NULL) {
@@ -235,7 +234,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);
                csc->sc_ih = NULL;
        }
 
diff -r 3781d409743c -r 811bbc62c3c7 sys/dev/cardbus/if_atw_cardbus.c
--- a/sys/dev/cardbus/if_atw_cardbus.c  Tue Mar 02 20:04:16 2010 +0000
+++ b/sys/dev/cardbus/if_atw_cardbus.c  Tue Mar 02 20:31:14 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atw_cardbus.c,v 1.32 2010/02/25 23:40:39 dyoung Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.33 2010/03/02 20:31:14 dyoung Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.32 2010/02/25 23:40:39 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atw_cardbus.c,v 1.33 2010/03/02 20:31:14 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -308,7 +308,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.
@@ -326,13 +326,11 @@
        struct atw_cardbus_softc *csc = device_private(self);
        struct atw_softc *sc = &csc->sc_atw;
        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,
            atw_intr, sc);
        if (csc->sc_ih == NULL) {
                aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n");
@@ -347,11 +345,9 @@
 {
        struct atw_cardbus_softc *csc = device_private(self);
        cardbus_devfunc_t ct = csc->sc_ct;
-       cardbus_chipset_tag_t cc = ct->ct_cc;
-       cardbus_function_tag_t cf = ct->ct_cf;
 
        /* Unhook the interrupt handler. */
-       cardbus_intr_disestablish(cc, cf, csc->sc_ih);
+       Cardbus_intr_disestablish(ct, csc->sc_ih);
        csc->sc_ih = NULL;
 
        return atw_suspend(self, qual);



Home | Main Index | Thread Index | Old Index