summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2000-04-24 19:43:37 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2000-04-24 19:43:37 +0000
commit70d2f3114d51aceb11c24356f5d49bb834e433bf (patch)
treede625cd7c646cb527960d788580648a870cf43c8 /sys
parent505fe399f123db9a1f35ae87c7ec9f36d7df2526 (diff)
Do not unmap CCR before using them for the last time
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pcmcia/com_pcmcia.c8
-rw-r--r--sys/dev/pcmcia/if_an_pcmcia.c4
-rw-r--r--sys/dev/pcmcia/if_awi_pcmcia.c4
-rw-r--r--sys/dev/pcmcia/if_cnw.c6
-rw-r--r--sys/dev/pcmcia/if_ep_pcmcia.c6
-rw-r--r--sys/dev/pcmcia/if_ne_pcmcia.c7
-rw-r--r--sys/dev/pcmcia/if_ray.c4
-rw-r--r--sys/dev/pcmcia/if_rln_pcmcia.c4
-rw-r--r--sys/dev/pcmcia/if_sm_pcmcia.c7
-rw-r--r--sys/dev/pcmcia/if_wi.c6
-rw-r--r--sys/dev/pcmcia/if_xe.c4
-rw-r--r--sys/dev/pcmcia/wdc_pcmcia.c35
12 files changed, 47 insertions, 48 deletions
diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c
index 311e0f9f5b9..9b2236c0b64 100644
--- a/sys/dev/pcmcia/com_pcmcia.c
+++ b/sys/dev/pcmcia/com_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_pcmcia.c,v 1.25 2000/02/03 19:42:19 angelos Exp $ */
+/* $OpenBSD: com_pcmcia.c,v 1.26 2000/04/24 19:43:35 niklas Exp $ */
/* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */
/*
@@ -249,13 +249,13 @@ com_pcmcia_activate(dev, act)
pcmcia_function_enable(sc->sc_pf);
printf("%s:", sc->sc_com.sc_dev.dv_xname);
sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_TTY,
- comintr, sc);
+ comintr, sc);
printf("\n");
break;
case DVACT_DEACTIVATE:
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
@@ -421,8 +421,8 @@ com_pcmcia_disable(sc)
{
struct com_pcmcia_softc *psc = (struct com_pcmcia_softc *) sc;
- com_pcmcia_disable1(sc);
pcmcia_intr_disestablish(psc->sc_pf, psc->sc_ih);
+ com_pcmcia_disable1(sc);
}
void
diff --git a/sys/dev/pcmcia/if_an_pcmcia.c b/sys/dev/pcmcia/if_an_pcmcia.c
index 52f26a9a29b..0a8644ee118 100644
--- a/sys/dev/pcmcia/if_an_pcmcia.c
+++ b/sys/dev/pcmcia/if_an_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_an_pcmcia.c,v 1.1 2000/04/03 01:02:00 mickey Exp $ */
+/* $OpenBSD: if_an_pcmcia.c,v 1.2 2000/04/24 19:43:35 niklas Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -188,8 +188,8 @@ an_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
an_stop(sc);
- pcmcia_function_disable(psc->sc_pf);
pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(psc->sc_pf);
break;
}
diff --git a/sys/dev/pcmcia/if_awi_pcmcia.c b/sys/dev/pcmcia/if_awi_pcmcia.c
index ec0ae0d42c9..0119dced22e 100644
--- a/sys/dev/pcmcia/if_awi_pcmcia.c
+++ b/sys/dev/pcmcia/if_awi_pcmcia.c
@@ -1,5 +1,5 @@
/* $NetBSD: if_awi_pcmcia.c,v 1.5 1999/11/06 16:43:54 sommerfeld Exp $ */
-/* $OpenBSD: if_awi_pcmcia.c,v 1.2 2000/02/11 10:29:36 niklas Exp $ */
+/* $OpenBSD: if_awi_pcmcia.c,v 1.3 2000/04/24 19:43:35 niklas Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -159,8 +159,8 @@ awi_pcmcia_disable(sc)
struct awi_pcmcia_softc *psc = (struct awi_pcmcia_softc *) sc;
struct pcmcia_function *pf = psc->sc_pf;
- pcmcia_function_disable (pf);
pcmcia_intr_disestablish (pf, sc->sc_ih);
+ pcmcia_function_disable (pf);
}
int
diff --git a/sys/dev/pcmcia/if_cnw.c b/sys/dev/pcmcia/if_cnw.c
index b1ca6f8bcb6..f28fa806d0a 100644
--- a/sys/dev/pcmcia/if_cnw.c
+++ b/sys/dev/pcmcia/if_cnw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cnw.c,v 1.5 2000/02/03 18:47:06 angelos Exp $ */
+/* $OpenBSD: if_cnw.c,v 1.6 2000/04/24 19:43:35 niklas Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -341,8 +341,8 @@ cnw_disable(sc)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
ifp->if_flags &= ~IFF_RUNNING;
ifp->if_timer = 0;
}
@@ -890,8 +890,8 @@ cnw_activate(dev, act)
case DVACT_DEACTIVATE:
ifp->if_timer = 0;
ifp->if_flags &= ~IFF_RUNNING; /* XXX no cnw_stop() ? */
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c
index c42a6ca0248..488a1fece08 100644
--- a/sys/dev/pcmcia/if_ep_pcmcia.c
+++ b/sys/dev/pcmcia/if_ep_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ep_pcmcia.c,v 1.22 2000/04/24 15:27:02 fgsch Exp $ */
+/* $OpenBSD: if_ep_pcmcia.c,v 1.23 2000/04/24 19:43:35 niklas Exp $ */
/* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */
/*-
@@ -255,8 +255,8 @@ ep_pcmcia_disable(sc)
{
struct ep_pcmcia_softc *psc = (struct ep_pcmcia_softc *) sc;
- ep_pcmcia_disable1(sc);
pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
+ ep_pcmcia_disable1(sc);
}
void
@@ -427,8 +427,8 @@ ep_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
epstop(esc);
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ep.sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
diff --git a/sys/dev/pcmcia/if_ne_pcmcia.c b/sys/dev/pcmcia/if_ne_pcmcia.c
index 64b0e1b5770..9ef172095e0 100644
--- a/sys/dev/pcmcia/if_ne_pcmcia.c
+++ b/sys/dev/pcmcia/if_ne_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ne_pcmcia.c,v 1.26 2000/04/19 09:19:43 fgsch Exp $ */
+/* $OpenBSD: if_ne_pcmcia.c,v 1.27 2000/04/24 19:43:35 niklas Exp $ */
/* $NetBSD: if_ne_pcmcia.c,v 1.17 1998/08/15 19:00:04 thorpej Exp $ */
/*
@@ -655,8 +655,8 @@ ne_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
dp8390_stop(esc);
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
@@ -687,7 +687,6 @@ ne_pcmcia_disable(dsc)
{
struct ne_pcmcia_softc *psc = (struct ne_pcmcia_softc *)dsc;
- pcmcia_function_disable(psc->sc_pf);
-
pcmcia_intr_disestablish(psc->sc_pf, psc->sc_ih);
+ pcmcia_function_disable(psc->sc_pf);
}
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c
index 42f6e91b899..215f6aa7deb 100644
--- a/sys/dev/pcmcia/if_ray.c
+++ b/sys/dev/pcmcia/if_ray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ray.c,v 1.2 2000/03/23 20:02:57 mickey Exp $ */
+/* $OpenBSD: if_ray.c,v 1.3 2000/04/24 19:43:35 niklas Exp $ */
/* $NetBSD: if_ray.c,v 1.17 2000/03/23 07:01:42 thorpej Exp $ */
/*
@@ -742,8 +742,8 @@ ray_activate(dev, act)
#ifdef __NetBSD__
if_deactivate(ifp);
#elif defined(__OpenBSD__)
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
#endif
break;
}
diff --git a/sys/dev/pcmcia/if_rln_pcmcia.c b/sys/dev/pcmcia/if_rln_pcmcia.c
index 44d2662f672..99b634ec6b3 100644
--- a/sys/dev/pcmcia/if_rln_pcmcia.c
+++ b/sys/dev/pcmcia/if_rln_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rln_pcmcia.c,v 1.9 2000/02/05 13:55:45 d Exp $ */
+/* $OpenBSD: if_rln_pcmcia.c,v 1.10 2000/04/24 19:43:36 niklas Exp $ */
/*
* David Leonard <d@openbsd.org>, 1999. Public domain.
*
@@ -285,8 +285,8 @@ rln_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
rlnstop(sc);
- pcmcia_function_disable(psc->psc_pf);
pcmcia_intr_disestablish(psc->psc_pf, psc->psc_ih);
+ pcmcia_function_disable(psc->psc_pf);
break;
}
splx(s);
diff --git a/sys/dev/pcmcia/if_sm_pcmcia.c b/sys/dev/pcmcia/if_sm_pcmcia.c
index 5e4940fb0ef..6b80cc5cf9e 100644
--- a/sys/dev/pcmcia/if_sm_pcmcia.c
+++ b/sys/dev/pcmcia/if_sm_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sm_pcmcia.c,v 1.11 2000/02/02 19:09:59 fgsch Exp $ */
+/* $OpenBSD: if_sm_pcmcia.c,v 1.12 2000/04/24 19:43:36 niklas Exp $ */
/* $NetBSD: if_sm_pcmcia.c,v 1.11 1998/08/15 20:47:32 thorpej Exp $ */
/*-
@@ -271,8 +271,8 @@ sm_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
smc91cxx_stop(&sc->sc_smc);
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
@@ -381,7 +381,6 @@ sm_pcmcia_disable(sc)
{
struct sm_pcmcia_softc *psc = (struct sm_pcmcia_softc *)sc;
- pcmcia_function_disable(psc->sc_pf);
-
pcmcia_intr_disestablish(psc->sc_pf, psc->sc_ih);
+ pcmcia_function_disable(psc->sc_pf);
}
diff --git a/sys/dev/pcmcia/if_wi.c b/sys/dev/pcmcia/if_wi.c
index 03332aef0d0..44f21d9cbe3 100644
--- a/sys/dev/pcmcia/if_wi.c
+++ b/sys/dev/pcmcia/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.9 2000/03/27 18:34:58 jason Exp $ */
+/* $OpenBSD: if_wi.c,v 1.10 2000/04/24 19:43:36 niklas Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -135,7 +135,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.9 2000/03/27 18:34:58 jason Exp $";
+ "$OpenBSD: if_wi.c,v 1.10 2000/04/24 19:43:36 niklas Exp $";
#endif /* lint */
#ifdef foo
@@ -389,8 +389,8 @@ wi_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
wi_stop(sc);
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
diff --git a/sys/dev/pcmcia/if_xe.c b/sys/dev/pcmcia/if_xe.c
index d85dc3b35a7..899472d030e 100644
--- a/sys/dev/pcmcia/if_xe.c
+++ b/sys/dev/pcmcia/if_xe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xe.c,v 1.11 2000/02/02 19:09:59 fgsch Exp $ */
+/* $OpenBSD: if_xe.c,v 1.12 2000/04/24 19:43:36 niklas Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist, C Stone, Job de Haas
@@ -504,8 +504,8 @@ xe_pcmcia_activate(dev, act)
ifp->if_timer = 0;
if (ifp->if_flags & IFF_RUNNING)
xe_stop(&sc->sc_xe);
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_xe.sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
break;
}
splx(s);
diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c
index d93033fd191..c311d38781e 100644
--- a/sys/dev/pcmcia/wdc_pcmcia.c
+++ b/sys/dev/pcmcia/wdc_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc_pcmcia.c,v 1.8 2000/04/10 07:06:15 csapuntz Exp $ */
+/* $OpenBSD: wdc_pcmcia.c,v 1.9 2000/04/24 19:43:36 niklas Exp $ */
/* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */
/*-
@@ -444,20 +444,20 @@ wdc_pcmcia_activate(self, act)
s = splbio();
switch (act) {
case DVACT_ACTIVATE:
- sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_BIO,
- wdcintr, &sc->wdc_channel);
- if (sc->sc_ih == NULL) {
- printf("%s: "
- "couldn't establish interrupt handler\n",
+ if (pcmcia_function_enable(sc->sc_pf)) {
+ printf("%s: couldn't enable PCMCIA function\n",
sc->sc_wdcdev.sc_dev.dv_xname);
rv = EIO;
break;
}
- if (pcmcia_function_enable(sc->sc_pf)) {
- printf("%s: couldn't enable PCMCIA function\n",
+ sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_BIO,
+ wdcintr, &sc->wdc_channel);
+ if (sc->sc_ih == NULL) {
+ printf("%s: "
+ "couldn't establish interrupt handler\n",
sc->sc_wdcdev.sc_dev.dv_xname);
- pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
rv = EIO;
break;
}
@@ -467,8 +467,8 @@ wdc_pcmcia_activate(self, act)
break;
case DVACT_DEACTIVATE:
- pcmcia_function_disable(sc->sc_pf);
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
rv = wdcactivate(self, act);
break;
}
@@ -486,27 +486,28 @@ wdc_pcmcia_enable(arg, onoff)
if (onoff) {
if ((sc->sc_flags & WDC_PCMCIA_ATTACH) == 0) {
+ if (pcmcia_function_enable(sc->sc_pf)) {
+ printf("%s: couldn't enable PCMCIA function\n",
+ sc->sc_wdcdev.sc_dev.dv_xname);
+ return (EIO);
+ }
+
sc->sc_ih = pcmcia_intr_establish(sc->sc_pf, IPL_BIO,
wdcintr, &sc->wdc_channel);
if (sc->sc_ih == NULL) {
printf("%s: "
"couldn't establish interrupt handler\n",
sc->sc_wdcdev.sc_dev.dv_xname);
+ pcmcia_function_disable(sc->sc_pf);
return (EIO);
}
- if (pcmcia_function_enable(sc->sc_pf)) {
- printf("%s: couldn't enable PCMCIA function\n",
- sc->sc_wdcdev.sc_dev.dv_xname);
- pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
- return (EIO);
- }
wdcreset(&sc->wdc_channel, VERBOSE);
}
} else {
- pcmcia_function_disable(sc->sc_pf);
if ((sc->sc_flags & WDC_PCMCIA_ATTACH) == 0)
pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+ pcmcia_function_disable(sc->sc_pf);
}
return (0);