diff options
| author | tsutsui <tsutsui@NetBSD.org> | 2005-01-02 12:41:03 +0000 |
|---|---|---|
| committer | tsutsui <tsutsui@NetBSD.org> | 2005-01-02 12:41:03 +0000 |
| commit | 290f8ccd57919d67c9759ed754e0c694edb2ffbe (patch) | |
| tree | 436c852b4395259407badd625eda8070f8a78e7b /sys/dev | |
| parent | 1d25696d75219fa0bf6fa80e3cd295aacafb4258 (diff) | |
- use ANSI function decls
- remove __P()
- u_intNN_t -> uintNN_t
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/mb86960.c | 158 | ||||
| -rw-r--r-- | sys/dev/ic/mb86960var.h | 50 |
2 files changed, 83 insertions, 125 deletions
diff --git a/sys/dev/ic/mb86960.c b/sys/dev/ic/mb86960.c index be84c329b04..be3e4408cff 100644 --- a/sys/dev/ic/mb86960.c +++ b/sys/dev/ic/mb86960.c @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.58 2004/10/30 18:08:37 thorpej Exp $") #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 @@ mb86960_attach(sc, myea) * 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 @@ mb86960_config(sc, media, nmedia, defmedia) * 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 @@ mb86960_mediachange(ifp) * 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 @@ mb86960_mediastatus(ifp, ifmr) * Reset interface. */ void -mb86960_reset(sc) - struct mb86960_softc *sc; +mb86960_reset(struct mb86960_softc *sc) { int s; @@ -391,8 +383,7 @@ mb86960_reset(sc) * 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 @@ mb86960_stop(sc) * 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 @@ mb86960_watchdog(ifp) * 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 @@ mb86960_droppacket(sc) * 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 @@ mb86960_init(sc) * 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 @@ mb86960_xmit(sc) * (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 @@ indicate_active: * 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 @@ mb86960_tint(sc, tstat) * 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 @@ mb86960_rint(sc, rstat) * 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 @@ mb86960_intr(arg) * 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 @@ mb86960_ioctl(ifp, cmd, data) * 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 @@ mb86960_get_packet(sc, len) /* 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 @@ mb86960_get_packet(sc, len) * 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 @@ mb86960_write_mbufs(sc, m) 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 @@ mb86960_write_mbufs(sc, m) 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 @@ mb86960_write_mbufs(sc, m) 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. */ @@ -1563,7 +1537,7 @@ mb86960_write_mbufs(sc, m) leftover = len & 1; len &= ~1; bus_space_write_multi_stream_2(bst, bsh, - FE_BMPR8, (u_int16_t *)data, + FE_BMPR8, (uint16_t *)data, len >> 1); data += len; if (leftover) @@ -1577,7 +1551,7 @@ mb86960_write_mbufs(sc, m) if (leftover) { savebyte[1] = 0; bus_space_write_stream_2(bst, bsh, FE_BMPR8, - *(u_int16_t *)savebyte); + *(uint16_t *)savebyte); } } #if FE_DELAYED_PADDING == 0 @@ -1603,13 +1577,11 @@ mb86960_write_mbufs(sc, m) * list of multicast addresses we need to listen to. */ void -mb86960_getmcaf(ec, af) - struct ethercom *ec; - u_int8_t *af; +mb86960_getmcaf(struct ethercom *ec, uint8_t *af) { struct ifnet *ifp = &ec->ec_if; struct ether_multi *enm; - u_int32_t crc; + uint32_t crc; struct ether_multistep step; /* @@ -1662,8 +1634,7 @@ allmulti: * receiver in appropriate mode. */ void -mb86960_setmode(sc) - struct mb86960_softc *sc; +mb86960_setmode(struct mb86960_softc *sc) { bus_space_tag_t bst = sc->sc_bst; bus_space_handle_t bsh = sc->sc_bsh; @@ -1768,8 +1739,7 @@ mb86960_setmode(sc) * a device is RUNNING. (I mistook the point in previous versions.) */ void -mb86960_loadmar(sc) - struct mb86960_softc *sc; +mb86960_loadmar(struct mb86960_softc *sc) { bus_space_tag_t bst = sc->sc_bst; bus_space_handle_t bsh = sc->sc_bsh; @@ -1805,8 +1775,7 @@ mb86960_loadmar(sc) * Enable power on the interface. */ int -mb86960_enable(sc) - struct mb86960_softc *sc; +mb86960_enable(struct mb86960_softc *sc) { #if FE_DEBUG >= 3 @@ -1829,8 +1798,7 @@ mb86960_enable(sc) * Disable power on the interface. */ void -mb86960_disable(sc) - struct mb86960_softc *sc; +mb86960_disable(struct mb86960_softc *sc) { #if FE_DEBUG >= 3 @@ -1849,9 +1817,7 @@ mb86960_disable(sc) * Handle device activation/deactivation requests. */ int -mb86960_activate(self, act) - struct device *self; - enum devact act; +mb86960_activate(struct device *self, enum devact act) { struct mb86960_softc *sc = (struct mb86960_softc *)self; int rv, s; @@ -1877,8 +1843,7 @@ mb86960_activate(self, act) * Detach a MB86960 interface. */ int -mb86960_detach(sc) - struct mb86960_softc *sc; +mb86960_detach(struct mb86960_softc *sc) { struct ifnet *ifp = &sc->sc_ec.ec_if; @@ -1904,13 +1869,10 @@ mb86960_detach(sc) * Routines to read all bytes from the config EEPROM (93C06) through MB86965A. */ void -mb86965_read_eeprom(iot, ioh, data) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t *data; +mb86965_read_eeprom(bus_space_tag_t iot, bus_space_handle_t ioh, uint8_t *data) { int addr, op, bit; - u_int16_t val; + uint16_t val; /* Read bytes from EEPROM; two bytes per an iteration. */ for (addr = 0; addr < FE_EEPROM_SIZE / 2; addr++) { @@ -1981,13 +1943,11 @@ mb86965_read_eeprom(iot, ioh, data) #if FE_DEBUG >= 1 void -mb86960_dump(level, sc) - int level; - struct mb86960_softc *sc; +mb86960_dump(int level, struct mb86960_softc *sc) { bus_space_tag_t bst = sc->sc_bst; bus_space_handle_t bsh = sc->sc_bsh; - u_int8_t save_dlcr7; + uint8_t save_dlcr7; save_dlcr7 = bus_space_read_1(bst, bsh, FE_DLCR7); diff --git a/sys/dev/ic/mb86960var.h b/sys/dev/ic/mb86960var.h index 2e1f1d476ec..c2c1183375e 100644 --- a/sys/dev/ic/mb86960var.h +++ b/sys/dev/ic/mb86960var.h @@ -1,4 +1,4 @@ -/* $NetBSD: mb86960var.h,v 1.33 2003/02/05 12:03:54 tsutsui Exp $ */ +/* $NetBSD: mb86960var.h,v 1.34 2005/01/02 12:41:03 tsutsui Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -133,20 +133,20 @@ struct mb86960_softc { bus_space_handle_t sc_bsh; /* Set by probe() and not modified in later phases. */ - u_int32_t sc_flags; /* controller quirks */ + uint32_t sc_flags; /* controller quirks */ #define FE_FLAGS_MB86960 0x0001 /* DLCR7 is differnt on MB86960 */ #define FE_FLAGS_SBW_BYTE 0x0002 /* byte access mode for system bus */ #define FE_FLAGS_SRAM_150ns 0x0004 /* The board has slow SRAM */ - u_int8_t proto_dlcr4; /* DLCR4 prototype. */ - u_int8_t proto_dlcr5; /* DLCR5 prototype. */ - u_int8_t proto_dlcr6; /* DLCR6 prototype. */ - u_int8_t proto_dlcr7; /* DLCR7 prototype. */ - u_int8_t proto_bmpr13; /* BMPR13 prototype. */ + uint8_t proto_dlcr4; /* DLCR4 prototype. */ + uint8_t proto_dlcr5; /* DLCR5 prototype. */ + uint8_t proto_dlcr6; /* DLCR6 prototype. */ + uint8_t proto_dlcr7; /* DLCR7 prototype. */ + uint8_t proto_bmpr13; /* BMPR13 prototype. */ /* Vendor specific hooks. */ - void (*init_card) __P((struct mb86960_softc *)); - void (*stop_card) __P((struct mb86960_softc *)); + void (*init_card)(struct mb86960_softc *); + void (*stop_card)(struct mb86960_softc *); /* Transmission buffer management. */ int txb_size; /* total bytes in TX buffer */ @@ -157,24 +157,23 @@ struct mb86960_softc { /* Multicast address filter management. */ int filter_change; /* MARs must be changed ASAP. */ - u_int8_t filter[FE_FILTER_LEN]; /* new filter value. */ + uint8_t filter[FE_FILTER_LEN]; /* new filter value. */ - u_int8_t sc_enaddr[ETHER_ADDR_LEN]; + uint8_t sc_enaddr[ETHER_ADDR_LEN]; #if NRND > 0 rndsource_element_t rnd_source; #endif - u_int32_t sc_stat; /* driver status */ + uint32_t sc_stat; /* driver status */ #define FE_STAT_ENABLED 0x0001 /* power enabled on interface */ #define FE_STAT_ATTACHED 0x0002 /* attach has succeeded */ - int (*sc_enable) __P((struct mb86960_softc *)); - void (*sc_disable) __P((struct mb86960_softc *)); + int (*sc_enable)(struct mb86960_softc *); + void (*sc_disable)(struct mb86960_softc *); - int (*sc_mediachange) __P((struct mb86960_softc *)); - void (*sc_mediastatus) __P((struct mb86960_softc *, - struct ifmediareq *)); + int (*sc_mediachange)(struct mb86960_softc *); + void (*sc_mediastatus)(struct mb86960_softc *, struct ifmediareq *); }; /* @@ -195,12 +194,11 @@ struct mb86960_softc { * Hence FE_MAX_RECV_COUNT is the upper limit for number * of packets in the receive buffer. */ -void mb86960_attach __P((struct mb86960_softc *, u_int8_t *)); -void mb86960_config __P((struct mb86960_softc *, int *, int, int)); -int mb86960_intr __P((void *)); -int mb86960_enable __P((struct mb86960_softc *)); -void mb86960_disable __P((struct mb86960_softc *)); -int mb86960_activate __P((struct device *, enum devact)); -int mb86960_detach __P((struct mb86960_softc *)); -void mb86965_read_eeprom __P((bus_space_tag_t, bus_space_handle_t, - u_int8_t *)); +void mb86960_attach(struct mb86960_softc *, uint8_t *); +void mb86960_config(struct mb86960_softc *, int *, int, int); +int mb86960_intr(void *); +int mb86960_enable(struct mb86960_softc *); +void mb86960_disable(struct mb86960_softc *); +int mb86960_activate(struct device *, enum devact); +int mb86960_detach(struct mb86960_softc *); +void mb86965_read_eeprom(bus_space_tag_t, bus_space_handle_t, uint8_t *); |
