Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa Allow this work work without a DRQ for PCNet par...



details:   https://anonhg.NetBSD.org/src/rev/bddedaaac633
branches:  trunk
changeset: 533384:bddedaaac633
user:      rafal <rafal%NetBSD.org@localhost>
date:      Sat Jun 29 05:30:44 2002 +0000

description:
Allow this work work without a DRQ for PCNet parts mapped into ISA space
but which are connected to a local bus and do their own bus-mastering.
This has to be turned on via `flags 1' on the nele? device specification.
Gets one of my boxes working again with -current again.

diffstat:

 sys/dev/isa/if_le_isa.c |  35 +++++++++++++++++++++++------------
 sys/dev/isa/if_levar.h  |   4 +++-
 2 files changed, 26 insertions(+), 13 deletions(-)

diffs (117 lines):

diff -r aaa5f1112f7f -r bddedaaac633 sys/dev/isa/if_le_isa.c
--- a/sys/dev/isa/if_le_isa.c   Sat Jun 29 05:20:15 2002 +0000
+++ b/sys/dev/isa/if_le_isa.c   Sat Jun 29 05:30:44 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_isa.c,v 1.30 2002/06/29 05:20:15 rafal Exp $     */
+/*     $NetBSD: if_le_isa.c,v 1.31 2002/06/29 05:30:44 rafal Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_isa.c,v 1.30 2002/06/29 05:20:15 rafal Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_isa.c,v 1.31 2002/06/29 05:30:44 rafal Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -137,7 +137,8 @@
        0, 2
 };
 
-int lance_isa_probe __P((struct isa_attach_args *, struct le_isa_params *));
+int lance_isa_probe __P((struct isa_attach_args *, 
+                        struct le_isa_params *, int));
 void le_isa_attach __P((struct device *, struct le_softc *,
                        struct isa_attach_args *, struct le_isa_params *));
 
@@ -194,7 +195,7 @@
        struct cfdata *match;
        void *aux;
 {
-       return (lance_isa_probe(aux, &ne2100_params));
+       return (lance_isa_probe(aux, &ne2100_params, match->cf_flags));
 }
 
 int
@@ -203,16 +204,17 @@
        struct cfdata *match;
        void *aux;
 {
-       return (lance_isa_probe(aux, &bicc_params));
+       return (lance_isa_probe(aux, &bicc_params, match->cf_flags));
 }
 
 /*
  * Determine which chip is present on the card.
  */
 int
-lance_isa_probe(ia, p)
+lance_isa_probe(ia, p, flags)
        struct isa_attach_args *ia;
        struct le_isa_params *p;
+       int flags;
 {
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
@@ -234,7 +236,8 @@
                return (0);
        if (ia->ia_irq[0].ir_irq == ISACF_IRQ_DEFAULT)
                return (0);
-       if (ia->ia_drq[0].ir_drq == ISACF_DRQ_DEFAULT)
+       if ((flags & LANCEISA_FLAG_LOCALBUS) == 0 && 
+           ia->ia_drq[0].ir_drq == ISACF_DRQ_DEFAULT)
                return (0);
 
        /* Map i/o space. */
@@ -260,7 +263,12 @@
        ia->ia_io[0].ir_size = p->iosize;
 
        ia->ia_nirq = 1;
-       ia->ia_ndrq = 1;
+
+       if ((flags & LANCEISA_FLAG_LOCALBUS) != 0 &&
+           ia->ia_drq[0].ir_drq == ISACF_DRQ_DEFAULT)
+           ia->ia_ndrq = 0;
+       else
+           ia->ia_ndrq = 1;
 
        ia->ia_niomem = 0;
 
@@ -387,10 +395,13 @@
        sc->sc_wrcsr = le_isa_wrcsr;
        sc->sc_hwinit = NULL;
 
-       if ((error = isa_dmacascade(ia->ia_ic, ia->ia_drq[0].ir_drq)) != 0) {
-               printf("%s: unable to cascade DRQ, error = %d\n",
-                   sc->sc_dev.dv_xname, error);
-               return;
+       if (ia->ia_ndrq > 0) {
+               if ((error = isa_dmacascade(ia->ia_ic, 
+                                           ia->ia_drq[0].ir_drq)) != 0) {
+                       printf("%s: unable to cascade DRQ, error = %d\n",
+                                   sc->sc_dev.dv_xname, error);
+                       return;
+               }
        }
 
        lesc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq,
diff -r aaa5f1112f7f -r bddedaaac633 sys/dev/isa/if_levar.h
--- a/sys/dev/isa/if_levar.h    Sat Jun 29 05:20:15 2002 +0000
+++ b/sys/dev/isa/if_levar.h    Sat Jun 29 05:30:44 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_levar.h,v 1.12 1998/08/15 10:51:19 mycroft Exp $    */
+/*     $NetBSD: if_levar.h,v 1.13 2002/06/29 05:30:44 rafal Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -42,6 +42,8 @@
 #define        NE2100_RDP      0x10
 #define        NE2100_RAP      0x12
 
+#define LANCEISA_FLAG_LOCALBUS 1
+
 /*
  * Ethernet software status per interface.
  *



Home | Main Index | Thread Index | Old Index