Module Name:    src
Committed By:   dyoung
Date:           Thu Mar 11 17:24:27 UTC 2010

Modified Files:
        src/sys/dev/cardbus: if_rtk_cardbus.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/cardbus/if_rtk_cardbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cardbus/if_rtk_cardbus.c
diff -u src/sys/dev/cardbus/if_rtk_cardbus.c:1.43 src/sys/dev/cardbus/if_rtk_cardbus.c:1.44
--- src/sys/dev/cardbus/if_rtk_cardbus.c:1.43	Fri Feb 26 00:57:02 2010
+++ src/sys/dev/cardbus/if_rtk_cardbus.c	Thu Mar 11 17:24:27 2010
@@ -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. */

Reply via email to