Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/tc General cleanup: ANSIfy, white-space, remove unu...



details:   https://anonhg.NetBSD.org/src/rev/9b180c7e89a8
branches:  trunk
changeset: 515176:9b180c7e89a8
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Sep 18 12:46:33 2001 +0000

description:
General cleanup:  ANSIfy, white-space, remove unused #includes.
XXX: should be moved to arch/pmax/ibus - this is pmax specific.

diffstat:

 sys/dev/tc/if_le_ibus.c |  72 ++++++++++++------------------------------------
 1 files changed, 18 insertions(+), 54 deletions(-)

diffs (161 lines):

diff -r 9191cbc52936 -r 9b180c7e89a8 sys/dev/tc/if_le_ibus.c
--- a/sys/dev/tc/if_le_ibus.c   Tue Sep 18 11:08:05 2001 +0000
+++ b/sys/dev/tc/if_le_ibus.c   Tue Sep 18 12:46:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_ibus.c,v 1.16 2001/05/30 11:46:34 mrg Exp $      */
+/*     $NetBSD: if_le_ibus.c,v 1.17 2001/09/18 12:46:33 simonb Exp $   */
 
 /*
  * Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -21,11 +21,7 @@
 #include "opt_inet.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>
@@ -36,38 +32,20 @@
 #include <netinet/if_inarp.h>
 #endif
 
-#include <dev/ic/lancereg.h>
 #include <dev/ic/lancevar.h>
-#include <dev/ic/am7990reg.h>
 #include <dev/ic/am7990var.h>
 
 #include <dev/tc/if_levar.h>
-#include <dev/tc/tcvar.h>
 #include <pmax/ibus/ibusvar.h>
 #include <pmax/pmax/kn01.h>
 
-extern void le_dec_copytobuf_gap2 __P((struct lance_softc *, void *,
-           int, int));
-extern void le_dec_copyfrombuf_gap2 __P((struct lance_softc *, void *,
-           int, int));
-
-#if defined(_KERNEL_OPT)
-#include "opt_ddb.h"
-#endif
-
-#ifdef DDB
-#define        integrate
-#define hide
-#else
-#define        integrate       static __inline
-#define hide           static
-#endif
-
-hide void le_dec_zerobuf_gap2 __P((struct lance_softc *, int, int));
+static void le_dec_copyfrombuf_gap2(struct lance_softc *, void *, int, int);
+static void le_dec_copytobuf_gap2(struct lance_softc *, void *, int, int);
+static void le_dec_zerobuf_gap2(struct lance_softc *, int, int);
 
 
-int    le_pmax_match __P((struct device *, struct cfdata *, void *));
-void   le_pmax_attach __P((struct device *, struct device *, void *));
+static int le_pmax_match(struct device *, struct cfdata *, void *);
+static void le_pmax_attach(struct device *, struct device *, void *);
 
 struct cfattach le_pmax_ca = {
        sizeof(struct le_softc), le_pmax_match, le_pmax_attach
@@ -75,12 +53,9 @@
 extern struct cfdriver ibus_cd;
 
 int
-le_pmax_match(parent, match, aux)
-       struct device *parent;
-       struct cfdata *match;
-       void *aux;
+le_pmax_match(struct device *parent, struct cfdata *match, void *aux)
 {
-       struct ibus_attach_args *d = aux;
+       struct ibus_attach_args *d = aux;
 
        if (parent->dv_cfdata->cf_driver != &ibus_cd)
                return (0);
@@ -91,9 +66,7 @@
 }
 
 void
-le_pmax_attach(parent, self, aux)
-       struct device *parent, *self;
-       void *aux;
+le_pmax_attach(struct device *parent, struct device *self, void *aux)
 {
        struct le_softc *lesc = (void *)self;
        struct lance_softc *sc = &lesc->sc_am7990.lsc;
@@ -104,8 +77,8 @@
         * It's on the baseboard, with a dedicated interrupt line.
         */
        lesc->sc_r1 = (struct lereg1 *)(ia->ia_addr);
-/*XXX*/        sc->sc_mem = (void *)TC_PHYS_TO_UNCACHED(KN01_SYS_LANCE_B_START);
-/*XXX*/        cp = (u_char *)(TC_PHYS_TO_UNCACHED(KN01_SYS_CLOCK) + 1);
+       sc->sc_mem = (void *)MIPS_PHYS_TO_KSEG1(KN01_SYS_LANCE_B_START);
+       cp = (u_char *)(MIPS_PHYS_TO_KSEG1(KN01_SYS_CLOCK) + 1);
 
        sc->sc_copytodesc = le_dec_copytobuf_gap2;
        sc->sc_copyfromdesc = le_dec_copyfrombuf_gap2;
@@ -116,7 +89,7 @@
        dec_le_common_attach(&lesc->sc_am7990, cp);
 
        ibus_intr_establish(parent, (void*)ia->ia_cookie, IPL_NET,
-                         am7990_intr, sc);
+           am7990_intr, sc);
 }
 
 /*
@@ -127,21 +100,17 @@
  */
 
 void
-le_dec_copytobuf_gap2(sc, fromv, boff, len)
-       struct lance_softc *sc;  
-       void *fromv;
-       int boff;
-       int len;
+le_dec_copytobuf_gap2(struct lance_softc *sc, void *fromv, int boff, int len)
 {
        volatile caddr_t buf = sc->sc_mem;
        caddr_t from = fromv;
-       volatile u_int16_t *bptr;  
+       volatile u_int16_t *bptr;
 
        if (boff & 0x1) {
                /* handle unaligned first byte */
                bptr = ((volatile u_int16_t *)buf) + (boff - 1);
                *bptr = (*from++ << 8) | (*bptr & 0xff);
-               bptr += 2;  
+               bptr += 2;
                len--;
        } else
                bptr = ((volatile u_int16_t *)buf) + boff;
@@ -156,10 +125,7 @@
 }
 
 void
-le_dec_copyfrombuf_gap2(sc, tov, boff, len)
-       struct lance_softc *sc;
-       void *tov;
-       int boff, len;
+le_dec_copyfrombuf_gap2(struct lance_softc *sc, void *tov, int boff, int len)
 {
        volatile caddr_t buf = sc->sc_mem;
        caddr_t to = tov;
@@ -185,10 +151,8 @@
                *to = *bptr & 0xff;
 }
 
-void
-le_dec_zerobuf_gap2(sc, boff, len)
-       struct lance_softc *sc;
-       int boff, len;
+static void
+le_dec_zerobuf_gap2(struct lance_softc *sc, int boff, int len)
 {
        volatile caddr_t buf = sc->sc_mem;
        volatile u_int16_t *bptr;



Home | Main Index | Thread Index | Old Index