Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Remove some redundant tries to disable interupts. We...



details:   https://anonhg.NetBSD.org/src/rev/240b60e7e8e6
branches:  trunk
changeset: 525411:240b60e7e8e6
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Apr 10 23:51:06 2002 +0000

description:
Remove some redundant tries to disable interupts. We already avoided enabling
them.
Fix a stupid typo when enabling/disabling interrupts: we clear pending
interrupts when enabling, not disbling isac interrupts.

diffstat:

 sys/dev/ic/isac.c            |   6 ++----
 sys/dev/ic/isic_l1.c         |  24 ++++++++++++++----------
 sys/dev/ic/isic_l1.h         |   3 +--
 sys/dev/isa/isic_isa.c       |   7 +++----
 sys/dev/isapnp/isic_isapnp.c |   5 ++---
 sys/dev/pci/ifpci.c          |   5 ++---
 sys/dev/pci/isic_pci.c       |   5 ++---
 sys/dev/pcmcia/isic_pcmcia.c |   5 ++---
 8 files changed, 28 insertions(+), 32 deletions(-)

diffs (285 lines):

diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/ic/isac.c
--- a/sys/dev/ic/isac.c Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/ic/isac.c Wed Apr 10 23:51:06 2002 +0000
@@ -27,14 +27,14 @@
  *     i4b_isac.c - i4b siemens isdn chipset driver ISAC handler
  *     ---------------------------------------------------------
  *
- *     $Id: isac.c,v 1.10 2002/04/08 12:20:49 martin Exp $ 
+ *     $Id: isac.c,v 1.11 2002/04/10 23:51:06 martin Exp $ 
  *
  *      last edit-date: [Fri Jan  5 11:36:10 2001]
  *
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isac.c,v 1.10 2002/04/08 12:20:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isac.c,v 1.11 2002/04/10 23:51:06 martin Exp $");
 
 #ifdef __FreeBSD__
 #include "opt_i4b.h"
@@ -687,7 +687,6 @@
         * We don't want interrupts enabled attach time, so setup the
         * mask, but don't write it to the chip yet 
         */
-       /* ISAC_WRITE(I_MASK, ISAC_IMASK); */
 
        return(0);
 }
@@ -750,4 +749,3 @@
        DELAY(100);
        ISAC_WRITE(I_MASK, ISAC_IMASK);
 }
-
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/ic/isic_l1.c
--- a/sys/dev/ic/isic_l1.c      Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/ic/isic_l1.c      Wed Apr 10 23:51:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isic_l1.c,v 1.8 2002/04/08 12:20:49 martin Exp $ */
+/* $NetBSD: isic_l1.c,v 1.9 2002/04/10 23:51:06 martin Exp $ */
 
 /*
  * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_l1.c,v 1.8 2002/04/08 12:20:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_l1.c,v 1.9 2002/04/10 23:51:06 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -62,6 +62,7 @@
 static int isic_std_ph_data_req(isdn_layer1token, struct mbuf *, int);
 static int isic_std_ph_activate_req(isdn_layer1token);
 static int isic_std_mph_command_req(isdn_layer1token, int, void*);
+static void isic_enable_intr(struct isic_softc *sc, int enabled);
 
 const struct isdn_layer1_bri_driver isic_std_driver = {
        isic_std_ph_data_req,
@@ -218,8 +219,9 @@
 isic_std_mph_command_req(isdn_layer1token token, int command, void *parm)
 {
        struct isic_softc *sc = (struct isic_softc*)token;
-       int pass_down = 0;
+       int s, pass_down = 0;
 
+       s = splnet();
        switch(command)
        {
                case CMR_DOPEN:         /* daemon running */
@@ -252,16 +254,15 @@
        if (pass_down && sc->drv_command != NULL)
                sc->drv_command(sc, command, parm);
 
