Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/cardbus This is *always* compiled with #define rbus ...



details:   https://anonhg.NetBSD.org/src/rev/b1963344d843
branches:  trunk
changeset: 752928:b1963344d843
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Mar 11 17:24:27 2010 +0000

description:
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

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 by Juraj Hercek.

diffstat:

 sys/dev/cardbus/if_rtk_cardbus.c |  22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diffs (80 lines):

diff -r 80bd4920333f -r b1963344d843 sys/dev/cardbus/if_rtk_cardbus.c
--- a/sys/dev/cardbus/if_rtk_cardbus.c  Thu Mar 11 15:44:48 2010 +0000
+++ b/sys/dev/cardbus/if_rtk_cardbus.c  Thu Mar 11 17:24:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_rtk_cardbus.c,v 1.43 2010/02/26 00:57:02 dyoung Exp $       */
+/*     $NetBSD: if_rtk_cardbus.c,v 1.44 2010/03/11 17:24:27 dyoung Exp $       */
 
 /*
  * Copyright (c) 2000 Masanori Kanaoka
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.43 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtk_cardbus.c,v 1.44 2010/03/11 17:24:27 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "rnd.h"
@@ -207,10 +207,6 @@
 #ifdef RTK_USEIOSPACE
        if (Cardbus_mapreg_map(ct, RTK_PCI_LOIO, PCI_MAPREG_TYPE_IO, 0,
            &sc->rtk_btag, &sc->rtk_bhandle, &adr, &csc->sc_mapsize) == 0) {
-#if rbus
-#else
-               (*ct->ct_cf->cardbus_io_open)(cc, 0, adr, adr+csc->sc_mapsize);
-#endif
                csc->sc_csr |= PCI_COMMAND_IO_ENABLE;
                csc->sc_bar_reg = RTK_PCI_LOIO;
                csc->sc_bar_val = adr | PCI_MAPREG_TYPE_IO;
@@ -218,10 +214,6 @@
 #else
        if (Cardbus_mapreg_map(ct, RTK_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
            &sc->rtk_btag, &sc->rtk_bhandle, &adr, &csc->sc_mapsize) == 0) {
-#if rbus
-#else
-               (*ct->ct_cf->cardbus_mem_open)(cc, 0, adr, adr+csc->sc_mapsize);
-#endif
                csc->sc_csr |= PCI_COMMAND_MEM_ENABLE;
                csc->sc_bar_reg = RTK_PCI_LOMEM;
                csc->sc_bar_val = adr | PCI_MAPREG_TYPE_MEM;
@@ -269,7 +261,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.
@@ -353,8 +345,6 @@
 {
        struct rtk_cardbus_softc *csc = (struct rtk_cardbus_softc *)sc;
        cardbus_devfunc_t ct = csc->sc_ct;
-       cardbus_chipset_tag_t cc = ct->ct_cc;
-       cardbus_function_tag_t cf = ct->ct_cf;
 
        /*
         * Power on the socket.
@@ -369,7 +359,7 @@
        /*
         * Map and establish the interrupt.
         */
-       csc->sc_ih = cardbus_intr_establish(cc, cf, csc->sc_intrline,
+       csc->sc_ih = Cardbus_intr_establish(ct, csc->sc_intrline,
            IPL_NET, rtk_intr, sc);
        if (csc->sc_ih == NULL) {
                aprint_error_dev(sc->sc_dev,
@@ -385,11 +375,9 @@
 {
        struct rtk_cardbus_softc *csc = (struct rtk_cardbus_softc *)sc;
        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;
 
        /* Power down the socket. */



Home | Main Index | Thread Index | Old Index