diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2006-08-18 07:50:51 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2006-08-18 07:50:51 +0000 |
commit | 86ecb01236fc19aa39d062b334e8bb6771dbb744 (patch) | |
tree | 5066bc8f17c7f39ec7023a1f874cd32f84609b78 /sys/dev | |
parent | 6f31088630db23ce65a8dec32cbed8c113e79951 (diff) |
ansi, no binary change.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pcmcia/if_ray.c | 221 |
1 files changed, 58 insertions, 163 deletions
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c index bf5e1a4712b..30d823dde60 100644 --- a/sys/dev/pcmcia/if_ray.c +++ b/sys/dev/pcmcia/if_ray.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ray.c,v 1.32 2006/05/22 20:35:12 krw Exp $ */ +/* $OpenBSD: if_ray.c,v 1.33 2006/08/18 07:50:50 jsg Exp $ */ /* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */ /* @@ -492,10 +492,7 @@ struct cfattach ray_ca = { */ int -ray_match(parent, match, aux) - struct device *parent; - struct cfdata *match; - void *aux; +ray_match(struct device *parent, struct cfdata *match, void *aux) { struct pcmcia_attach_args *pa = aux; @@ -513,9 +510,7 @@ ray_match(parent, match, aux) void -ray_attach(parent, self, aux) - struct device *parent, *self; - void *aux; +ray_attach(struct device *parent, struct device *self, void *aux) { struct ray_ecf_startup *ep; struct pcmcia_attach_args *pa; @@ -655,9 +650,7 @@ fail: } int -ray_activate(dev, act) - struct device *dev; - enum devact act; +ray_activate(struct device *dev, enum devact act) { struct ray_softc *sc = (struct ray_softc *)dev; struct ifnet *ifp = &sc->sc_if; @@ -689,9 +682,7 @@ ray_activate(dev, act) } int -ray_detach(self, flags) - struct device *self; - int flags; +ray_detach(struct device *self, int flags) { struct ray_softc *sc; struct ifnet *ifp; @@ -729,8 +720,7 @@ ray_detach(self, flags) * start the card running */ int -ray_enable(sc) - struct ray_softc *sc; +ray_enable(struct ray_softc *sc) { int error; @@ -751,8 +741,7 @@ ray_enable(sc) * stop the card running */ void -ray_disable(sc) - struct ray_softc *sc; +ray_disable(struct ray_softc *sc) { RAY_DPRINTF(("%s: disable\n", sc->sc_xname)); @@ -774,8 +763,7 @@ ray_disable(sc) * start the card running */ int -ray_init(sc) - struct ray_softc *sc; +ray_init(struct ray_softc *sc) { struct ray_ecf_startup *ep; bus_size_t ccs; @@ -849,8 +837,7 @@ ray_init(sc) * stop the card running */ void -ray_stop(sc) - struct ray_softc *sc; +ray_stop(struct ray_softc *sc) { RAY_DPRINTF(("%s: stop\n", sc->sc_xname)); @@ -877,8 +864,7 @@ ray_stop(sc) * reset the card */ void -ray_reset(sc) - struct ray_softc *sc; +ray_reset(struct ray_softc *sc) { if (++sc->sc_resetloop >= RAY_MAX_RESETS) { if (sc->sc_resetloop == RAY_MAX_RESETS) { @@ -905,8 +891,7 @@ ray_reset(sc) * on these resets */ void -ray_reset_resetloop(arg) - void *arg; +ray_reset_resetloop(void *arg) { struct ray_softc *sc; @@ -915,9 +900,7 @@ ray_reset_resetloop(arg) } void -ray_power(why, arg) - int why; - void *arg; +ray_power(int why, void *arg) { #if 0 struct ray_softc *sc; @@ -943,8 +926,7 @@ ray_power(why, arg) } void -ray_shutdown(arg) - void *arg; +ray_shutdown(void *arg) { struct ray_softc *sc; @@ -953,10 +935,7 @@ ray_shutdown(arg) } int -ray_ioctl(ifp, cmd, data) - struct ifnet *ifp; - u_long cmd; - caddr_t data; +ray_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ieee80211_nwid nwid; struct ray_param_req pr; @@ -1112,8 +1091,7 @@ ray_ioctl(ifp, cmd, data) * ifnet interface to start transmission on the interface */ void -ray_if_start(ifp) - struct ifnet *ifp; +ray_if_start(struct ifnet *ifp) { struct ray_softc *sc; @@ -1122,8 +1100,7 @@ ray_if_start(ifp) } int -ray_media_change(ifp) - struct ifnet *ifp; +ray_media_change(struct ifnet *ifp) { struct ray_softc *sc; @@ -1140,9 +1117,7 @@ ray_media_change(ifp) } void -ray_media_status(ifp, imr) - struct ifnet *ifp; - struct ifmediareq *imr; +ray_media_status(struct ifnet *ifp, struct ifmediareq *imr) { struct ray_softc *sc; @@ -1165,8 +1140,7 @@ ray_media_status(ifp, imr) * interrupt as a result */ void -ray_intr_start(sc) - struct ray_softc *sc; +ray_intr_start(struct ray_softc *sc) { struct ieee80211_frame *iframe; struct ether_header *eh; @@ -1392,9 +1366,7 @@ ray_intr_start(sc) * receive a packet from the card */ void -ray_recv(sc, ccs) - struct ray_softc *sc; - bus_size_t ccs; +ray_recv(struct ray_softc *sc, bus_size_t ccs) { struct ieee80211_frame *frame; struct ether_header *eh; @@ -1647,9 +1619,7 @@ done: */ void -ray_recv_auth(sc, frame) - struct ray_softc *sc; - struct ieee80211_frame *frame; +ray_recv_auth(struct ray_softc *sc, struct ieee80211_frame *frame) { /* todo: deal with timers: del_timer(&local->timer); */ u_int8_t *var= (u_int8_t*)(frame+1); @@ -1682,10 +1652,7 @@ ray_recv_auth(sc, frame) * auth_type: whether to send an REQUEST or a RESPONSE */ int -ray_send_auth(sc, dest, auth_type) - struct ray_softc *sc; - u_int8_t *dest; - u_int8_t auth_type; +ray_send_auth(struct ray_softc *sc, u_int8_t *dest, u_int8_t auth_type) { u_int8_t packet[sizeof(struct ieee80211_frame) + 6]; bus_size_t bufp; @@ -1725,9 +1692,7 @@ ray_send_auth(sc, dest, auth_type) * this took ~ever to figure out, don't make someone do it again! */ u_int -ray_find_free_tx_ccs(sc, hint) - struct ray_softc *sc; - u_int hint; +ray_find_free_tx_ccs(struct ray_softc *sc, u_int hint) { u_int i, stat; @@ -1753,10 +1718,7 @@ ray_find_free_tx_ccs(sc, hint) * page and the current chain values */ bus_size_t -ray_fill_in_tx_ccs(sc, pktlen, i, pi) - struct ray_softc *sc; - size_t pktlen; - u_int i, pi; +ray_fill_in_tx_ccs(struct ray_softc *sc, size_t pktlen, u_int i, u_int pi) { bus_size_t ccs, bufp; @@ -1788,10 +1750,7 @@ ray_fill_in_tx_ccs(sc, pktlen, i, pi) * the status */ ray_cmd_func_t -ray_update_params_done(sc, ccs, stat) - struct ray_softc *sc; - bus_size_t ccs; - u_int stat; +ray_update_params_done(struct ray_softc *sc, bus_size_t ccs, u_int stat) { ray_cmd_func_t rcmd; @@ -1829,8 +1788,7 @@ ray_update_params_done(sc, ccs, stat) * check too see if we have any pending commands. */ void -ray_check_scheduled(arg) - void *arg; +ray_check_scheduled(void *arg) { struct ray_softc *sc; int s, i, mask; @@ -1879,8 +1837,7 @@ ray_check_scheduled(arg) * per hardware limitations */ void -ray_check_ccs(arg) - void *arg; +ray_check_ccs(void *arg) { ray_cmd_func_t fp; struct ray_softc *sc; @@ -1946,8 +1903,7 @@ breakout: * if the `own' bit is one and then sets the own bit to 0. */ void -ray_update_error_counters(sc) - struct ray_softc *sc; +ray_update_error_counters(struct ray_softc *sc) { bus_size_t csc; @@ -1975,9 +1931,7 @@ ray_update_error_counters(sc) * one of the commands we issued has completed, process. */ ray_cmd_func_t -ray_ccs_done(sc, ccs) - struct ray_softc *sc; - bus_size_t ccs; +ray_ccs_done(struct ray_softc *sc, bus_size_t ccs) { struct ifnet *ifp; ray_cmd_func_t rcmd; @@ -2078,9 +2032,7 @@ done: * an unsolicited interrupt, i.e., the ECF is sending us a command */ ray_cmd_func_t -ray_rccs_intr(sc, ccs) - struct ray_softc *sc; - bus_size_t ccs; +ray_rccs_intr(struct ray_softc *sc, bus_size_t ccs) { ray_cmd_func_t rcmd; u_int cmd, stat; @@ -2135,8 +2087,7 @@ done: * process an interrupt */ int -ray_intr(arg) - void *arg; +ray_intr(void *arg) { struct ray_softc *sc; ray_cmd_func_t rcmd; @@ -2184,9 +2135,7 @@ ray_intr(arg) * free the chain of descriptors -- used for freeing allocated tx chains */ void -ray_free_ccs_chain(sc, ni) - struct ray_softc *sc; - u_int ni; +ray_free_ccs_chain(struct ray_softc *sc, u_int ni) { u_int i; @@ -2202,9 +2151,7 @@ ray_free_ccs_chain(sc, ni) * this routine is only used for commands */ u_int8_t -ray_free_ccs(sc, ccs) - struct ray_softc *sc; - bus_size_t ccs; +ray_free_ccs(struct ray_softc *sc, bus_size_t ccs) { u_int8_t stat; @@ -2230,10 +2177,7 @@ ray_free_ccs(sc, ccs) * this routine is only used for commands */ int -ray_alloc_ccs(sc, ccsp, cmd, track) - struct ray_softc *sc; - bus_size_t *ccsp; - u_int cmd, track; +ray_alloc_ccs(struct ray_softc *sc, bus_size_t *ccsp, u_int cmd, u_int track) { bus_size_t ccs; u_int i; @@ -2275,9 +2219,7 @@ ray_alloc_ccs(sc, ccsp, cmd, track) * that uses the `host to ecf' region must be serialized. */ void -ray_set_pending(sc, cmdf) - struct ray_softc *sc; - u_int cmdf; +ray_set_pending(struct ray_softc *sc, u_int cmdf) { RAY_DPRINTF(("%s: ray_set_pending 0x%x\n", sc->sc_xname, cmdf)); @@ -2294,9 +2236,7 @@ ray_set_pending(sc, cmdf) * schedule the `cmdf' for completion later */ void -ray_cmd_schedule(sc, cmdf) - struct ray_softc *sc; - int cmdf; +ray_cmd_schedule(struct ray_softc *sc, int cmdf) { int track; @@ -2316,9 +2256,7 @@ ray_cmd_schedule(sc, cmdf) * check to see if `cmdf' has been scheduled */ int -ray_cmd_is_scheduled(sc, cmdf) - struct ray_softc *sc; - int cmdf; +ray_cmd_is_scheduled(struct ray_softc *sc, int cmdf) { RAY_DPRINTF(("%s: ray_cmd_is_scheduled 0x%x\n", sc->sc_xname, cmdf)); @@ -2329,9 +2267,7 @@ ray_cmd_is_scheduled(sc, cmdf) * cancel a scheduled command (not a running one though!) */ void -ray_cmd_cancel(sc, cmdf) - struct ray_softc *sc; - int cmdf; +ray_cmd_cancel(struct ray_softc *sc, int cmdf) { RAY_DPRINTF(("%s: ray_cmd_cancel 0x%x\n", sc->sc_xname, cmdf)); @@ -2350,9 +2286,7 @@ ray_cmd_cancel(sc, cmdf) * called to indicate the 'cmdf' has been issued */ void -ray_cmd_ran(sc, cmdf) - struct ray_softc *sc; - int cmdf; +ray_cmd_ran(struct ray_softc *sc, int cmdf) { RAY_DPRINTF(("%s: ray_cmd_ran 0x%x\n", sc->sc_xname, cmdf)); @@ -2372,9 +2306,7 @@ ray_cmd_ran(sc, cmdf) * check to see if `cmdf' has been issued */ int -ray_cmd_is_running(sc, cmdf) - struct ray_softc *sc; - int cmdf; +ray_cmd_is_running(struct ray_softc *sc, int cmdf) { RAY_DPRINTF(("%s: ray_cmd_is_running 0x%x\n", sc->sc_xname, cmdf)); @@ -2385,9 +2317,7 @@ ray_cmd_is_running(sc, cmdf) * the given `cmdf' that was issued has completed */ void -ray_cmd_done(sc, cmdf) - struct ray_softc *sc; - int cmdf; +ray_cmd_done(struct ray_softc *sc, int cmdf) { RAY_DPRINTF(("%s: ray_cmd_done 0x%x\n", sc->sc_xname, cmdf)); @@ -2408,10 +2338,7 @@ ray_cmd_done(sc, cmdf) * only used for commands not tx */ int -ray_issue_cmd(sc, ccs, track) - struct ray_softc *sc; - bus_size_t ccs; - u_int track; +ray_issue_cmd(struct ray_softc *sc, bus_size_t ccs, u_int track) { u_int i; @@ -2442,9 +2369,7 @@ ray_issue_cmd(sc, ccs, track) * send a simple command if we can */ int -ray_simple_cmd(sc, cmd, track) - struct ray_softc *sc; - u_int cmd, track; +ray_simple_cmd(struct ray_softc *sc, u_int cmd, u_int track) { bus_size_t ccs; @@ -2460,8 +2385,7 @@ ray_simple_cmd(sc, cmd, track) * run a update subcommand */ void -ray_update_subcmd(sc) - struct ray_softc *sc; +ray_update_subcmd(struct ray_softc *sc) { int submask, i; @@ -2495,8 +2419,7 @@ ray_update_subcmd(sc) * report a parameter */ void -ray_report_params(sc) - struct ray_softc *sc; +ray_report_params(struct ray_softc *sc) { bus_size_t ccs; @@ -2525,8 +2448,7 @@ ray_report_params(sc) * start an association */ void -ray_start_assoc(sc) - struct ray_softc *sc; +ray_start_assoc(struct ray_softc *sc) { ray_cmd_cancel(sc, SCP_STARTASSOC); if ((sc->sc_if.if_flags & IFF_RUNNING) == 0) @@ -2546,8 +2468,7 @@ ray_start_assoc(sc) * -- no outstanding commands expected */ void -ray_download_params(sc) - struct ray_softc *sc; +ray_download_params(struct ray_softc *sc) { struct ray_startup_params_head *sp; struct ray_startup_params_tail_5 *sp5; @@ -2738,8 +2659,7 @@ ray_download_params(sc) * start or join a network */ void -ray_start_join_net(sc) - struct ray_softc *sc; +ray_start_join_net(struct ray_softc *sc) { struct ray_net_params np; bus_size_t ccs; @@ -2781,8 +2701,7 @@ ray_start_join_net(sc) } void -ray_start_join_timo(arg) - void *arg; +ray_start_join_timo(void *arg) { struct ray_softc *sc; u_int stat; @@ -2801,11 +2720,7 @@ ray_start_join_timo(arg) * marked busy. */ ray_cmd_func_t -ray_start_join_net_done(sc, cmd, ccs, stat) - struct ray_softc *sc; - u_int cmd; - bus_size_t ccs; - u_int stat; +ray_start_join_net_done(struct ray_softc *sc, u_int cmd, bus_size_t ccs, u_int stat) { int i; struct ray_net_params np; @@ -2900,8 +2815,7 @@ ray_start_join_net_done(sc, cmd, ccs, stat) * set the card in/out of promiscuous mode */ void -ray_update_promisc(sc) - struct ray_softc *sc; +ray_update_promisc(struct ray_softc *sc) { bus_size_t ccs; int promisc; @@ -2929,8 +2843,7 @@ ray_update_promisc(sc) * update the parameter based on what the user passed in */ void -ray_update_params(sc) - struct ray_softc *sc; +ray_update_params(struct ray_softc *sc) { bus_size_t ccs; @@ -2963,8 +2876,7 @@ ray_update_params(sc) * set the multicast filter list */ void -ray_update_mcast(sc) - struct ray_softc *sc; +ray_update_mcast(struct ray_softc *sc) { bus_size_t ccs; struct ether_multistep step; @@ -3028,9 +2940,7 @@ ray_update_mcast(sc) * expected to be called in sleepable context -- intended for user stuff */ int -ray_user_update_params(sc, pr) - struct ray_softc *sc; - struct ray_param_req *pr; +ray_user_update_params(struct ray_softc *sc, struct ray_param_req *pr) { int rv; @@ -3070,9 +2980,7 @@ ray_user_update_params(sc, pr) * expected to be called in sleepable context -- intended for user stuff */ int -ray_user_report_params(sc, pr) - struct ray_softc *sc; - struct ray_param_req *pr; +ray_user_report_params(struct ray_softc *sc, struct ray_param_req *pr) { int rv; @@ -3114,11 +3022,7 @@ ray_user_report_params(sc, pr) */ #ifndef ray_read_region void -ray_read_region(sc, off, vp, c) - struct ray_softc *sc; - bus_size_t off; - void *vp; - size_t c; +ray_read_region(struct ray_softc *sc, bus_size_t off, void *vp, size_t c) { #ifdef RAY_USE_OPTIMIZED_COPY u_int n2, n4, tmp; @@ -3176,11 +3080,7 @@ ray_read_region(sc, off, vp, c) * presumably this is related to the inline asm on i386. */ void -ray_write_region(sc, off, vp, c) - struct ray_softc *sc; - bus_size_t off; - void *vp; - size_t c; +ray_write_region(struct ray_softc *sc, bus_size_t off, void *vp, size_t c) { #ifdef RAY_USE_OPTIMIZED_COPY size_t n2, n4, tmp; @@ -3313,9 +3213,7 @@ hexdump(const u_int8_t *d, int len, int br, int div, int fl) void -ray_dump_mbuf(sc, m) - struct ray_softc *sc; - struct mbuf *m; +ray_dump_mbuf(struct ray_softc *sc, struct mbuf *m) { u_int8_t *d, *ed; u_int i; @@ -3341,10 +3239,7 @@ ray_dump_mbuf(sc, m) #ifdef RAY_DO_SIGLEV void -ray_update_siglev(sc, src, siglev) - struct ray_softc *sc; - u_int8_t *src; - u_int8_t siglev; +ray_update_siglev(struct ray_softc *sc, u_int8_t *src, u_int8_t siglev) { int i, mini; struct timeval mint; |