-       if (command == CMR_DOPEN) {
+       if (command == CMR_DOPEN)
                isic_enable_intr(sc, 1);
-               ISAC_WRITE(I_CMDR, ISAC_CMDR_RRES|ISAC_CMDR_XRES);
-               ISACCMDRWRDELAY();
-       }
+
+       splx(s);
 
        return(0);
 }
 
-void
+static void
 isic_enable_intr(struct isic_softc *sc, int enabled)
 {
        if (sc->sc_ipac) {
@@ -277,14 +278,15 @@
                        ISAC_WRITE(I_MASK, 0xff);
                }
        }
-       if (enabled == 0) {
+       if (enabled) {
                /* try to clear any pending interrupts */
                u_int8_t v;
 
-
                if (sc->sc_ipac) {
                        v = IPAC_READ(IPAC_ISTA);
                        v = ISAC_READ(I_STAR);
+                       if (v & ISAC_ISTA_EXI)
+                               v = ISAC_READ(I_EXIR);
                        v = ISAC_READ(I_MODE);
                        v = ISAC_READ(I_ADF2);
                        v = ISAC_READ(I_STAR);
@@ -292,6 +294,8 @@
                                v = ISAC_READ(I_EXIR);
                } else {
                        v = ISAC_READ(I_STAR);
+                       if (v & ISAC_ISTA_EXI)
+                               v = ISAC_READ(I_EXIR);
                        v = ISAC_READ(I_MODE);
                        v = ISAC_READ(I_ADF2);
                        v = ISAC_READ(I_STAR);
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/ic/isic_l1.h
--- a/sys/dev/ic/isic_l1.h      Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/ic/isic_l1.h      Wed Apr 10 23:51:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isic_l1.h,v 1.11 2002/04/08 12:20:49 martin Exp $ */
+/* $NetBSD: isic_l1.h,v 1.12 2002/04/10 23:51:07 martin Exp $ */
 
 /*
  * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
@@ -332,7 +332,6 @@
 
 extern void isic_recover __P((struct isic_softc *sc));
 extern int isicintr __P((void *));
-extern void isic_enable_intr __P((struct isic_softc *sc, int enabled));
 extern int isicprobe __P((struct isic_attach_args *ia));
 extern int isic_attach_avma1 __P((struct isic_softc *sc));
 extern int isic_attach_s016 __P((struct isic_softc *sc));
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/isa/isic_isa.c
--- a/sys/dev/isa/isic_isa.c    Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/isa/isic_isa.c    Wed Apr 10 23:51:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isic_isa.c,v 1.10 2002/03/30 19:13:45 martin Exp $     */
+/*     $NetBSD: isic_isa.c,v 1.11 2002/04/10 23:51:08 martin Exp $     */
 
 /*
  *   Copyright (c) 1997-1999 Martin Husemann. All rights reserved.
@@ -35,7 +35,7 @@
  *     isic_isa.c - ISA bus frontend for i4b_isic driver
  *     --------------------------------------------------
  *
- *     $Id: isic_isa.c,v 1.10 2002/03/30 19:13:45 martin Exp $ 
+ *     $Id: isic_isa.c,v 1.11 2002/04/10 23:51:08 martin Exp $ 
  *
  *      last edit-date: [Tue Jan  9 01:43:45 2001]
  *
@@ -45,7 +45,7 @@
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.10 2002/03/30 19:13:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.11 2002/04/10 23:51:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -807,7 +807,6 @@
 #endif /* __FreeBSD__ */
 
        /* init higher protocol layers */
-       isic_enable_intr(sc, 0);
        isic_attach_bri(sc, drvid, &isic_std_driver);
 
        return(1);
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/isapnp/isic_isapnp.c
--- a/sys/dev/isapnp/isic_isapnp.c      Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/isapnp/isic_isapnp.c      Wed Apr 10 23:51:06 2002 +0000
@@ -33,7 +33,7 @@
  *     isapnp_isic.c - ISA-P&P bus frontend for i4b_isic driver
  *     --------------------------------------------------------
  *
- *     $Id: isic_isapnp.c,v 1.9 2002/03/30 19:13:45 martin Exp $ 
+ *     $Id: isic_isapnp.c,v 1.10 2002/04/10 23:51:08 martin Exp $ 
  *
  *      last edit-date: [Fri Jan  5 11:38:29 2001]
  *
@@ -43,7 +43,7 @@
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.9 2002/03/30 19:13:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.10 2002/04/10 23:51:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -378,7 +378,6 @@
        }
 
        /* init higher protocol layers and save l2 handle */
-       isic_enable_intr(sc, 0);
        isic_attach_bri(sc, desc->name, &isic_std_driver);
 }
 
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/pci/ifpci.c
--- a/sys/dev/pci/ifpci.c       Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/pci/ifpci.c       Wed Apr 10 23:51:06 2002 +0000
@@ -35,14 +35,14 @@
  *     Fritz!Card PCI driver
  *     ------------------------------------------------
  *
- *     $Id: ifpci.c,v 1.7 2002/04/08 12:20:50 martin Exp $
+ *     $Id: ifpci.c,v 1.8 2002/04/10 23:51:08 martin Exp $
  *
  *      last edit-date: [Fri Jan  5 11:38:58 2001]
  *
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ifpci.c,v 1.7 2002/04/08 12:20:50 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ifpci.c,v 1.8 2002/04/10 23:51:08 martin Exp $");
 
 
 #include <sys/param.h>
@@ -387,7 +387,6 @@
        sc->sc_freeflag2 = 0;
 
        /* init higher protocol layers */
-       isic_enable_intr(sc, 0);
        drv = isdn_attach_bri(sc->sc_dev.dv_xname,
            "AVM Fritz!PCI", &sc->sc_l2, &ifpci_l3_driver);
        sc->sc_l3token = drv;
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/pci/isic_pci.c
--- a/sys/dev/pci/isic_pci.c    Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/pci/isic_pci.c    Wed Apr 10 23:51:06 2002 +0000
@@ -33,7 +33,7 @@
  *     isic_pci.c - pci bus frontend for i4b_isic driver
  *     ----------------------------------------------------
  *
- *     $Id: isic_pci.c,v 1.11 2002/04/08 12:20:50 martin Exp $ 
+ *     $Id: isic_pci.c,v 1.12 2002/04/10 23:51:08 martin Exp $ 
  *
  *      last edit-date: [Fri Jan  5 11:38:58 2001]
  *
@@ -43,7 +43,7 @@
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.11 2002/04/08 12:20:50 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.12 2002/04/10 23:51:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -334,7 +334,6 @@
 #endif
        
        /* init higher protocol layers */
-       isic_enable_intr(sc, 0);
        isic_attach_bri(sc, cardname, &isic_std_driver);
 }
 
