diff options
Diffstat (limited to 'sys/dev/ic/dp8390.c')
-rw-r--r-- | sys/dev/ic/dp8390.c | 89 |
1 files changed, 25 insertions, 64 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; |