diff options
| author | jonathan <jonathan@NetBSD.org> | 1997-07-22 04:32:13 +0000 |
|---|---|---|
| committer | jonathan <jonathan@NetBSD.org> | 1997-07-22 04:32:13 +0000 |
| commit | 064c4e515c418e348aa4533bd2f4196087e02ac3 (patch) | |
| tree | 217720789938707a3a7a16594b9f7bbbbe886e85 /sys/dev | |
| parent | 38e9259a81b6969c40edee3ba324406658bad497 (diff) | |
Create sys/dev/dec and cleanup sys/dev/tc:
* Move clockvar.h (header file for generic clock code) to sys/dev/dec.
* Move if_le_dec.c with DEC padded LANCE-dma (pmax/pmax, ioasic, vax 3400)
to sys/dev/dec. Remove from sys/dev/tc.
* Declare attribute le_dec_subr in /sys/dev/dec/files.dec,
use if_le_dec.c when it's defined.
* Move IOCTL asic declaration from pmax and Alpha MD machine
files to sys/dev/tc/files.tc.
* move TurboChannel and ioasic if_le attachments from pmax and Alpha machine
config files to /sys/dev/tc/files.tc. Add le_dec_subr attribute.
* Add if_le_dec attribute to if_le_ibus (pmax ds3100 pmax) LANCE attachment.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/dec/files.dec | 12 | ||||
| -rw-r--r-- | sys/dev/dec/if_le_dec.c | 5 | ||||
| -rw-r--r-- | sys/dev/tc/files.tc | 24 | ||||
| -rw-r--r-- | sys/dev/tc/if_le_dec.c | 162 |
4 files changed, 31 insertions, 172 deletions
diff --git a/sys/dev/dec/files.dec b/sys/dev/dec/files.dec new file mode 100644 index 00000000000..5ed9feb342c --- /dev/null +++ b/sys/dev/dec/files.dec @@ -0,0 +1,12 @@ +# $NetBSD: files.dec,v 1.1 1997/07/22 04:32:20 jonathan Exp $ +# +# Config file and device description for machine-independent +# code for devices for Digital Equipment Corp. systems. +# Included by ports that need it. + +# Attribute for DEC lance padded-DMA copy functions. Lance attachments +# which need it should specify the le_de_subr attribute. +define le_dec_subr + +# DMA copy functions. Lance attachments qhich Decices +file dev/tc/if_le_dec.c le_dec_subr diff --git a/sys/dev/dec/if_le_dec.c b/sys/dev/dec/if_le_dec.c index 74a3250ad25..67769010508 100644 --- a/sys/dev/dec/if_le_dec.c +++ b/sys/dev/dec/if_le_dec.c @@ -1,6 +1,7 @@ -/* $NetBSD: if_le_dec.c,v 1.7 1997/06/16 03:46:35 jonathan Exp $ */ +/* $NetBSD: if_le_dec.c,v 1.8 1997/07/22 04:32:21 jonathan Exp $ */ /*- + * Copyright (c) 1997 Jonathan Stone. All rights reserved. * Copyright (c) 1995 Charles M. Hannum. All rights reserved. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -154,7 +155,7 @@ le_dec_writereg(regptr, val) * 3 ways: * - contiguous (for the 3max and turbochannel option card) * - gap2, which means shorts (2 bytes) interspersed with short (2 byte) - * spaces (for the pmax) + * spaces (for the pmax, vax 3400, and ioasic LANCE descriptors) * - gap16, which means 16bytes interspersed with 16byte spaces * for buffers which must begin on a 32byte boundary (for 3min, maxine, * and alpha) diff --git a/sys/dev/tc/files.tc b/sys/dev/tc/files.tc index 931de8c5606..cd5e83e662a 100644 --- a/sys/dev/tc/files.tc +++ b/sys/dev/tc/files.tc @@ -1,18 +1,26 @@ -# $NetBSD: files.tc,v 1.7 1997/07/20 20:32:14 pk Exp $ +# $NetBSD: files.tc,v 1.8 1997/07/22 04:32:26 jonathan Exp $ # # Config file and device description for machine-independent # TurboChannel code. Included by ports that need it. device tc {[slot = -1], [offset = -1]} -attach tc at tcbus +#attach tc at tcbus file dev/tc/tc.c tc needs-flag -# device defined in sys/conf/files -# attach le at ioasic with le_ioasic -# attach le at tc with le_tc -# file dev/tc/if_le_dec.c (le_ioasic | le_tc) -# file dev/tc/if_le_ioasic.c le_ioasic needs-flag # for le_iomem -# file dev/tc/if_le_tc.c le_tc +# The TurboChannel IOCTL ASIC +device ioasic { offset = -1 } +attach ioasic at tc + +# LANCE attachments. +# lance device defined in sys/conf/files +# le_dec_subr attribute defined in sys/dev/dec/files.dec + +attach le at ioasic with le_ioasic: le_dec_subr +attach le at tc with le_tc: le_dec_subr + +file dev/tc/if_le_ioasic.c le_ioasic needs-flag # for le_iomem +file dev/tc/if_le_tc.c le_tc + # DEC DEFTA TC FDDI Controller device fta: pdq, fddi, ifnet, arp diff --git a/sys/dev/tc/if_le_dec.c b/sys/dev/tc/if_le_dec.c deleted file mode 100644 index 74a3250ad25..00000000000 --- a/sys/dev/tc/if_le_dec.c +++ /dev/null @@ -1,162 +0,0 @@ -/* $NetBSD: if_le_dec.c,v 1.7 1997/06/16 03:46:35 jonathan Exp $ */ - -/*- - * Copyright (c) 1995 Charles M. Hannum. All rights reserved. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)if_le.c 8.2 (Berkeley) 11/16/93 - */ - -#include "bpfilter.h" - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/mbuf.h> -#include <sys/syslog.h> -#include <sys/socket.h> -#include <sys/device.h> - -#include <net/if.h> -#include <net/if_ether.h> -#include <net/if_media.h> - -#ifdef INET -#include <netinet/in.h> -#include <netinet/if_inarp.h> -#endif - -#include <dev/ic/am7990reg.h> -#include <dev/ic/am7990var.h> - -#include <dev/tc/if_levar.h> -#include <dev/tc/tcvar.h> - -#include <machine/bus.h> - -/* access LANCE registers */ -void le_dec_writereg __P((volatile u_short *regptr, u_short val)); -#define LERDWR(cntl, src, dst) { (dst) = (src); tc_mb(); } -#define LEWREG(src, dst) le_dec_writereg(&(dst), (src)) - -hide void le_dec_wrcsr __P((struct am7990_softc *, u_int16_t, u_int16_t)); -hide u_int16_t le_dec_rdcsr __P((struct am7990_softc *, u_int16_t)); - -void -dec_le_common_attach(sc, eap) - struct am7990_softc *sc; - u_char *eap; -{ - int i; - - sc->sc_rdcsr = le_dec_rdcsr; - sc->sc_wrcsr = le_dec_wrcsr; - sc->sc_hwinit = NULL; - - sc->sc_conf3 = 0; - sc->sc_addr = 0; - sc->sc_memsize = 65536; - - /* - * Get the ethernet address out of rom - */ - for (i = 0; i < sizeof(sc->sc_enaddr); i++) { - sc->sc_enaddr[i] = *eap; - eap += 4; - } - - am7990_config(sc); -} - -hide void -le_dec_wrcsr(sc, port, val) - struct am7990_softc *sc; - u_int16_t port, val; -{ - struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1; - - LEWREG(port, ler1->ler1_rap); - LERDWR(port, val, ler1->ler1_rdp); -} - -hide u_int16_t -le_dec_rdcsr(sc, port) - struct am7990_softc *sc; - u_int16_t port; -{ - struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1; - u_int16_t val; - - LEWREG(port, ler1->ler1_rap); - LERDWR(0, ler1->ler1_rdp, val); - return (val); -} - -/* - * Write a lance register port, reading it back to ensure success. This seems - * to be necessary during initialization, since the chip appears to be a bit - * pokey sometimes. - */ -void -le_dec_writereg(regptr, val) - register volatile u_short *regptr; - register u_short val; -{ - register int i = 0; - - while (*regptr != val) { - *regptr = val; - tc_mb(); - if (++i > 10000) { - printf("le: Reg did not settle (to x%x): x%x\n", val, - *regptr); - return; - } - DELAY(100); - } -} - -/* - * Routines for accessing the transmit and receive buffers are provided - * by am7990.c, because of the LE_NEED_BUF_* macros defined above. - * Unfortunately, CPU addressing of these buffers is done in one of - * 3 ways: - * - contiguous (for the 3max and turbochannel option card) - * - gap2, which means shorts (2 bytes) interspersed with short (2 byte) - * spaces (for the pmax) - * - gap16, which means 16bytes interspersed with 16byte spaces - * for buffers which must begin on a 32byte boundary (for 3min, maxine, - * and alpha) - * The buffer offset is the logical byte offset, assuming contiguous storage. - */ |
