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/ba5651d13715
branches: trunk
changeset: 752929:ba5651d13715
user: dyoung <dyoung%NetBSD.org@localhost>
date: Thu Mar 11 17:27:40 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 by ITOH Yasufumi. Results: njs(4) works, njata(4) hangs.
njata(4) also hangs in 5.0.1 and in 5.99.24 prior to this patch, so
there is no regression.
diffstat:
sys/dev/cardbus/njata_cardbus.c | 11 ++++-------
sys/dev/cardbus/njs_cardbus.c | 14 +++++---------
2 files changed, 9 insertions(+), 16 deletions(-)
diffs (95 lines):
diff -r b1963344d843 -r ba5651d13715 sys/dev/cardbus/njata_cardbus.c
--- a/sys/dev/cardbus/njata_cardbus.c Thu Mar 11 17:24:27 2010 +0000
+++ b/sys/dev/cardbus/njata_cardbus.c Thu Mar 11 17:27:40 2010 +0000
@@ -1,4 +1,4 @@
-/* $Id: njata_cardbus.c,v 1.12 2010/02/26 00:57:02 dyoung Exp $ */
+/* $Id: njata_cardbus.c,v 1.13 2010/03/11 17:27:40 dyoung Exp $ */
/*
* Copyright (c) 2006 ITOH Yasufumi <itohy%NetBSD.org@localhost>.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: njata_cardbus.c,v 1.12 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: njata_cardbus.c,v 1.13 2010/03/11 17:27:40 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -127,8 +127,6 @@
struct njata32_softc *sc = &csc->sc_njata32;
const struct njata32_cardbus_product *prod;
cardbus_devfunc_t ct = ca->ca_ct;
- cardbus_chipset_tag_t cc = ct->ct_cc;
- cardbus_function_tag_t cf = ct->ct_cf;
pcireg_t reg;
int csr;
uint8_t latency = 0x20;
@@ -211,7 +209,7 @@
/*
* Establish the interrupt.
*/
- sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline, IPL_BIO,
+ sc->sc_ih = Cardbus_intr_establish(ct, ca->ca_intrline, IPL_BIO,
njata32_intr, sc);
if (sc->sc_ih == NULL) {
aprint_error("%s: unable to establish interrupt\n",
@@ -235,8 +233,7 @@
return rv;
if (sc->sc_ih)
- cardbus_intr_disestablish(csc->sc_ct->ct_cc,
- csc->sc_ct->ct_cf, sc->sc_ih);
+ Cardbus_intr_disestablish(csc->sc_ct, sc->sc_ih);
if (sc->sc_flags & NJATA32_IO_MAPPED)
Cardbus_mapreg_unmap(csc->sc_ct, NJATA32_CARDBUS_BASEADDR_IO,
diff -r b1963344d843 -r ba5651d13715 sys/dev/cardbus/njs_cardbus.c
--- a/sys/dev/cardbus/njs_cardbus.c Thu Mar 11 17:24:27 2010 +0000
+++ b/sys/dev/cardbus/njs_cardbus.c Thu Mar 11 17:27:40 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: njs_cardbus.c,v 1.15 2010/02/26 00:57:02 dyoung Exp $ */
+/* $NetBSD: njs_cardbus.c,v 1.16 2010/03/11 17:27:40 dyoung Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: njs_cardbus.c,v 1.15 2010/02/26 00:57:02 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: njs_cardbus.c,v 1.16 2010/03/11 17:27:40 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -124,10 +124,7 @@
struct njsc32_softc *sc = &csc->sc_njsc32;
const struct njsc32_cardbus_product *prod;
cardbus_devfunc_t ct = ca->ca_ct;
- cardbus_chipset_tag_t cc = ct->ct_cc;
- cardbus_function_tag_t cf = ct->ct_cf;
- pcireg_t reg;
- int csr;
+ pcireg_t csr, reg;
u_int8_t latency = 0x20;
if ((prod = njs_cardbus_lookup(ca)) == NULL)
@@ -204,7 +201,7 @@
/*
* Establish the interrupt.
*/
- sc->sc_ih = cardbus_intr_establish(cc, cf, ca->ca_intrline, IPL_BIO,
+ sc->sc_ih = Cardbus_intr_establish(ct, ca->ca_intrline, IPL_BIO,
njsc32_intr, sc);
if (sc->sc_ih == NULL) {
aprint_error_dev(self,
@@ -231,8 +228,7 @@
return rv;
if (sc->sc_ih)
- cardbus_intr_disestablish(csc->sc_ct->ct_cc,
- csc->sc_ct->ct_cf, sc->sc_ih);
+ Cardbus_intr_disestablish(csc->sc_ct, sc->sc_ih);
if (sc->sc_flags & NJSC32_IO_MAPPED)
Cardbus_mapreg_unmap(csc->sc_ct, NJSC32_CARDBUS_BASEADDR_IO,
Home |
Main Index |
Thread Index |
Old Index