diff options
Diffstat (limited to 'sys/arch/sun3/dev/if_le.c')
-rw-r--r-- | sys/arch/sun3/dev/if_le.c | 74 |
1 files changed, 20 insertions, 54 deletions
diff --git a/sys/arch/sun3/dev/if_le.c b/sys/arch/sun3/dev/if_le.c index 10d21fcc04e..63d008828e7 100644 --- a/sys/arch/sun3/dev/if_le.c +++ b/sys/arch/sun3/dev/if_le.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_le.c,v 1.28 1996/04/22 02:25:54 christos Exp $ */ +/* $NetBSD: if_le.c,v 1.29 1996/05/07 01:32:31 thorpej Exp $ */ /*- * Copyright (c) 1995 Charles M. Hannum. All rights reserved. @@ -62,50 +62,39 @@ #include <machine/obio.h> #include <machine/idprom.h> -#include <sun3/dev/if_lereg.h> -#include <sun3/dev/if_levar.h> #include <dev/ic/am7990reg.h> -#define LE_NEED_BUF_CONTIG #include <dev/ic/am7990var.h> -#define LE_SOFTC(unit) le_cd.cd_devs[unit] -#define LE_DELAY(x) DELAY(x) +#include <sun3/dev/if_lereg.h> +#include <sun3/dev/if_levar.h> static int le_match __P((struct device *, void *, void *)); static void le_attach __P((struct device *, struct device *, void *)); -int leintr __P((void *)); struct cfattach le_ca = { sizeof(struct le_softc), le_match, le_attach }; -struct cfdriver le_cd = { - NULL, "le", DV_IFNET -}; +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 -lehwinit(sc) - struct le_softc *sc; -{ -} - -integrate void +hide void lewrcsr(sc, port, val) - struct le_softc *sc; + struct am7990_softc *sc; u_int16_t port, val; { - register struct lereg1 *ler1 = sc->sc_r1; + register 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; { - register struct lereg1 *ler1 = sc->sc_r1; + register struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1; u_int16_t val; ler1->ler1_rap = port; @@ -143,7 +132,8 @@ le_attach(parent, self, aux) 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 cfdata *cf = self->dv_cfdata; struct confargs *ca = aux; int intpri; @@ -153,7 +143,7 @@ le_attach(parent, self, aux) intpri = 3; printf(" level %d", intpri); - sc->sc_r1 = (struct lereg1 *) + lesc->sc_r1 = (struct lereg1 *) obio_alloc(ca->ca_paddr, OBIO_AMD_ETHER_SIZE); sc->sc_memsize = 0x4000; /* 16K */ @@ -169,36 +159,12 @@ le_attach(parent, self, aux) 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); + sc->sc_rdcsr = lerdcsr; + sc->sc_wrcsr = lewrcsr; + sc->sc_hwinit = NULL; - /* Install interrupt handler. */ - isr_add_autovect(leintr, (void *)sc, intpri); -} - -/* - * Compare two Ether/802 addresses for equality, inlined and - * unrolled for speed. I'd love to have an inline assembler - * version of this... XXX: Who wanted that? mycroft? - * I wrote one, but the following is just as efficient. - * This expands to 10 short m68k instructions! -gwr - * Note: use this like bcmp() - */ -static inline u_short -ether_cmp(one, two) - u_char *one, *two; -{ - register u_short *a = (u_short *) one; - register u_short *b = (u_short *) two; - register u_short diff; + am7990_config(sc); - diff = *a++ - *b++; - diff |= *a++ - *b++; - diff |= *a++ - *b++; - - return (diff); + /* Install interrupt handler. */ + isr_add_autovect(am7990_intr, (void *)sc, intpri); } - -#define ETHER_CMP ether_cmp - -#include <dev/ic/am7990.c> |