diff options
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/dp8390.c | 89 | ||||
-rw-r--r-- | sys/dev/ic/ne2000.c | 58 |
2 files changed, 40 insertions, 107 deletions
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index 23397fe9680..6ef17d7bd5e 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dp8390.c,v 1.36 2006/10/10 00:09:07 brad Exp $ */ +/* $OpenBSD: dp8390.c,v 1.37 2006/10/20 16:54:01 brad Exp $ */ /* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */ /* @@ -82,8 +82,7 @@ dp8390_media_init(struct dp8390_softc *sc) * Do bus-independent setup. */ int -dp8390_config(sc) - struct dp8390_softc *sc; +dp8390_config(struct dp8390_softc *sc) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; int rv; @@ -147,8 +146,7 @@ out: * Media change callback. */ int -dp8390_mediachange(ifp) - struct ifnet *ifp; +dp8390_mediachange(struct ifnet *ifp) { struct dp8390_softc *sc = ifp->if_softc; @@ -162,9 +160,7 @@ dp8390_mediachange(ifp) * Media status callback. */ void -dp8390_mediastatus(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +dp8390_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) { struct dp8390_softc *sc = ifp->if_softc; @@ -182,8 +178,7 @@ dp8390_mediastatus(ifp, ifmr) * Reset interface. */ void -dp8390_reset(sc) - struct dp8390_softc *sc; +dp8390_reset(struct dp8390_softc *sc) { int s; @@ -197,8 +192,7 @@ dp8390_reset(sc) * Take interface offline. */ void -dp8390_stop(sc) - struct dp8390_softc *sc; +dp8390_stop(struct dp8390_softc *sc) { bus_space_tag_t regt = sc->sc_regt; bus_space_handle_t regh = sc->sc_regh; @@ -229,8 +223,7 @@ dp8390_stop(sc) */ void -dp8390_watchdog(ifp) - struct ifnet *ifp; +dp8390_watchdog(struct ifnet *ifp) { struct dp8390_softc *sc = ifp->if_softc; @@ -244,8 +237,7 @@ dp8390_watchdog(ifp) * Initialize device. */ void -dp8390_init(sc) - struct dp8390_softc *sc; +dp8390_init(struct dp8390_softc *sc) { bus_space_tag_t regt = sc->sc_regt; bus_space_handle_t regh = sc->sc_regh; @@ -381,8 +373,7 @@ dp8390_init(sc) * This routine actually starts the transmission on the interface. */ static __inline__ void -dp8390_xmit(sc) - struct dp8390_softc *sc; +dp8390_xmit(struct dp8390_softc *sc) { bus_space_tag_t regt = sc->sc_regt; bus_space_handle_t regh = sc->sc_regh; @@ -437,8 +428,7 @@ dp8390_xmit(sc) * (i.e. that the output part of the interface is idle) */ void -dp8390_start(ifp) - struct ifnet *ifp; +dp8390_start(struct ifnet *ifp) { struct dp8390_softc *sc = ifp->if_softc; struct mbuf *m0; @@ -497,8 +487,7 @@ outloop: * Ethernet interface receiver interrupt. */ void -dp8390_rint(sc) - struct dp8390_softc *sc; +dp8390_rint(struct dp8390_softc *sc) { bus_space_tag_t regt = sc->sc_regt; bus_space_handle_t regh = sc->sc_regh; @@ -616,8 +605,7 @@ loop: /* Ethernet interface interrupt processor. */ int -dp8390_intr(arg) - void *arg; +dp8390_intr(void *arg) { struct dp8390_softc *sc = (struct dp8390_softc *)arg; bus_space_tag_t regt = sc->sc_regt; @@ -815,10 +803,7 @@ dp8390_intr(arg) * Process an ioctl request. This code needs some work - it looks pretty ugly. */ int -dp8390_ioctl(ifp, cmd, data) - struct ifnet *ifp; - u_long cmd; - caddr_t data; +dp8390_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct dp8390_softc *sc = ifp->if_softc; struct ifaddr *ifa = (struct ifaddr *) data; @@ -928,10 +913,7 @@ dp8390_ioctl(ifp, cmd, data) * ether_input(). If there is a BPF listener, give a copy to BPF, too. */ void -dp8390_read(sc, buf, len) - struct dp8390_softc *sc; - int buf; - u_short len; +dp8390_read(struct dp8390_softc *sc, int buf, u_short len) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct mbuf *m; @@ -967,11 +949,9 @@ dp8390_read(sc, buf, len) * need to listen to. */ void -dp8390_getmcaf(ec, af) - struct arpcom *ec; - u_int8_t *af; +dp8390_getmcaf(struct arpcom *ac, u_int8_t *af) { - struct ifnet *ifp = &ec->ac_if; + struct ifnet *ifp = &ac->ac_if; struct ether_multi *enm; u_int32_t crc; int i; @@ -993,7 +973,7 @@ dp8390_getmcaf(ec, af) } for (i = 0; i < 8; i++) af[i] = 0; - ETHER_FIRST_MULTI(step, ec, enm); + ETHER_FIRST_MULTI(step, ac, enm); while (enm != NULL) { if (bcmp(enm->enm_addrlo, enm->enm_addrhi, sizeof(enm->enm_addrlo)) != 0) { @@ -1030,10 +1010,7 @@ dp8390_getmcaf(ec, af) * amount = amount of data to copy */ struct mbuf * -dp8390_get(sc, src, total_len) - struct dp8390_softc *sc; - int src; - u_short total_len; +dp8390_get(struct dp8390_softc *sc, int src, u_short total_len) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct mbuf *m, *m0, *newm; @@ -1099,8 +1076,7 @@ bad: * Zero NIC buffer memory and verify that it is clear. */ static int -dp8390_test_mem(sc) - struct dp8390_softc *sc; +dp8390_test_mem(struct dp8390_softc *sc) { bus_space_tag_t buft = sc->sc_buft; bus_space_handle_t bufh = sc->sc_bufh; @@ -1123,10 +1099,7 @@ dp8390_test_mem(sc) * Read a packet header from the ring, given the source offset. */ static __inline__ void -dp8390_read_hdr(sc, src, hdrp) - struct dp8390_softc *sc; - int src; - struct dp8390_ring *hdrp; +dp8390_read_hdr(struct dp8390_softc *sc, int src, struct dp8390_ring *hdrp) { bus_space_tag_t buft = sc->sc_buft; bus_space_handle_t bufh = sc->sc_bufh; @@ -1147,11 +1120,7 @@ dp8390_read_hdr(sc, src, hdrp) * Takes into account ring-wrap. */ static __inline__ int -dp8390_ring_copy(sc, src, dst, amount) - struct dp8390_softc *sc; - int src; - caddr_t dst; - u_short amount; +dp8390_ring_copy(struct dp8390_softc *sc, int src, caddr_t dst, u_short amount) { bus_space_tag_t buft = sc->sc_buft; bus_space_handle_t bufh = sc->sc_bufh; @@ -1180,10 +1149,7 @@ dp8390_ring_copy(sc, src, dst, amount) * packet fits in one mbuf. */ static __inline__ int -dp8390_write_mbuf(sc, m, buf) - struct dp8390_softc *sc; - struct mbuf *m; - int buf; +dp8390_write_mbuf(struct dp8390_softc *sc, struct mbuf *m, int buf) { bus_space_tag_t buft = sc->sc_buft; bus_space_handle_t bufh = sc->sc_bufh; @@ -1207,8 +1173,7 @@ dp8390_write_mbuf(sc, m, buf) * Enable power on the interface. */ int -dp8390_enable(sc) - struct dp8390_softc *sc; +dp8390_enable(struct dp8390_softc *sc) { if (sc->sc_enabled == 0 && sc->sc_enable != NULL) { @@ -1227,10 +1192,8 @@ dp8390_enable(sc) * Disable power on the interface. */ void -dp8390_disable(sc) - struct dp8390_softc *sc; +dp8390_disable(struct dp8390_softc *sc) { - if (sc->sc_enabled != 0 && sc->sc_disable != NULL) { (*sc->sc_disable)(sc); sc->sc_enabled = 0; @@ -1238,9 +1201,7 @@ dp8390_disable(sc) } int -dp8390_detach(sc, flags) - struct dp8390_softc *sc; - int flags; +dp8390_detach(struct dp8390_softc *sc, int flags) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; diff --git a/sys/dev/ic/ne2000.c b/sys/dev/ic/ne2000.c index fd5a27195ea..b3749265533 100644 --- a/sys/dev/ic/ne2000.c +++ b/sys/dev/ic/ne2000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ne2000.c,v 1.18 2006/10/10 00:09:07 brad Exp $ */ +/* $OpenBSD: ne2000.c,v 1.19 2006/10/20 16:54:01 brad Exp $ */ /* $NetBSD: ne2000.c,v 1.12 1998/06/10 01:15:50 thorpej Exp $ */ /*- @@ -107,9 +107,7 @@ struct cfdriver ne_cd = { }; int -ne2000_attach(nsc, myea) - struct ne2000_softc *nsc; - u_int8_t *myea; +ne2000_attach(struct ne2000_softc *nsc, u_int8_t *myea) { struct dp8390_softc *dsc = &nsc->sc_dp8390; bus_space_tag_t nict = dsc->sc_regt; @@ -306,8 +304,7 @@ ne2000_attach(nsc, myea) * Detect an NE-2000 or compatible. Returns a model code. */ int -ne2000_detect(nsc) - struct ne2000_softc *nsc; +ne2000_detect(struct ne2000_softc *nsc) { struct dp8390_softc *dsc = &nsc->sc_dp8390; bus_space_tag_t nict = dsc->sc_regt; @@ -476,10 +473,7 @@ ne2000_detect(nsc) * I/O. */ int -ne2000_write_mbuf(sc, m, buf) - struct dp8390_softc *sc; - struct mbuf *m; - int buf; +ne2000_write_mbuf(struct dp8390_softc *sc, struct mbuf *m, int buf) { struct ne2000_softc *nsc = (struct ne2000_softc *)sc; bus_space_tag_t nict = sc->sc_regt; @@ -651,11 +645,8 @@ ne2000_write_mbuf(sc, m, buf) * ring-wrap. */ int -ne2000_ring_copy(sc, src, dst, amount) - struct dp8390_softc *sc; - int src; - caddr_t dst; - u_short amount; +ne2000_ring_copy(struct dp8390_softc *sc, int src, caddr_t dst, + u_short amount) { struct ne2000_softc *nsc = (struct ne2000_softc *)sc; bus_space_tag_t nict = sc->sc_regt; @@ -685,10 +676,7 @@ ne2000_ring_copy(sc, src, dst, amount) } void -ne2000_read_hdr(sc, buf, hdr) - struct dp8390_softc *sc; - int buf; - struct dp8390_ring *hdr; +ne2000_read_hdr(struct dp8390_softc *sc, int buf, struct dp8390_ring *hdr) { struct ne2000_softc *nsc = (struct ne2000_softc *)sc; @@ -701,10 +689,8 @@ ne2000_read_hdr(sc, buf, hdr) } int -ne2000_test_mem(sc) - struct dp8390_softc *sc; +ne2000_test_mem(struct dp8390_softc *sc) { - /* Noop. */ return (0); } @@ -715,15 +701,9 @@ ne2000_test_mem(sc) * rounded up to a word - ok as long as mbufs are word sized. */ void -ne2000_readmem(nict, nich, asict, asich, src, dst, amount, useword) - bus_space_tag_t nict; - bus_space_handle_t nich; - bus_space_tag_t asict; - bus_space_handle_t asich; - int src; - u_int8_t *dst; - size_t amount; - int useword; +ne2000_readmem(bus_space_tag_t nict, bus_space_handle_t nich, + bus_space_tag_t asict, bus_space_handle_t asich, int src, + u_int8_t *dst, size_t amount, int useword) { /* Select page 0 registers. */ @@ -767,15 +747,9 @@ ne2000_readmem(nict, nich, asict, asich, src, dst, amount, useword) * used in the probe routine to test the memory. 'len' must be even. */ void -ne2000_writemem(nict, nich, asict, asich, src, dst, len, useword) - bus_space_tag_t nict; - bus_space_handle_t nich; - bus_space_tag_t asict; - bus_space_handle_t asich; - u_int8_t *src; - int dst; - size_t len; - int useword; +ne2000_writemem(bus_space_tag_t nict, bus_space_handle_t nich, + bus_space_tag_t asict, bus_space_handle_t asich, u_int8_t *src, + int dst, size_t len, int useword) { int maxwait = 100; /* about 120us */ @@ -830,9 +804,7 @@ ne2000_writemem(nict, nich, asict, asich, src, dst, len, useword) } int -ne2000_detach(sc, flags) - struct ne2000_softc *sc; - int flags; +ne2000_detach(struct ne2000_softc *sc, int flags) { return (dp8390_detach(&sc->sc_dp8390, flags)); } |