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/056383a8c7a2
branches: trunk
changeset: 753152:056383a8c7a2
user: dyoung <dyoung%NetBSD.org@localhost>
date: Thu Mar 18 20:51:42 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, ...);
The identical change to a few other CardBus NICs has not caused any
problems, as expected, so I'm going to commit this rather safe change
and get on with the work.
Testers have been enlisted. I will revisit this change if I get any
negative responses.
diffstat:
sys/dev/cardbus/if_ral_cardbus.c | 21 +++++----------------
sys/dev/cardbus/if_re_cardbus.c | 22 +++++-----------------
2 files changed, 10 insertions(+), 33 deletions(-)
diffs (159 lines):
diff -r e9b2f9861d8e -r 056383a8c7a2 sys/dev/cardbus/if_ral_cardbus.c
--- a/sys/dev/cardbus/if_ral_cardbus.c Thu Mar 18 18:25:45 2010 +0000
+++ b/sys/dev/cardbus/if_ral_cardbus.c Thu Mar 18 20:51:42 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ral_cardbus.c,v 1.20 2010/02/26 00:57:02 dyoung Exp $ */
+/* $NetBSD: if_ral_cardbus.c,v 1.21 2010/03/18 20:51:42 dyoung Exp $ */
/* $OpenBSD: if_ral_cardbus.c,v 1.6 2006/01/09 20:03:31 damien Exp $ */
/*-
@@ -22,7 +22,7 @@
* CardBus front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ral_cardbus.c,v 1.20 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ral_cardbus.c,v 1.21 2010/03/18 20:51:42 dyoung Exp $");
#include <sys/param.h>
@@ -163,11 +163,6 @@
return;
}
-#if rbus
-#else
- (*cf->cardbus_mem_open)(cc, 0, base, base + csc->sc_mapsize);
-#endif
-
csc->sc_bar_val = base | PCI_MAPREG_TYPE_MEM;
/* set up the PCI configuration registers */
@@ -184,8 +179,6 @@
struct ral_cardbus_softc *csc = (struct ral_cardbus_softc *)self;
struct rt2560_softc *sc = &csc->sc_sc;
cardbus_devfunc_t ct = csc->sc_ct;
- cardbus_chipset_tag_t cc = ct->ct_cc;
- cardbus_function_tag_t cf = ct->ct_cf;
int error;
error = (*csc->sc_opns->detach)(sc);
@@ -194,7 +187,7 @@
/* unhook the interrupt handler */
if (csc->sc_ih != NULL) {
- cardbus_intr_disestablish(cc, cf, csc->sc_ih);
+ Cardbus_intr_disestablish(ct, csc->sc_ih);
csc->sc_ih = NULL;
}
@@ -210,8 +203,6 @@
{
struct ral_cardbus_softc *csc = (struct ral_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 */
Cardbus_function_enable(ct);
@@ -220,7 +211,7 @@
ral_cardbus_setup(csc);
/* map and establish the interrupt handler */
- 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,
csc->sc_opns->intr, sc);
if (csc->sc_ih == NULL) {
aprint_error_dev(&sc->sc_dev,
@@ -237,11 +228,9 @@
{
struct ral_cardbus_softc *csc = (struct ral_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 */
diff -r e9b2f9861d8e -r 056383a8c7a2 sys/dev/cardbus/if_re_cardbus.c
--- a/sys/dev/cardbus/if_re_cardbus.c Thu Mar 18 18:25:45 2010 +0000
+++ b/sys/dev/cardbus/if_re_cardbus.c Thu Mar 18 20:51:42 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_re_cardbus.c,v 1.24 2010/02/26 00:57:02 dyoung Exp $ */
+/* $NetBSD: if_re_cardbus.c,v 1.25 2010/03/18 20:51:42 dyoung Exp $ */
/*
* Copyright (c) 2004 Jonathan Stone
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_re_cardbus.c,v 1.24 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_re_cardbus.c,v 1.25 2010/03/18 20:51:42 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,10 +171,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;
@@ -182,10 +178,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;
@@ -232,7 +224,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.
@@ -316,8 +308,6 @@
{
struct re_cardbus_softc *csc = (struct re_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.
@@ -332,7 +322,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, re_intr, sc);
if (csc->sc_ih == NULL) {
aprint_error_dev(sc->sc_dev,
@@ -348,11 +338,9 @@
{
struct re_cardbus_softc *csc = (struct re_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