-/* $OpenBSD: am7990.c,v 1.5 1996/04/21 22:21:15 deraadt Exp $ */
-/* $NetBSD: am7990.c,v 1.16 1996/04/09 15:21:59 pk Exp $ */
+/* $OpenBSD: am7990.c,v 1.6 1996/05/02 13:51:45 deraadt Exp $ */
+/* $NetBSD: am7990.c,v 1.18 1996/04/22 02:40:50 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
lestart(ifp);
} else
printf("%s: card failed to initialize\n", sc->sc_dev.dv_xname);
+ lehwinit(sc);
}
/*
* Buffers may have any alignment.
*/
-integrate void
-copytobuf_contig(sc, from, boff, len)
+void
+am7990_copytobuf_contig(sc, from, boff, len)
struct le_softc *sc;
void *from;
int boff, len;
bcopy(from, buf + boff, len);
}
-integrate void
-copyfrombuf_contig(sc, to, boff, len)
+void
+am7990_copyfrombuf_contig(sc, to, boff, len)
struct le_softc *sc;
void *to;
int boff, len;
bcopy(buf + boff, to, len);
}
-integrate void
-zerobuf_contig(sc, boff, len)
+void
+am7990_zerobuf_contig(sc, boff, len)
struct le_softc *sc;
int boff, len;
{
* doing an extra byte.
*/
-integrate void
-copytobuf_gap2(sc, fromv, boff, len)
+void
+am7990_copytobuf_gap2(sc, fromv, boff, len)
struct le_softc *sc;
void *fromv;
int boff;
*bptr = (u_int16_t)*from;
}
-integrate void
-copyfrombuf_gap2(sc, tov, boff, len)
+void
+am7990_copyfrombuf_gap2(sc, tov, boff, len)
struct le_softc *sc;
void *tov;
int boff, len;
*to = *bptr & 0xff;
}
-integrate void
-zerobuf_gap2(sc, boff, len)
+void
+am7990_zerobuf_gap2(sc, boff, len)
struct le_softc *sc;
int boff, len;
{
* Buffers must be 32-byte aligned.
*/
-integrate void
-copytobuf_gap16(sc, fromv, boff, len)
+void
+am7990_copytobuf_gap16(sc, fromv, boff, len)
struct le_softc *sc;
void *fromv;
int boff;
}
}
-integrate void
-copyfrombuf_gap16(sc, tov, boff, len)
+void
+am7990_copyfrombuf_gap16(sc, tov, boff, len)
struct le_softc *sc;
void *tov;
int boff, len;
}
}
-integrate void
-zerobuf_gap16(sc, boff, len)
+void
+am7990_zerobuf_gap16(sc, boff, len)
struct le_softc *sc;
int boff, len;
{
-/* $OpenBSD: am7990var.h,v 1.3 1996/04/18 23:47:18 niklas Exp $ */
-/* $NetBSD: am7990var.h,v 1.4 1996/03/14 19:05:09 christos Exp $ */
+/* $OpenBSD: am7990var.h,v 1.4 1996/05/02 13:51:46 deraadt Exp $ */
+/* $NetBSD: am7990var.h,v 1.6 1996/04/22 02:40:49 christos Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
#ifdef DDB
#define integrate
#else
-#define integrate static inline
+#define integrate static __inline
#endif
void leconfig __P((struct le_softc *));
void lestop __P((struct le_softc *));
void lewatchdog __P((int));
+integrate void lehwinit __P((struct le_softc *));
integrate u_int16_t lerdcsr __P((struct le_softc *, u_int16_t));
integrate void lewrcsr __P((struct le_softc *, u_int16_t, u_int16_t));
* for drivers that have not yet been optimized.
*/
#ifdef LE_NEED_BUF_CONTIG
-integrate void copytobuf_contig __P((struct le_softc *, void *, int, int));
-integrate void copyfrombuf_contig __P((struct le_softc *, void *, int, int));
-integrate void zerobuf_contig __P((struct le_softc *, int, int));
+void am7990_copytobuf_contig __P((struct le_softc *, void *, int, int));
+void am7990_copyfrombuf_contig __P((struct le_softc *, void *, int, int));
+void am7990_zerobuf_contig __P((struct le_softc *, int, int));
#endif /* LE_NEED_BUF_CONTIG */
#ifdef LE_NEED_BUF_GAP2
-integrate void copytobuf_gap2 __P((struct le_softc *, void *, int, int));
-integrate void copyfrombuf_gap2 __P((struct le_softc *, void *, int, int));
-integrate void zerobuf_gap2 __P((struct le_softc *, int, int));
+void am7990_copytobuf_gap2 __P((struct le_softc *, void *, int, int));
+void am7990_copyfrombuf_gap2 __P((struct le_softc *, void *, int, int));
+void am7990_zerobuf_gap2 __P((struct le_softc *, int, int));
#endif /* LE_NEED_BUF_GAP2 */
#ifdef LE_NEED_BUF_GAP16
-integrate void copytobuf_gap16 __P((struct le_softc *, void *, int, int));
-integrate void copyfrombuf_gap16 __P((struct le_softc *, void *, int, int));
-integrate void zerobuf_gap16 __P((struct le_softc *, int, int));
+void am7990_copytobuf_gap16 __P((struct le_softc *, void *, int, int));
+void am7990_copyfrombuf_gap16 __P((struct le_softc *, void *, int, int));
+void am7990_zerobuf_gap16 __P((struct le_softc *, int, int));
#endif /* LE_NEED_BUF_GAP16 */
-/* $OpenBSD: if_le.c,v 1.8 1996/04/21 22:24:09 deraadt Exp $ */
-/* $NetBSD: if_le.c,v 1.41 1996/04/11 22:29:34 cgd Exp $ */
+/* $OpenBSD: if_le.c,v 1.9 1996/05/02 13:51:53 deraadt Exp $ */
+/* $NetBSD: if_le.c,v 1.43 1996/04/22 02:53:28 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
NULL, "le", DV_IFNET
};
+integrate void
+lehwinit(sc)
+ struct le_softc *sc;
+{
+}
+
integrate void
lewrcsr(sc, port, val)
struct le_softc *sc;
sc->sc_memsize = 16384;
}
- sc->sc_copytodesc = copytobuf_contig;
- sc->sc_copyfromdesc = copyfrombuf_contig;
- sc->sc_copytobuf = copytobuf_contig;
- sc->sc_copyfrombuf = copyfrombuf_contig;
- sc->sc_zerobuf = zerobuf_contig;
+ sc->sc_copytodesc = am7990_copytobuf_contig;
+ sc->sc_copyfromdesc = am7990_copyfrombuf_contig;
+ sc->sc_copytobuf = am7990_copytobuf_contig;
+ sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
+ sc->sc_zerobuf = am7990_zerobuf_contig;
sc->sc_arpcom.ac_if.if_name = le_cd.cd_name;
leconfig(sc);
-/* $OpenBSD: if_le.c,v 1.3 1996/04/21 22:26:24 deraadt Exp $ */
-/* $NetBSD: if_le.c,v 1.6 1996/04/08 20:09:56 jonathan Exp $ */
+/* $OpenBSD: if_le.c,v 1.4 1996/05/02 13:51:48 deraadt Exp $ */
+/* $NetBSD: if_le.c,v 1.9 1996/04/22 02:54:10 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
* @(#)if_le.c 8.2 (Berkeley) 11/16/93
*/
-
-/*
- * Supported busses: DEC IOCTL asic baseboard device, TurboChannel option,
- * plus baseboard device on "busless" DECstations.
- */
-#ifdef alpha
-#define CAN_HAVE_IOASIC 1
-#define CAN_HAVE_TC 1
-#endif
-#ifdef pmax
-#define CAN_HAVE_IOASIC 1
-#define CAN_HAVE_TC 1
-#define CAN_HAVE_MAINBUS 1
-#endif /* pmax */
-
-
-/*
- * For each bus on which a LANCE device might appear, determine
- * if that bus was configured into the current kernel.
- */
-
-#ifdef CAN_HAVE_MAINBUS
-/*XXX TEST FOR KN01 OR MIPSFAIR? */
-#endif
-#ifdef CAN_HAVE_TC
-#include "tc.h"
-#endif
-#ifdef CAN_HAVE_IOASIC
-#include "ioasic.h"
-#endif
-
#include "bpfilter.h"
#include <sys/param.h>
#include <netinet/if_ether.h>
#endif
-#include <machine/autoconf.h>
-
-#if CAN_HAVE_TC && (NTC > 0)
-#include <dev/tc/tcvar.h>
-#endif
-#if CAN_HAVE_IOASIC && (NIOASIC > 0)
-#include <dev/tc/ioasicvar.h>
-#endif
-#if CAN_HAVE_MAINBUS
-#include <pmax/pmax/kn01.h>
-#include <pmax/pmax/kn01var.h>
-extern struct cfdriver mainbus_cd; /* XXX */
-#endif
-
#include <dev/tc/if_levar.h>
#include <dev/ic/am7990reg.h>
#define LE_NEED_BUF_CONTIG
#define LE_NEED_BUF_GAP2
#define LE_NEED_BUF_GAP16
#include <dev/ic/am7990var.h>
+#include <dev/tc/tcvar.h>
/* access LANCE registers */
void lewritereg __P((volatile u_short *regptr, u_short val));
#define LERDWR(cntl, src, dst) { (dst) = (src); tc_mb(); }
#define LEWREG(src, dst) lewritereg(&(dst), (src))
-#define LE_OFFSET_RAM 0x0
-#define LE_OFFSET_LANCE 0x100000
-#define LE_OFFSET_ROM 0x1c0000
-
-extern caddr_t le_iomem;
-
#define LE_SOFTC(unit) le_cd.cd_devs[unit]
#define LE_DELAY(x) DELAY(x)
-int le_tc_match __P((struct device *, void *, void *));
-void le_tc_attach __P((struct device *, struct device *, void *));
-int leintr __P((void *));
-
-struct cfattach le_tc_ca = {
- sizeof(struct le_softc), le_tc_match, le_tc_attach
-};
-
struct cfdriver le_cd = {
NULL, "le", DV_IFNET
};
+void
+dec_le_common_attach(sc, eap)
+ struct le_softc *sc;
+ u_char *eap;
+{
+ int i;
+
+ 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_arpcom.ac_enaddr); i++) {
+ sc->sc_arpcom.ac_enaddr[i] = *eap;
+ eap += 4;
+ }
+
+ sc->sc_arpcom.ac_if.if_name = le_cd.cd_name;
+ leconfig(sc);
+}
+
+integrate void
+lehwinit(sc)
+ struct le_softc *sc;
+{
+}
+
integrate void
lewrcsr(sc, port, val)
struct le_softc *sc;
return (val);
}
-int
-le_tc_match(parent, match, aux)
- struct device *parent;
- void *match, *aux;
-{
-
-#if CAN_HAVE_IOASIC && (NIOASIC > 0)
- if (parent->dv_cfdata->cf_driver == &ioasic_cd) {
- struct ioasicdev_attach_args *d = aux;
-
- if (!ioasic_submatch(match, aux)) {
- return (0);
- }
- if (strncmp("lance", d->iada_modname, TC_ROM_LLEN)) {
- return (0);
- }
- } else
-#endif /* IOASIC */
-
-#if CAN_HAVE_TC && (NTC > 0)
- if (parent->dv_cfdata->cf_driver == &tc_cd) {
- struct tc_attach_args *d = aux;
-
- if (strncmp("PMAD-AA ", d->ta_modname, TC_ROM_LLEN) &&
- strncmp("PMAD-BA ", d->ta_modname, TC_ROM_LLEN))
- return (0);
- } else
-#endif /* TC */
-
-#if CAN_HAVE_MAINBUS && defined(DS3100)
- if (parent->dv_cfdata->cf_driver == &mainbus_cd) {
- struct confargs *d = aux;
- if (strcmp("lance", d->ca_name) != 0)
- return (0);
- } else
-#endif /* MAINBUS */
- return (0);
-
- return (1);
-}
-
-typedef void (*ie_fn_t) __P((struct device *, void *,
- tc_intrlevel_t, int (*)(void *), void *));
-
-void
-le_tc_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-{
- register struct le_softc *sc = (void *)self;
- ie_fn_t ie_fn;
- u_char *cp; /* pointer to MAC address */
- int i;
-
-#if CAN_HAVE_IOASIC && (NIOASIC > 0)
- if (parent->dv_cfdata->cf_driver == &ioasic_cd) {
- struct ioasicdev_attach_args *d = aux;
-
- /* It's on the system IOCTL ASIC */
- sc->sc_r1 = (struct lereg1 *)
- TC_DENSE_TO_SPARSE(TC_PHYS_TO_UNCACHED(d->iada_addr));
- sc->sc_mem = (void *)TC_PHYS_TO_UNCACHED(le_iomem);
- cp = ioasic_lance_ether_address();
-
- sc->sc_copytodesc = copytobuf_gap2;
- sc->sc_copyfromdesc = copyfrombuf_gap2;
- sc->sc_copytobuf = copytobuf_gap16;
- sc->sc_copyfrombuf = copyfrombuf_gap16;
- sc->sc_zerobuf = zerobuf_gap16;
-
- ioasic_lance_dma_setup(le_iomem); /* XXX more thought */
- ie_fn = ioasic_intr_establish;
- sc->sc_cookie = (void*)d->iada_cookie;
- } else
-#endif /* IOASIC */
-#if CAN_HAVE_TC && (NTC > 0)
- if (parent->dv_cfdata->cf_driver == &tc_cd) {
- struct tc_attach_args *d = aux;
-
- /*
- * It's on the turbochannel proper, or a kn02
- * baseboard implementation of a TC option card.
- */
- sc->sc_r1 = (struct lereg1 *)(d->ta_addr + LE_OFFSET_LANCE);
- sc->sc_mem = (void *)(d->ta_addr + LE_OFFSET_RAM);
- cp = (u_char *)(d->ta_addr + LE_OFFSET_ROM + 2);
-
- sc->sc_copytodesc = copytobuf_contig;
- sc->sc_copyfromdesc = copyfrombuf_contig;
- sc->sc_copytobuf = copytobuf_contig;
- sc->sc_copyfrombuf = copyfrombuf_contig;
- sc->sc_zerobuf = zerobuf_contig;
-
- sc->sc_cookie = d->ta_cookie;
- /*
- * TC lance boards have onboard SRAM buffers. DMA
- * between the onbard RAM and main memory is not possible,
- * so DMA setup is not required.
- */
- ie_fn = tc_intr_establish;
- } else
-#endif /* TC */
-#if CAN_HAVE_MAINBUS && defined(DS3100)
- if (parent->dv_cfdata->cf_driver == &mainbus_cd) {
- struct confargs *ca = aux;
-
- /*
- * It's on the baseboeard, with a dedicated interrupt line.
- */
-/*XXX*/ sc->sc_r1 = (struct lereg1 *)(ca->ca_addr);
-/*XXX*/ sc->sc_mem = (void *)TC_PHYS_TO_UNCACHED(0x19000000);
-/*XXX*/ cp = (u_char *)(TC_PHYS_TO_UNCACHED(KN01_SYS_CLOCK) + 1);
-
- sc->sc_copytodesc = copytobuf_gap2;
- sc->sc_copyfromdesc = copyfrombuf_gap2;
- sc->sc_copytobuf = copytobuf_gap2;
- sc->sc_copyfrombuf = copyfrombuf_gap2;
- sc->sc_zerobuf = zerobuf_gap2;
-
- sc->sc_cookie = (void *)ca->ca_slotpri; /*XXX more thought */
- ie_fn = (ie_fn_t) kn01_intr_establish;
- } else
-#endif /* MAINBUS */
-
- panic("le_tc_attach: can't be here");
-
- 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_arpcom.ac_enaddr); i++) {
- sc->sc_arpcom.ac_enaddr[i] = *cp;
- cp += 4;
- }
-
- sc->sc_arpcom.ac_if.if_name = le_cd.cd_name;
- leconfig(sc);
-
- (*ie_fn)(parent, sc->sc_cookie, TC_IPL_NET, leintr, sc);
-}
-
/*
* 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
--- /dev/null
+/* $NetBSD: if_le_ioasic.c,v 1.1 1996/04/18 00:50:13 cgd Exp $ */
+
+/*
+ * Copyright (c) 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+/*
+ * LANCE on DEC IOCTL ASIC.
+ */
+
+#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>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+#include <dev/tc/if_levar.h>
+#include <dev/ic/am7990reg.h>
+#define LE_NEED_BUF_GAP2
+#define LE_NEED_BUF_GAP16
+#include <dev/ic/am7990var.h>
+
+#include <dev/tc/tcvar.h>
+#include <dev/tc/ioasicvar.h>
+
+extern caddr_t le_iomem;
+
+int le_ioasic_match __P((struct device *, void *, void *));
+void le_ioasic_attach __P((struct device *, struct device *, void *));
+
+struct cfattach le_ioasic_ca = {
+ sizeof(struct le_softc), le_ioasic_match, le_ioasic_attach
+};
+
+int
+le_ioasic_match(parent, match, aux)
+ struct device *parent;
+ void *match, *aux;
+{
+ struct ioasicdev_attach_args *d = aux;
+
+ if (!ioasic_submatch(match, aux))
+ return (0);
+ if (strncmp("lance", d->iada_modname, TC_ROM_LLEN))
+ return (0);
+
+ return (1);
+}
+
+void
+le_ioasic_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ struct ioasicdev_attach_args *d = aux;
+ register struct le_softc *sc = (void *)self;
+
+ sc->sc_r1 = (struct lereg1 *)
+ TC_DENSE_TO_SPARSE(TC_PHYS_TO_UNCACHED(d->iada_addr));
+ sc->sc_mem = (void *)TC_PHYS_TO_UNCACHED(le_iomem);
+
+ sc->sc_copytodesc = am7990_copytobuf_gap2;
+ sc->sc_copyfromdesc = am7990_copyfrombuf_gap2;
+ sc->sc_copytobuf = am7990_copytobuf_gap16;
+ sc->sc_copyfrombuf = am7990_copyfrombuf_gap16;
+ sc->sc_zerobuf = am7990_zerobuf_gap16;
+
+ ioasic_lance_dma_setup(le_iomem); /* XXX more thought */
+
+ dec_le_common_attach(sc, ioasic_lance_ether_address());
+
+ ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_NET, leintr, sc);
+}
--- /dev/null
+/* $NetBSD: if_le_tc.c,v 1.1 1996/04/18 00:50:14 cgd Exp $ */
+
+/*
+ * Copyright (c) 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+/*
+ * LANCE on TurboChannel.
+ */
+
+#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>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+#include <dev/tc/if_levar.h>
+#include <dev/ic/am7990reg.h>
+#define LE_NEED_BUF_CONTIG
+#include <dev/ic/am7990var.h>
+
+#include <dev/tc/tcvar.h>
+
+int le_tc_match __P((struct device *, void *, void *));
+void le_tc_attach __P((struct device *, struct device *, void *));
+
+struct cfattach le_tc_ca = {
+ sizeof(struct le_softc), le_tc_match, le_tc_attach
+};
+
+#define LE_OFFSET_RAM 0x0
+#define LE_OFFSET_LANCE 0x100000
+#define LE_OFFSET_ROM 0x1c0000
+
+int
+le_tc_match(parent, match, aux)
+ struct device *parent;
+ void *match, *aux;
+{
+ struct tc_attach_args *d = aux;
+
+ if (strncmp("PMAD-AA ", d->ta_modname, TC_ROM_LLEN) &&
+ strncmp("PMAD-BA ", d->ta_modname, TC_ROM_LLEN))
+ return (0);
+
+ return (1);
+}
+
+void
+le_tc_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ register struct le_softc *sc = (void *)self;
+ struct tc_attach_args *d = aux;
+
+ /*
+ * It's on the turbochannel proper, or a kn02
+ * baseboard implementation of a TC option card.
+ */
+ sc->sc_r1 = (struct lereg1 *)(d->ta_addr + LE_OFFSET_LANCE);
+ sc->sc_mem = (void *)(d->ta_addr + LE_OFFSET_RAM);
+
+ sc->sc_copytodesc = am7990_copytobuf_contig;
+ sc->sc_copyfromdesc = am7990_copyfrombuf_contig;
+ sc->sc_copytobuf = am7990_copytobuf_contig;
+ sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
+ sc->sc_zerobuf = am7990_zerobuf_contig;
+
+ /*
+ * TC lance boards have onboard SRAM buffers. DMA
+ * between the onbard RAM and main memory is not possible,
+ * so DMA setup is not required.
+ */
+
+ dec_le_common_attach(sc, (u_char *)(d->ta_addr + LE_OFFSET_ROM + 2));
+
+ tc_intr_establish(parent, d->ta_cookie, TC_IPL_NET, leintr, sc);
+}
-/* $NetBSD: if_levar.h,v 1.1 1995/12/20 00:52:18 cgd Exp $ */
+/* $NetBSD: if_levar.h,v 1.2 1996/04/18 00:50:15 cgd Exp $ */
/*-
* Copyright (c) 1992, 1993
struct device sc_dev; /* base structure */
struct arpcom sc_arpcom; /* Ethernet common part */
- void *sc_cookie; /* bus interrupt/DMA cookie */
-
void (*sc_copytodesc) /* Copy to descriptor */
__P((struct le_softc *, void *, int, int));
void (*sc_copyfromdesc) /* Copy from descriptor */
struct lereg1 *sc_r1; /* LANCE registers */
};
+
+int leintr __P((void *));
+void dec_le_common_attach __P((struct le_softc *, u_char *));
-/* $OpenBSD: tc.c,v 1.3 1996/04/21 22:26:28 deraadt Exp $ */
-/* $NetBSD: tc.c,v 1.13 1996/04/09 20:50:06 jonathan Exp $ */
+/* $OpenBSD: tc.c,v 1.4 1996/05/02 13:51:51 deraadt Exp $ */
+/* $NetBSD: tc.c,v 1.14 1996/04/18 01:12:41 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
- *
+ *
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
+ *
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
#include <dev/tc/tcvar.h>
#include <dev/tc/tcdevs.h>
-#include <machine/autoconf.h>
-
struct tc_softc {
struct device sc_dv;
if (strcmp(tba->tba_busname, cf->cf_driver->cd_name))
return (0);
- /* XXX check other indicators */
-
return (1);
}
ta.ta_addr = tcaddr;
ta.ta_cookie = builtin->tcb_cookie;
ta.ta_busspeed = sc->sc_speed;
-
+
/*
* Mark the slot as used, so we don't check it later.
*/
if (pnp) {
tc_devinfo(ta->ta_modname, devinfo);
- printf("%s at %s", devinfo, pnp);
+ printf("%s at %s", devinfo, pnp);
}
printf(" slot %d offset 0x%lx", ta->ta_slot,
(long)ta->ta_offset);
return (UNCONF);
}
-int
-tcsubmatch(parent, match, aux)
- struct device *parent;
- void *match, *aux;
+int
+tcsubmatch(parent, match, aux)
+ struct device *parent;
+ void *match, *aux;
{
struct cfdata *cf = match;
struct tc_attach_args *d = aux;
{
struct tc_softc *sc = (struct tc_softc *)dev;
- (*sc->sc_intr_establish)(sc->sc_dv.dv_parent, cookie, level,
+ (*sc->sc_intr_establish)(sc->sc_dv.dv_parent, cookie, level,
handler, arg);
}
}
#ifdef TCVERBOSE
-/*
+/*
* Descriptions of of known devices.
- */
+ */
struct tc_knowndev {
const char *id, *driver, *description;
-};
+};
#include <dev/tc/tcdevs_data.h>
#endif /* TCVERBOSE */