diff -r 134e0deaf594 -r 240b60e7e8e6 sys/dev/pcmcia/isic_pcmcia.c
--- a/sys/dev/pcmcia/isic_pcmcia.c      Wed Apr 10 23:37:12 2002 +0000
+++ b/sys/dev/pcmcia/isic_pcmcia.c      Wed Apr 10 23:51:06 2002 +0000
@@ -33,7 +33,7 @@
  *     isic_pcmcia.c - pcmcia bus frontend for i4b_isic driver
  *     -------------------------------------------------------
  *
- *     $Id: isic_pcmcia.c,v 1.12 2002/04/08 12:20:51 martin Exp $ 
+ *     $Id: isic_pcmcia.c,v 1.13 2002/04/10 23:51:09 martin Exp $ 
  *
  *      last edit-date: [Fri Jan  5 11:39:32 2001]
  *
@@ -42,7 +42,7 @@
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.12 2002/04/08 12:20:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia.c,v 1.13 2002/04/10 23:51:09 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/errno.h>
@@ -435,7 +435,6 @@
        }
 
        /* init higher protocol layers */
-       isic_enable_intr(sc, 0);
        isic_attach_bri(sc, cardname, &isic_std_driver);
 
        return(0);



Home | Main Index | Thread Index | Old Index