Do not unmap CCR before using them for the last time
authorniklas <niklas@openbsd.org>
Mon, 24 Apr 2000 19:43:35 +0000 (19:43 +0000)
committerniklas <niklas@openbsd.org>
Mon, 24 Apr 2000 19:43:35 +0000 (19:43 +0000)
12 files changed:
sys/dev/pcmcia/com_pcmcia.c
sys/dev/pcmcia/if_an_pcmcia.c
sys/dev/pcmcia/if_awi_pcmcia.c
sys/dev/pcmcia/if_cnw.c
sys/dev/pcmcia/if_ep_pcmcia.c
sys/dev/pcmcia/if_ne_pcmcia.c
sys/dev/pcmcia/if_ray.c
sys/dev/pcmcia/if_rln_pcmcia.c
sys/dev/pcmcia/if_sm_pcmcia.c
sys/dev/pcmcia/if_wi.c
sys/dev/pcmcia/if_xe.c
sys/dev/pcmcia/wdc_pcmcia.c

index 311e0f9..9b2236c 100644 (file)
@@ -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
index 52f26a9..0a8644e 100644 (file)
@@ -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;
        }
 
index ec0ae0d..0119dce 100644 (file)
@@ -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
index b1ca6f8..f28fa80 100644 (file)
@@ -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);
index c42a6ca..488a1fe 100644 (file)
@@ -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);
index 64b0e1b..9ef1720 100644 (file)
@@ -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);
 }
index 42f6e91..215f6aa 100644 (file)
@@ -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;
        }
index 44d2662..99b634e 100644 (file)
@@ -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);
index 5e4940f..6b80cc5 100644 (file)
@@ -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);
 }
index 03332ae..44f21d9 100644 (file)
@@ -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);
index d85dc3b..899472d 100644 (file)
@@ -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);
index d93033f..c311d38 100644 (file)
@@ -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);