Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic - use ANSI function decls



details:   https://anonhg.NetBSD.org/src/rev/f78e78eddf1c
branches:  trunk
changeset: 572405:f78e78eddf1c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jan 02 12:41:03 2005 +0000

description:
- use ANSI function decls
- remove __P()
- u_intNN_t -> uintNN_t

diffstat:

 sys/dev/ic/mb86960.c    |  158 +++++++++++++++++------------------------------
 sys/dev/ic/mb86960var.h |   50 +++++++-------
 2 files changed, 83 insertions(+), 125 deletions(-)

diffs (truncated from 518 to 300 lines):

diff -r abb4d5d2967a -r f78e78eddf1c sys/dev/ic/mb86960.c
--- a/sys/dev/ic/mb86960.c      Sun Jan 02 12:22:18 2005 +0000
+++ b/sys/dev/ic/mb86960.c      Sun Jan 02 12:41:03 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mb86960.c,v 1.58 2004/10/30 18:08:37 thorpej Exp $     */
+/*     $NetBSD: mb86960.c,v 1.59 2005/01/02 12:41:03 tsutsui Exp $     */
 
 /*
  * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.58 2004/10/30 18:08:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.59 2005/01/02 12:41:03 tsutsui Exp $");
 
 /*
  * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
@@ -100,37 +100,35 @@
 #endif /* __BUS_SPACE_HAS_STREAM_METHODS */
 
 /* Standard driver entry points.  These can be static. */
-void   mb86960_init    __P((struct mb86960_softc *));
-int    mb86960_ioctl   __P((struct ifnet *, u_long, caddr_t));
-void   mb86960_start   __P((struct ifnet *));
-void   mb86960_reset   __P((struct mb86960_softc *));
-void   mb86960_watchdog __P((struct ifnet *));
+void   mb86960_init(struct mb86960_softc *);
+int    mb86960_ioctl(struct ifnet *, u_long, caddr_t);
+void   mb86960_start(struct ifnet *);
+void   mb86960_reset(struct mb86960_softc *);
+void   mb86960_watchdog(struct ifnet *);
 
 /* Local functions.  Order of declaration is confused.  FIXME. */
-int    mb86960_get_packet __P((struct mb86960_softc *, u_int));
-void   mb86960_stop __P((struct mb86960_softc *));
-void   mb86960_tint __P((struct mb86960_softc *, u_int8_t));
-void   mb86960_rint __P((struct mb86960_softc *, u_int8_t));
+int    mb86960_get_packet(struct mb86960_softc *, u_int);
+void   mb86960_stop(struct mb86960_softc *);
+void   mb86960_tint(struct mb86960_softc *, uint8_t);
+void   mb86960_rint(struct mb86960_softc *, uint8_t);
 static __inline__
-void   mb86960_xmit __P((struct mb86960_softc *));
-void   mb86960_write_mbufs __P((struct mb86960_softc *, struct mbuf *));
+void   mb86960_xmit(struct mb86960_softc *);
+void   mb86960_write_mbufs(struct mb86960_softc *, struct mbuf *);
 static __inline__
-void   mb86960_droppacket __P((struct mb86960_softc *));
-void   mb86960_getmcaf __P((struct ethercom *, u_int8_t *));
-void   mb86960_setmode __P((struct mb86960_softc *));
-void   mb86960_loadmar __P((struct mb86960_softc *));
+void   mb86960_droppacket(struct mb86960_softc *);
+void   mb86960_getmcaf(struct ethercom *, uint8_t *);
+void   mb86960_setmode(struct mb86960_softc *);
+void   mb86960_loadmar(struct mb86960_softc *);
 
-int    mb86960_mediachange __P((struct ifnet *));
-void   mb86960_mediastatus __P((struct ifnet *, struct ifmediareq *));
+int    mb86960_mediachange(struct ifnet *);
+void   mb86960_mediastatus(struct ifnet *, struct ifmediareq *);
 
 #if FE_DEBUG >= 1
-void   mb86960_dump __P((int, struct mb86960_softc *));
+void   mb86960_dump(int, struct mb86960_softc *);
 #endif
 
 void
-mb86960_attach(sc, myea)
-       struct mb86960_softc *sc;
-       u_int8_t *myea;
+mb86960_attach(struct mb86960_softc *sc, uint8_t *myea)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -189,9 +187,7 @@
  * Install interface into kernel networking data structures
  */
 void
