-# $OpenBSD: files.amiga,v 1.12 1996/05/02 07:31:53 niklas Exp $
-# $NetBSD: files.amiga,v 1.44 1996/04/27 20:51:08 veego Exp $
+# $OpenBSD: files.amiga,v 1.13 1996/05/09 22:42:53 niklas Exp $
+# $NetBSD: files.amiga,v 1.45 1996/05/07 00:34:17 thorpej Exp $
# maxpartitions must be first item in files.${ARCH}
maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL!
attach gvpbus at zbus
file arch/amiga/dev/gvpbus.c gvpbus
-device le: ifnet, ether
+# device defined in sys/conf/files
attach le at zbus with le_zbus
file arch/amiga/dev/if_le.c le_zbus needs-flag
-/* $OpenBSD: if_le.c,v 1.4 1996/05/02 06:44:06 niklas Exp $ */
-/* $NetBSD: if_le.c,v 1.20 1996/04/22 02:33:08 christos Exp $ */
+/* $OpenBSD: if_le.c,v 1.5 1996/05/09 22:43:24 niklas Exp $ */
+/* $NetBSD: if_le.c,v 1.21 1996/05/07 00:35:07 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
#include <amiga/amiga/device.h>
#include <amiga/amiga/isr.h>
-#include <amiga/dev/zbusvar.h>
-#include <amiga/dev/if_levar.h>
+
#include <dev/ic/am7990reg.h>
-#define LE_NEED_BUF_CONTIG
#include <dev/ic/am7990var.h>
+#include <amiga/dev/zbusvar.h>
+#include <amiga/dev/if_levar.h>
+
/* offsets for: ID, REGS, MEM */
int lestd[] = { 0, 0x4000, 0x8000 };
-#define LE_SOFTC(unit) le_cd.cd_devs[unit]
-#define LE_DELAY(x) DELAY(x)
-
int le_zbus_match __P((struct device *, void *, void *));
void le_zbus_attach __P((struct device *, struct device *, void *));
-int leintr __P((void *));
struct cfattach le_zbus_ca = {
sizeof(struct le_softc), le_zbus_match, le_zbus_attach
};
-struct cfdriver le_cd = {
- NULL, "le", DV_IFNET
-};
-
-integrate void
-lehwinit(sc)
- struct le_softc *sc;
-{
-}
+hide void lewrcsr __P((struct am7990_softc *, u_int16_t, u_int16_t));
+hide u_int16_t lerdcsr __P((struct am7990_softc *, u_int16_t));
-integrate void
+hide void
lewrcsr(sc, port, val)
- struct le_softc *sc;
+ struct am7990_softc *sc;
u_int16_t port, val;
{
- struct lereg1 *ler1 = sc->sc_r1;
+ struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
ler1->ler1_rap = port;
ler1->ler1_rdp = val;
}
-integrate u_int16_t
+hide u_int16_t
lerdcsr(sc, port)
- struct le_softc *sc;
+ struct am7990_softc *sc;
u_int16_t port;
{
- struct lereg1 *ler1 = sc->sc_r1;
+ struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
u_int16_t val;
ler1->ler1_rap = port;
struct device *parent, *self;
void *aux;
{
- struct le_softc *sc = (void *)self;
+ struct le_softc *lesc = (struct le_softc *)self;
+ struct am7990_softc *sc = &lesc->sc_am7990;
struct zbus_args *zap = aux;
u_long ser;
- sc->sc_r1 = (struct lereg1 *)(lestd[1] + (int)zap->va);
+ lesc->sc_r1 = (struct lereg1 *)(lestd[1] + (int)zap->va);
sc->sc_mem = (void *)(lestd[2] + (int)zap->va);
sc->sc_copytodesc = am7990_copytobuf_contig;
sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
sc->sc_zerobuf = am7990_zerobuf_contig;
+ sc->sc_rdcsr = lerdcsr;
+ sc->sc_wrcsr = lewrcsr;
+ sc->sc_hwinit = NULL;
+
sc->sc_conf3 = LE_C3_BSWP;
sc->sc_addr = 0x8000;
break;
default:
- panic("leattach: bad manid");
+ panic("le_zbus_attach: bad manid");
}
/*
sc->sc_arpcom.ac_enaddr[4] = (ser >> 8) & 0xff;
sc->sc_arpcom.ac_enaddr[5] = (ser ) & 0xff;
- sc->sc_arpcom.ac_if.if_name = le_cd.cd_name;
- leconfig(sc);
+ am7990_config(sc);
- sc->sc_isr.isr_intr = leintr;
- sc->sc_isr.isr_arg = sc;
- sc->sc_isr.isr_ipl = 2;
- add_isr(&sc->sc_isr);
+ lesc->sc_isr.isr_intr = am7990_intr;
+ lesc->sc_isr.isr_arg = sc;
+ lesc->sc_isr.isr_ipl = 2;
+ add_isr(&lesc->sc_isr);
}
-
-#include <dev/ic/am7990.c>
-/* $OpenBSD: if_le_zbus.c,v 1.4 1996/05/02 06:44:06 niklas Exp $ */
-/* $NetBSD: if_le.c,v 1.20 1996/04/22 02:33:08 christos Exp $ */
+/* $OpenBSD: if_le_zbus.c,v 1.5 1996/05/09 22:43:24 niklas Exp $ */
+/* $NetBSD: if_le.c,v 1.21 1996/05/07 00:35:07 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
#include <amiga/amiga/device.h>
#include <amiga/amiga/isr.h>
-#include <amiga/dev/zbusvar.h>
-#include <amiga/dev/if_levar.h>
+
#include <dev/ic/am7990reg.h>
-#define LE_NEED_BUF_CONTIG
#include <dev/ic/am7990var.h>
+#include <amiga/dev/zbusvar.h>
+#include <amiga/dev/if_levar.h>
+
/* offsets for: ID, REGS, MEM */
int lestd[] = { 0, 0x4000, 0x8000 };
-#define LE_SOFTC(unit) le_cd.cd_devs[unit]
-#define LE_DELAY(x) DELAY(x)
-
int le_zbus_match __P((struct device *, void *, void *));
void le_zbus_attach __P((struct device *, struct device *, void *));
-int leintr __P((void *));
struct cfattach le_zbus_ca = {
sizeof(struct le_softc), le_zbus_match, le_zbus_attach
};
-struct cfdriver le_cd = {
- NULL, "le", DV_IFNET
-};
-
-integrate void
-lehwinit(sc)
- struct le_softc *sc;
-{
-}
+hide void lewrcsr __P((struct am7990_softc *, u_int16_t, u_int16_t));
+hide u_int16_t lerdcsr __P((struct am7990_softc *, u_int16_t));
-integrate void
+hide void
lewrcsr(sc, port, val)
- struct le_softc *sc;
+ struct am7990_softc *sc;
u_int16_t port, val;
{
- struct lereg1 *ler1 = sc->sc_r1;
+ struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
ler1->ler1_rap = port;
ler1->ler1_rdp = val;
}
-integrate u_int16_t
+hide u_int16_t
lerdcsr(sc, port)
- struct le_softc *sc;
+ struct am7990_softc *sc;
u_int16_t port;
{
- struct lereg1 *ler1 = sc->sc_r1;
+ struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1;
u_int16_t val;
ler1->ler1_rap = port;
struct device *parent, *self;
void *aux;
{
- struct le_softc *sc = (void *)self;
+ struct le_softc *lesc = (struct le_softc *)self;
+ struct am7990_softc *sc = &lesc->sc_am7990;
struct zbus_args *zap = aux;
u_long ser;
- sc->sc_r1 = (struct lereg1 *)(lestd[1] + (int)zap->va);
+ lesc->sc_r1 = (struct lereg1 *)(lestd[1] + (int)zap->va);
sc->sc_mem = (void *)(lestd[2] + (int)zap->va);
sc->sc_copytodesc = am7990_copytobuf_contig;
sc->sc_copyfrombuf = am7990_copyfrombuf_contig;
sc->sc_zerobuf = am7990_zerobuf_contig;
+ sc->sc_rdcsr = lerdcsr;
+ sc->sc_wrcsr = lewrcsr;
+ sc->sc_hwinit = NULL;
+
sc->sc_conf3 = LE_C3_BSWP;
sc->sc_addr = 0x8000;
break;
default:
- panic("leattach: bad manid");
+ panic("le_zbus_attach: bad manid");
}
/*
sc->sc_arpcom.ac_enaddr[4] = (ser >> 8) & 0xff;
sc->sc_arpcom.ac_enaddr[5] = (ser ) & 0xff;
- sc->sc_arpcom.ac_if.if_name = le_cd.cd_name;
- leconfig(sc);
+ am7990_config(sc);
- sc->sc_isr.isr_intr = leintr;
- sc->sc_isr.isr_arg = sc;
- sc->sc_isr.isr_ipl = 2;
- add_isr(&sc->sc_isr);
+ lesc->sc_isr.isr_intr = am7990_intr;
+ lesc->sc_isr.isr_arg = sc;
+ lesc->sc_isr.isr_ipl = 2;
+ add_isr(&lesc->sc_isr);
}
-
-#include <dev/ic/am7990.c>