-mb86960_config(sc, media, nmedia, defmedia)
-       struct mb86960_softc *sc;
-       int *media, nmedia, defmedia;
+mb86960_config(struct mb86960_softc *sc, int *media, int nmedia, int defmedia)
 {
        struct cfdata *cf = sc->sc_dev.dv_cfdata;
        struct ifnet *ifp = &sc->sc_ec.ec_if;
@@ -339,8 +335,7 @@
  * Media change callback.
  */
 int
-mb86960_mediachange(ifp)
-       struct ifnet *ifp;
+mb86960_mediachange(struct ifnet *ifp)
 {
        struct mb86960_softc *sc = ifp->if_softc;
 
@@ -353,9 +348,7 @@
  * Media status callback.
  */
 void
-mb86960_mediastatus(ifp, ifmr)
-       struct ifnet *ifp;
-       struct ifmediareq *ifmr;
+mb86960_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
 {
        struct mb86960_softc *sc = ifp->if_softc;
 
@@ -373,8 +366,7 @@
  * Reset interface.
  */
 void
-mb86960_reset(sc)
-       struct mb86960_softc *sc;
+mb86960_reset(struct mb86960_softc *sc)
 {
        int s;
 
@@ -391,8 +383,7 @@
  * if any, will be lost by stopping the interface.
  */
 void
-mb86960_stop(sc)
-       struct mb86960_softc *sc;
+mb86960_stop(struct mb86960_softc *sc)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -440,8 +431,7 @@
  * generate an interrupt after a transmit has been started on it.
  */
 void
-mb86960_watchdog(ifp)
-       struct ifnet *ifp;
+mb86960_watchdog(struct ifnet *ifp)
 {
        struct mb86960_softc *sc = ifp->if_softc;
 
@@ -460,8 +450,7 @@
  * Drop (skip) a packet from receive buffer in 86960 memory.
  */
 static __inline__ void
-mb86960_droppacket(sc)
-       struct mb86960_softc *sc;
+mb86960_droppacket(struct mb86960_softc *sc)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -473,8 +462,7 @@
  * Initialize device.
  */
 void
-mb86960_init(sc)
-       struct mb86960_softc *sc;
+mb86960_init(struct mb86960_softc *sc)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -632,8 +620,7 @@
  * This routine actually starts the transmission on the interface
  */
 static __inline__ void
-mb86960_xmit(sc)
-       struct mb86960_softc *sc;
+mb86960_xmit(struct mb86960_softc *sc)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -669,8 +656,7 @@
  *     (i.e. that the output part of the interface is idle)
  */
 void
-mb86960_start(ifp)
-       struct ifnet *ifp;
+mb86960_start(struct ifnet *ifp)
 {
        struct mb86960_softc *sc = ifp->if_softc;
        struct mbuf *m;
@@ -818,9 +804,7 @@
  * The control flow of this function looks silly.  FIXME.
  */
 void
-mb86960_tint(sc, tstat)
-       struct mb86960_softc *sc;
-       u_int8_t tstat;
+mb86960_tint(struct mb86960_softc *sc, uint8_t tstat)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -959,9 +943,7 @@
  * Ethernet interface receiver interrupt.
  */
 void
-mb86960_rint(sc, rstat)
-       struct mb86960_softc *sc;
-       u_int8_t rstat;
+mb86960_rint(struct mb86960_softc *sc, uint8_t rstat)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -1104,14 +1086,13 @@
  * Ethernet interface interrupt processor
  */
 int
-mb86960_intr(arg)
-       void *arg;
+mb86960_intr(void *arg)
 {
        struct mb86960_softc *sc = arg;
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
        struct ifnet *ifp = &sc->sc_ec.ec_if;
-       u_int8_t tstat, rstat;
+       uint8_t tstat, rstat;
 
        if ((sc->sc_stat & FE_STAT_ENABLED) == 0 ||
            (sc->sc_dev.dv_flags & DVF_ACTIVE) == 0)
@@ -1195,10 +1176,7 @@
  * Process an ioctl request.  This code needs some work - it looks pretty ugly.
  */
 int
-mb86960_ioctl(ifp, cmd, data)
-       struct ifnet *ifp;
-       u_long cmd;
-       caddr_t data;
+mb86960_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
        struct mb86960_softc *sc = ifp->if_softc;
        struct ifaddr *ifa = (struct ifaddr *)data;
@@ -1326,9 +1304,7 @@
  * Returns 0 if success, -1 if error (i.e., mbuf allocation failure).
  */
 int
-mb86960_get_packet(sc, len)
-       struct mb86960_softc *sc;
-       u_int len;
+mb86960_get_packet(struct mb86960_softc *sc, u_int len)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -1378,10 +1354,10 @@
        /* Get a packet. */
        if (sc->sc_flags & FE_FLAGS_SBW_BYTE)
                bus_space_read_multi_1(bst, bsh, FE_BMPR8,
-                   mtod(m, u_int8_t *), len);
+                   mtod(m, uint8_t *), len);
        else
                bus_space_read_multi_stream_2(bst, bsh, FE_BMPR8,
-                   mtod(m, u_int16_t *), (len + 1) >> 1);
+                   mtod(m, uint16_t *), (len + 1) >> 1);
 
 #if NBPFILTER > 0
        /*
@@ -1414,9 +1390,7 @@
  * system performance (slightly).
  */
 void
-mb86960_write_mbufs(sc, m)
-       struct mb86960_softc *sc;
-       struct mbuf *m;
+mb86960_write_mbufs(struct mb86960_softc *sc, struct mbuf *m)
 {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
@@ -1517,12 +1491,12 @@
                for (; m != NULL; m = m->m_next) {
                        if (m->m_len) {
                                bus_space_write_multi_1(bst, bsh, FE_BMPR8,
-                                   mtod(m, u_int8_t *), m->m_len);
+                                   mtod(m, uint8_t *), m->m_len);
                        }
                }
        } else {
                /* a bit trickier in word mode. */
-               u_int8_t *data, savebyte[2];
+               uint8_t *data, savebyte[2];
                int leftover;
 
                leftover = 0;
@@ -1532,7 +1506,7 @@
                        len = m->m_len;
                        if (len == 0)
                                continue;
-                       data = mtod(m, u_int8_t *);
+                       data = mtod(m, uint8_t *);
                        while (len > 0) {
                                if (leftover) {
                                        /*
@@ -1544,10 +1518,10 @@
                                        savebyte[1] = *data++;
                                        len--;
                                        bus_space_write_stream_2(bst, bsh,
-                                          FE_BMPR8, *(u_int16_t *)savebyte);
+                                          FE_BMPR8, *(uint16_t *)savebyte);
                                        leftover = 0; 
                                } else if (BUS_SPACE_ALIGNED_POINTER(data,
-                                   u_int16_t) == 0) {
+                                   uint16_t) == 0) {
                                        /*
                                         * Unaligned data; buffer the next byte.
                                         */



Home | Main Index | Thread Index | Old Index