diff options
author | David Hill <dhill@cvs.openbsd.org> | 2012-01-11 16:22:34 +0000 |
---|---|---|
committer | David Hill <dhill@cvs.openbsd.org> | 2012-01-11 16:22:34 +0000 |
commit | 77aeb7d7bd6e784718d6c89a8cd9185f518e2a3b (patch) | |
tree | 0a174a798b5ecdafa059f057c2863702ada90f98 | |
parent | 9e3b2fd2c77e6e1b9ce21eff0e2c6dab69b7c97b (diff) |
ansify and de'register some prototypes
ok miod@
-rw-r--r-- | sys/dev/ic/adw.c | 80 | ||||
-rw-r--r-- | sys/dev/ic/adwlib.c | 90 | ||||
-rw-r--r-- | sys/dev/ic/elink3.c | 134 | ||||
-rw-r--r-- | sys/dev/ic/iha.c | 281 | ||||
-rw-r--r-- | sys/dev/ic/lpt.c | 43 | ||||
-rw-r--r-- | sys/dev/pci/auich.c | 103 | ||||
-rw-r--r-- | sys/dev/pci/cs4280.c | 196 | ||||
-rw-r--r-- | sys/dev/pci/yds.c | 168 | ||||
-rw-r--r-- | sys/net/ppp_tty.c | 63 |
9 files changed, 311 insertions, 847 deletions
diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index c002dbcfae8..f6ee7e197a4 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.49 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: adw.c,v 1.50 2012/01/11 16:22:32 dhill Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -92,8 +92,7 @@ struct cfdriver adw_cd = { int -adw_alloc_controls(sc) - ADW_SOFTC *sc; +adw_alloc_controls(ADW_SOFTC *sc) { bus_dma_segment_t seg; int error, rseg; @@ -138,8 +137,7 @@ adw_alloc_controls(sc) int -adw_alloc_carriers(sc) - ADW_SOFTC *sc; +adw_alloc_carriers(ADW_SOFTC *sc) { bus_dma_segment_t seg; int error, rseg; @@ -204,10 +202,7 @@ adw_alloc_carriers(sc) * by adw_init(). We return the number of CCBs successfully created. */ int -adw_create_ccbs(sc, ccbstore, count) - ADW_SOFTC *sc; - ADW_CCB *ccbstore; - int count; +adw_create_ccbs(ADW_SOFTC *sc, ADW_CCB *ccbstore, int count) { ADW_CCB *ccb; int i, error; @@ -230,8 +225,7 @@ adw_create_ccbs(sc, ccbstore, count) * A ccb is put onto the free list. */ void -adw_ccb_free(xsc, xccb) - void *xsc, *xccb; +adw_ccb_free(void *xsc, void *xccb) { ADW_SOFTC *sc = xsc; ADW_CCB *ccb = xccb; @@ -245,8 +239,7 @@ adw_ccb_free(xsc, xccb) void -adw_reset_ccb(ccb) - ADW_CCB *ccb; +adw_reset_ccb(ADW_CCB *ccb) { ccb->flags = 0; @@ -254,9 +247,7 @@ adw_reset_ccb(ccb) int -adw_init_ccb(sc, ccb) - ADW_SOFTC *sc; - ADW_CCB *ccb; +adw_init_ccb(ADW_SOFTC *sc, ADW_CCB *ccb) { int hashnum, error; @@ -293,8 +284,7 @@ adw_init_ccb(sc, ccb) * If there are none, see if we can allocate a new one */ void * -adw_ccb_alloc(xsc) - void *xsc; +adw_ccb_alloc(void *xsc) { ADW_SOFTC *sc = xsc; ADW_CCB *ccb; @@ -315,9 +305,7 @@ adw_ccb_alloc(xsc) * Given a physical address, find the ccb that it corresponds to. */ ADW_CCB * -adw_ccb_phys_kv(sc, ccb_phys) - ADW_SOFTC *sc; - u_int32_t ccb_phys; +adw_ccb_phys_kv(ADW_SOFTC *sc, u_int32_t ccb_phys) { int hashnum = CCB_HASH(ccb_phys); ADW_CCB *ccb = sc->sc_ccbhash[hashnum]; @@ -335,10 +323,7 @@ adw_ccb_phys_kv(sc, ccb_phys) * Queue a CCB to be sent to the controller, and send it if possible. */ int -adw_queue_ccb(sc, ccb, retry) - ADW_SOFTC *sc; - ADW_CCB *ccb; - int retry; +adw_queue_ccb(ADW_SOFTC *sc, ADW_CCB *ccb, int retry) { int errcode = ADW_SUCCESS; @@ -382,8 +367,7 @@ adw_queue_ccb(sc, ccb, retry) int -adw_init(sc) - ADW_SOFTC *sc; +adw_init(ADW_SOFTC *sc) { u_int16_t warn_code; @@ -421,8 +405,7 @@ adw_init(sc) void -adw_attach(sc) - ADW_SOFTC *sc; +adw_attach(ADW_SOFTC *sc) { struct scsibus_attach_args saa; int i, error; @@ -557,8 +540,7 @@ adw_minphys(struct buf *bp, struct scsi_link *sl) * Also needs the unit, target and lu. */ void -adw_scsi_cmd(xs) - struct scsi_xfer *xs; +adw_scsi_cmd(struct scsi_xfer *xs) { struct scsi_link *sc_link = xs->sc_link; ADW_SOFTC *sc = sc_link->adapter_softc; @@ -621,10 +603,7 @@ retryagain: * Build a request structure for the Wide Boards. */ int -adw_build_req(xs, ccb, flags) - struct scsi_xfer *xs; - ADW_CCB *ccb; - int flags; +adw_build_req(struct scsi_xfer *xs, ADW_CCB *ccb, int flags) { struct scsi_link *sc_link = xs->sc_link; ADW_SOFTC *sc = sc_link->adapter_softc; @@ -718,10 +697,7 @@ adw_build_req(xs, ccb, flags) * Build scatter-gather list for Wide Boards. */ void -adw_build_sglist(ccb, scsiqp, sg_block) - ADW_CCB *ccb; - ADW_SCSI_REQ_Q *scsiqp; - ADW_SG_BLOCK *sg_block; +adw_build_sglist(ADW_CCB *ccb, ADW_SCSI_REQ_Q *scsiqp, ADW_SG_BLOCK *sg_block) { u_long sg_block_next_addr; /* block and its next */ u_int32_t sg_block_physical_addr; @@ -769,8 +745,7 @@ adw_build_sglist(ccb, scsiqp, sg_block) int -adw_intr(arg) - void *arg; +adw_intr(void *arg) { ADW_SOFTC *sc = arg; @@ -787,10 +762,7 @@ adw_intr(arg) * Poll a particular unit, looking for a particular xs */ int -adw_poll(sc, xs, count) - ADW_SOFTC *sc; - struct scsi_xfer *xs; - int count; +adw_poll(ADW_SOFTC *sc, struct scsi_xfer *xs, int count) { int s; @@ -814,8 +786,7 @@ adw_poll(sc, xs, count) void -adw_timeout(arg) - void *arg; +adw_timeout(void *arg) { ADW_CCB *ccb = arg; struct scsi_xfer *xs = ccb->xs; @@ -911,8 +882,7 @@ adw_timeout(arg) void -adw_reset_bus(sc) - ADW_SOFTC *sc; +adw_reset_bus(ADW_SOFTC *sc) { ADW_CCB *ccb; int s; @@ -939,9 +909,7 @@ adw_reset_bus(sc) void -adw_print_info(sc, tid) - ADW_SOFTC *sc; - int tid; +adw_print_info(ADW_SOFTC *sc, int tid) { bus_space_handle_t ioh = sc->sc_ioh; bus_space_tag_t iot = sc->sc_iot; @@ -1001,9 +969,7 @@ adw_print_info(sc, tid) * enabled at the end of the caller. */ void -adw_isr_callback(sc, scsiq) - ADW_SOFTC *sc; - ADW_SCSI_REQ_Q *scsiq; +adw_isr_callback(ADW_SOFTC *sc, ADW_SCSI_REQ_Q *scsiq) { bus_dma_tag_t dmat; ADW_CCB *ccb; @@ -1184,9 +1150,7 @@ NO_ERROR: * adw_async_callback() - Adw Library asynchronous event callback function. */ void -adw_async_callback(sc, code) - ADW_SOFTC *sc; - u_int8_t code; +adw_async_callback(ADW_SOFTC *sc, u_int8_t code) { switch (code) { case ADW_ASYNC_SCSI_BUS_RESET_DET: diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c index b85f85f560c..2852a1531e1 100644 --- a/sys/dev/ic/adwlib.c +++ b/sys/dev/ic/adwlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adwlib.c,v 1.23 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: adwlib.c,v 1.24 2012/01/11 16:22:32 dhill Exp $ */ /* $NetBSD: adwlib.c,v 1.20 2000/07/04 04:17:03 itojun Exp $ */ /* @@ -237,8 +237,7 @@ const static ADW_EEPROM adw_38C1600_Default_EEPROM = { * Note: Chip is stopped on entry. */ int -AdwInitFromEEPROM(sc) -ADW_SOFTC *sc; +AdwInitFromEEPROM(ADW_SOFTC *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -524,8 +523,7 @@ ADW_SOFTC *sc; * On failure return the error code. */ int -AdwInitDriver(sc) -ADW_SOFTC *sc; +AdwInitDriver(ADW_SOFTC *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -928,10 +926,7 @@ ADW_SOFTC *sc; int -AdwRamSelfTest(iot, ioh, chip_type) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t chip_type; +AdwRamSelfTest(bus_space_tag_t iot, bus_space_handle_t ioh, u_int8_t chip_type) { int i; u_int8_t byte; @@ -1017,11 +1012,8 @@ AdwRamSelfTest(iot, ioh, chip_type) int -AdwLoadMCode(iot, ioh, bios_mem, chip_type) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int16_t *bios_mem; - u_int8_t chip_type; +AdwLoadMCode(bus_space_tag_t iot, bus_space_handle_t ioh, u_int16_t *bios_mem, + u_int8_t chip_type) { u_int8_t *mcode_data = NULL; u_int32_t mcode_chksum = 0; @@ -1167,10 +1159,7 @@ AdwLoadMCode(iot, ioh, bios_mem, chip_type) int -AdwASC3550Cabling(iot, ioh, cfg) - bus_space_tag_t iot; - bus_space_handle_t ioh; - ADW_DVC_CFG *cfg; +AdwASC3550Cabling(bus_space_tag_t iot, bus_space_handle_t ioh, ADW_DVC_CFG *cfg) { u_int16_t scsi_cfg1; @@ -1292,10 +1281,8 @@ AdwASC3550Cabling(iot, ioh, cfg) int -AdwASC38C0800Cabling(iot, ioh, cfg) - bus_space_tag_t iot; - bus_space_handle_t ioh; - ADW_DVC_CFG *cfg; +AdwASC38C0800Cabling(bus_space_tag_t iot, bus_space_handle_t ioh, + ADW_DVC_CFG *cfg) { u_int16_t scsi_cfg1; @@ -1421,10 +1408,8 @@ AdwASC38C0800Cabling(iot, ioh, cfg) int -AdwASC38C1600Cabling(iot, ioh, cfg) - bus_space_tag_t iot; - bus_space_handle_t ioh; - ADW_DVC_CFG *cfg; +AdwASC38C1600Cabling(bus_space_tag_t iot, bus_space_handle_t ioh, + ADW_DVC_CFG *cfg) { u_int16_t scsi_cfg1; @@ -1550,10 +1535,8 @@ AdwASC38C1600Cabling(iot, ioh, cfg) * Return a checksum based on the EEPROM configuration read. */ u_int16_t -AdwGetEEPROMConfig(iot, ioh, cfg_buf) - bus_space_tag_t iot; - bus_space_handle_t ioh; - ADW_EEPROM *cfg_buf; +AdwGetEEPROMConfig(bus_space_tag_t iot, bus_space_handle_t ioh, + ADW_EEPROM *cfg_buf) { u_int16_t wval, chksum; u_int16_t *wbuf; @@ -1587,10 +1570,7 @@ AdwGetEEPROMConfig(iot, ioh, cfg_buf) * Read the EEPROM from specified location */ u_int16_t -AdwReadEEPWord(iot, ioh, eep_word_addr) - bus_space_tag_t iot; - bus_space_handle_t ioh; - int eep_word_addr; +AdwReadEEPWord(bus_space_tag_t iot, bus_space_handle_t ioh, int eep_word_addr) { ADW_WRITE_WORD_REGISTER(iot, ioh, IOPW_EE_CMD, ADW_EEP_CMD_READ | eep_word_addr); @@ -1604,9 +1584,7 @@ AdwReadEEPWord(iot, ioh, eep_word_addr) * Wait for EEPROM command to complete */ void -AdwWaitEEPCmd(iot, ioh) - bus_space_tag_t iot; - bus_space_handle_t ioh; +AdwWaitEEPCmd(bus_space_tag_t iot, bus_space_handle_t ioh) { int eep_delay_ms; @@ -1627,10 +1605,8 @@ AdwWaitEEPCmd(iot, ioh) * Write the EEPROM from 'cfg_buf'. */ void -AdwSetEEPROMConfig(iot, ioh, cfg_buf) - bus_space_tag_t iot; - bus_space_handle_t ioh; - ADW_EEPROM *cfg_buf; +AdwSetEEPROMConfig(bus_space_tag_t iot, bus_space_handle_t ioh, + ADW_EEPROM *cfg_buf) { u_int16_t *wbuf; u_int16_t addr, chksum; @@ -1701,9 +1677,7 @@ AdwSetEEPROMConfig(iot, ioh, cfg_buf) * host IC error. */ int -AdwExeScsiQueue(sc, scsiq) -ADW_SOFTC *sc; -ADW_SCSI_REQ_Q *scsiq; +AdwExeScsiQueue(ADW_SOFTC *sc, ADW_SCSI_REQ_Q *scsiq) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1818,9 +1792,7 @@ ADW_SCSI_REQ_Q *scsiq; void -AdwResetChip(iot, ioh) - bus_space_tag_t iot; - bus_space_handle_t ioh; +AdwResetChip(bus_space_tag_t iot, bus_space_handle_t ioh) { /* @@ -1844,8 +1816,7 @@ AdwResetChip(iot, ioh) * may be hung which requires driver recovery. */ int -AdwResetCCB(sc) -ADW_SOFTC *sc; +AdwResetCCB(ADW_SOFTC *sc) { int status; @@ -1889,8 +1860,7 @@ ADW_SOFTC *sc; * ADW_FALSE(0) - Chip re-initialization and SCSI Bus Reset failure. */ int -AdwResetSCSIBus(sc) -ADW_SOFTC *sc; +AdwResetSCSIBus(ADW_SOFTC *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1980,8 +1950,7 @@ ADW_SOFTC *sc; * ADW_FALSE(0) - no interrupt was pending */ int -AdwISR(sc) -ADW_SOFTC *sc; +AdwISR(ADW_SOFTC *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -2139,10 +2108,7 @@ ADW_SOFTC *sc; * ADW_ERROR - command timed out */ int -AdwSendIdleCmd(sc, idle_cmd, idle_cmd_parameter) -ADW_SOFTC *sc; -u_int16_t idle_cmd; -u_int32_t idle_cmd_parameter; +AdwSendIdleCmd(ADW_SOFTC *sc, u_int16_t idle_cmd, u_int32_t idle_cmd_parameter) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -2207,9 +2173,7 @@ u_int32_t idle_cmd_parameter; * Queuing. */ void -AdwInquiryHandling(sc, scsiq) -ADW_SOFTC *sc; -ADW_SCSI_REQ_Q *scsiq; +AdwInquiryHandling(ADW_SOFTC *sc, ADW_SCSI_REQ_Q *scsiq) { #ifndef FAILSAFE bus_space_tag_t iot = sc->sc_iot; @@ -2382,8 +2346,7 @@ ADW_SCSI_REQ_Q *scsiq; void -AdwSleepMilliSecond(n) -u_int32_t n; +AdwSleepMilliSecond(u_int32_t n) { DELAY(n * 1000); @@ -2391,8 +2354,7 @@ u_int32_t n; void -AdwDelayMicroSecond(n) -u_int32_t n; +AdwDelayMicroSecond(u_int32_t n) { DELAY(n); diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 029fecc21de..d4266aa050f 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3.c,v 1.76 2009/11/24 18:12:39 claudio Exp $ */ +/* $OpenBSD: elink3.c,v 1.77 2012/01/11 16:22:33 dhill Exp $ */ /* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */ /* @@ -184,9 +184,7 @@ static __inline int ep_w1_reg(struct ep_softc *, int); * Used for global reset, TX_RESET, RX_RESET. */ static inline void -ep_reset_cmd(sc, cmd, arg) - struct ep_softc *sc; - u_int cmd, arg; +ep_reset_cmd(struct ep_softc *sc, u_int cmd, u_int arg) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -199,9 +197,7 @@ ep_reset_cmd(sc, cmd, arg) * Wait for any pending reset to complete. */ static inline void -ep_finish_reset(iot, ioh) - bus_space_tag_t iot; - bus_space_handle_t ioh; +ep_finish_reset(bus_space_tag_t iot, bus_space_handle_t ioh) { int i; @@ -214,9 +210,7 @@ ep_finish_reset(iot, ioh) } static inline void -ep_discard_rxtop(iot, ioh) - bus_space_tag_t iot; - bus_space_handle_t ioh; +ep_discard_rxtop(bus_space_tag_t iot, bus_space_handle_t ioh) { int i; @@ -242,9 +236,7 @@ ep_discard_rxtop(iot, ioh) * Some chips (i.e., 3c574 RoadRunner) have Window 1 registers offset. */ static __inline int -ep_w1_reg(sc, reg) - struct ep_softc *sc; - int reg; +ep_w1_reg(struct ep_softc *sc, int reg) { switch (sc->ep_chipset) { case EP_CHIPSET_ROADRUNNER: @@ -263,10 +255,7 @@ ep_w1_reg(sc, reg) * Back-end attach and configure. */ void -epconfig(sc, chipset, enaddr) - struct ep_softc *sc; - u_short chipset; - u_int8_t *enaddr; +epconfig(struct ep_softc *sc, u_short chipset, u_int8_t *enaddr) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; bus_space_tag_t iot = sc->sc_iot; @@ -442,8 +431,7 @@ epconfig(sc, chipset, enaddr) } int -ep_detach(self) - struct device *self; +ep_detach(struct device *self) { struct ep_softc *sc = (struct ep_softc *)self; struct ifnet *ifp = &sc->sc_arpcom.ac_if; @@ -470,8 +458,7 @@ ep_detach(self) * XXX what about 3c515, pcmcia 10/100? */ void -ep_isa_probemedia(sc) - struct ep_softc *sc; +ep_isa_probemedia(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -523,8 +510,7 @@ ep_isa_probemedia(sc) * XXX how much of this works with 3c515, pcmcia 10/100? */ void -ep_vortex_probemedia(sc) - struct ep_softc *sc; +ep_vortex_probemedia(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -589,8 +575,7 @@ ep_vortex_probemedia(sc) * interrupts. ?! */ void -epinit(sc) - register struct ep_softc *sc; +epinit(struct ep_softc *sc) { register struct ifnet *ifp = &sc->sc_arpcom.ac_if; bus_space_tag_t iot = sc->sc_iot; @@ -695,8 +680,7 @@ epinit(sc) * Enable reception of all multicasts and filter in software. */ void -epsetfilter(sc) - register struct ep_softc *sc; +epsetfilter(struct ep_softc *sc) { register struct ifnet *ifp = &sc->sc_arpcom.ac_if; @@ -709,8 +693,7 @@ epsetfilter(sc) int -ep_media_change(ifp) - struct ifnet *ifp; +ep_media_change(struct ifnet *ifp) { register struct ep_softc *sc = ifp->if_softc; @@ -721,8 +704,7 @@ ep_media_change(ifp) * Reset and enable the MII on the RoadRunner. */ void -ep_roadrunner_mii_enable(sc) - struct ep_softc *sc; +ep_roadrunner_mii_enable(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -748,9 +730,7 @@ ep_roadrunner_mii_enable(sc) * update media field in w0_address_config, and power on selected xcvr. */ int -epsetmedia(sc, medium) - struct ep_softc *sc; - int medium; +epsetmedia(struct ep_softc *sc, int medium) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -897,9 +877,7 @@ epsetmedia(sc, medium) * (if_media callback, may be called before interface is brought up). */ void -ep_media_status(ifp, req) - struct ifnet *ifp; - struct ifmediareq *req; +ep_media_status(struct ifnet *ifp, struct ifmediareq *req) { register struct ep_softc *sc = ifp->if_softc; bus_space_tag_t iot = sc->sc_iot; @@ -967,8 +945,7 @@ ep_media_status(ifp, req) * Always called as splnet(). */ void -epstart(ifp) - struct ifnet *ifp; +epstart(struct ifnet *ifp) { register struct ep_softc *sc = ifp->if_softc; bus_space_tag_t iot = sc->sc_iot; @@ -1111,8 +1088,7 @@ readcheck: * on the cable (once in a blue moon). */ int -epstatus(sc) - register struct ep_softc *sc; +epstatus(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1164,8 +1140,7 @@ epstatus(sc) void -eptxstat(sc) - register struct ep_softc *sc; +eptxstat(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1211,8 +1186,7 @@ eptxstat(sc) } int -epintr(arg) - void *arg; +epintr(void *arg) { register struct ep_softc *sc = arg; bus_space_tag_t iot = sc->sc_iot; @@ -1261,8 +1235,7 @@ epintr(arg) } void -epread(sc) - register struct ep_softc *sc; +epread(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1367,9 +1340,7 @@ abort: } struct mbuf * -epget(sc, totlen) - struct ep_softc *sc; - int totlen; +epget(struct ep_softc *sc, int totlen) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1447,10 +1418,7 @@ epget(sc, totlen) } int -epioctl(ifp, cmd, data) - register struct ifnet *ifp; - u_long cmd; - caddr_t data; +epioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ep_softc *sc = ifp->if_softc; struct ifaddr *ifa = (struct ifaddr *)data; @@ -1521,8 +1489,7 @@ epioctl(ifp, cmd, data) } void -epreset(sc) - struct ep_softc *sc; +epreset(struct ep_softc *sc) { int s; @@ -1532,8 +1499,7 @@ epreset(sc) } void -epwatchdog(ifp) - struct ifnet *ifp; +epwatchdog(struct ifnet *ifp) { struct ep_softc *sc = ifp->if_softc; @@ -1544,8 +1510,7 @@ epwatchdog(ifp) } void -epstop(sc) - register struct ep_softc *sc; +epstop(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1597,10 +1562,7 @@ epstop(sc) * NOTE: the caller must provide an i/o handle for ELINK_ID_PORT! */ u_int16_t -epreadeeprom(iot, ioh, offset) - bus_space_tag_t iot; - bus_space_handle_t ioh; - int offset; +epreadeeprom(bus_space_tag_t iot, bus_space_handle_t ioh, int offset) { u_int16_t data = 0; int i; @@ -1613,8 +1575,7 @@ epreadeeprom(iot, ioh, offset) } int -epbusyeeprom(sc) - struct ep_softc *sc; +epbusyeeprom(struct ep_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -1642,9 +1603,7 @@ epbusyeeprom(sc) } u_int16_t -ep_read_eeprom(sc, offset) - struct ep_softc *sc; - u_int16_t offset; +ep_read_eeprom(struct ep_softc *sc, u_int16_t offset) { u_int16_t readcmd; @@ -1668,8 +1627,7 @@ ep_read_eeprom(sc, offset) } void -epmbuffill(v) - void *v; +epmbuffill(void *v) { struct ep_softc *sc = v; int s, i; @@ -1689,8 +1647,7 @@ epmbuffill(v) } void -epmbufempty(sc) - struct ep_softc *sc; +epmbufempty(struct ep_softc *sc) { int s, i; @@ -1707,9 +1664,7 @@ epmbufempty(sc) } void -ep_mii_setbit(sc, bit) - struct ep_softc *sc; - u_int16_t bit; +ep_mii_setbit(struct ep_softc *sc, u_int16_t bit) { u_int16_t val; @@ -1720,9 +1675,7 @@ ep_mii_setbit(sc, bit) } void -ep_mii_clrbit(sc, bit) - struct ep_softc *sc; - u_int16_t bit; +ep_mii_clrbit(struct ep_softc *sc, u_int16_t bit) { u_int16_t val; @@ -1733,9 +1686,7 @@ ep_mii_clrbit(sc, bit) } u_int16_t -ep_mii_readbit(sc, bit) - struct ep_softc *sc; - u_int16_t bit; +ep_mii_readbit(struct ep_softc *sc, u_int16_t bit) { /* We assume we're already in Window 4 */ @@ -1744,8 +1695,7 @@ ep_mii_readbit(sc, bit) } void -ep_mii_sync(sc) - struct ep_softc *sc; +ep_mii_sync(struct ep_softc *sc) { int i; @@ -1758,10 +1708,7 @@ ep_mii_sync(sc) } void -ep_mii_sendbits(sc, data, nbits) - struct ep_softc *sc; - u_int32_t data; - int nbits; +ep_mii_sendbits(struct ep_softc *sc, u_int32_t data, int nbits) { int i; @@ -1780,9 +1727,7 @@ ep_mii_sendbits(sc, data, nbits) } int -ep_mii_readreg(self, phy, reg) - struct device *self; - int phy, reg; +ep_mii_readreg(struct device *self, int phy, int reg) { struct ep_softc *sc = (struct ep_softc *)self; int val = 0, i, err; @@ -1826,9 +1771,7 @@ ep_mii_readreg(self, phy, reg) } void -ep_mii_writereg(self, phy, reg, val) - struct device *self; - int phy, reg, val; +ep_mii_writereg(struct device *self, int phy, int reg, int val) { struct ep_softc *sc = (struct ep_softc *)self; @@ -1853,8 +1796,7 @@ ep_mii_writereg(self, phy, reg, val) } void -ep_statchg(self) - struct device *self; +ep_statchg(struct device *self) { struct ep_softc *sc = (struct ep_softc *)self; bus_space_tag_t iot = sc->sc_iot; diff --git a/sys/dev/ic/iha.c b/sys/dev/ic/iha.c index 98e17042445..dfa2b2a7a63 100644 --- a/sys/dev/ic/iha.c +++ b/sys/dev/ic/iha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iha.c,v 1.40 2010/10/03 21:14:40 krw Exp $ */ +/* $OpenBSD: iha.c,v 1.41 2012/01/11 16:22:33 dhill Exp $ */ /*------------------------------------------------------------------------- * * Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller. @@ -169,8 +169,7 @@ void iha_abort_xs(struct iha_softc *, struct scsi_xfer *, u_int8_t); * iha_intr - the interrupt service routine for the iha driver */ int -iha_intr(arg) - void *arg; +iha_intr(void *arg) { bus_space_handle_t ioh; struct iha_softc *sc; @@ -207,9 +206,7 @@ iha_intr(arg) * pScb->SCB_DataDma. */ int -iha_setup_sg_list(sc, pScb) - struct iha_softc *sc; - struct iha_scb *pScb; +iha_setup_sg_list(struct iha_softc *sc, struct iha_scb *pScb) { bus_dma_segment_t *segs = pScb->SCB_DataDma->dm_segs; int i, error, nseg = pScb->SCB_DataDma->dm_nsegs; @@ -253,8 +250,7 @@ iha_setup_sg_list(sc, pScb) * sc_adapter.scsi_cmd of iha_softc. */ void -iha_scsi_cmd(xs) - struct scsi_xfer *xs; +iha_scsi_cmd(struct scsi_xfer *xs) { struct iha_scb *pScb; struct scsi_link *sc_link = xs->sc_link; @@ -337,8 +333,7 @@ iha_scsi_cmd(xs) * iha_softc structure supplied */ int -iha_init_tulip(sc) - struct iha_softc *sc; +iha_init_tulip(struct iha_softc *sc) { struct iha_scb *pScb; struct iha_nvram_scsi *pScsi; @@ -472,9 +467,7 @@ iha_minphys(struct buf *bp, struct scsi_link *sl) * iha_reset_dma - abort any active DMA xfer, reset tulip FIFO. */ void -iha_reset_dma(iot, ioh) - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_reset_dma(bus_space_tag_t iot, bus_space_handle_t ioh) { if ((bus_space_read_1(iot, ioh, TUL_ISTUS1) & XPEND) != 0) { /* if DMA xfer is pending, abort DMA xfer */ @@ -491,8 +484,7 @@ iha_reset_dma(iot, ioh) * iha_scb_alloc - return the first free SCB, or NULL if there are none. */ void * -iha_scb_alloc(xsc) - void *xsc; +iha_scb_alloc(void *xsc) { struct iha_softc *sc = xsc; struct iha_scb *pScb; @@ -555,9 +547,7 @@ iha_scb_free(void *xsc, void *xscb) } void -iha_append_pend_scb(sc, pScb) - struct iha_softc *sc; - struct iha_scb *pScb; +iha_append_pend_scb(struct iha_softc *sc, struct iha_scb *pScb) { /* ASSUMPTION: only called within a splbio()/splx() pair */ @@ -570,9 +560,7 @@ iha_append_pend_scb(sc, pScb) } void -iha_push_pend_scb(sc, pScb) - struct iha_softc *sc; - struct iha_scb *pScb; +iha_push_pend_scb(struct iha_softc *sc, struct iha_scb *pScb) { int s; @@ -595,8 +583,7 @@ iha_push_pend_scb(sc, pScb) * is an active SCB, return NULL! */ struct iha_scb * -iha_find_pend_scb(sc) - struct iha_softc *sc; +iha_find_pend_scb(struct iha_softc *sc) { struct iha_scb *pScb; struct tcs *pTcs; @@ -650,8 +637,7 @@ iha_find_pend_scb(sc) } void -iha_mark_busy_scb(pScb) - struct iha_scb *pScb; +iha_mark_busy_scb(struct iha_scb *pScb) { int s; @@ -668,10 +654,7 @@ iha_mark_busy_scb(pScb) } void -iha_append_done_scb(sc, pScb, hastat) - struct iha_softc *sc; - struct iha_scb *pScb; - u_int8_t hastat; +iha_append_done_scb(struct iha_softc *sc, struct iha_scb *pScb, u_int8_t hastat) { struct tcs *pTcs; int s; @@ -701,8 +684,7 @@ iha_append_done_scb(sc, pScb, hastat) } struct iha_scb * -iha_pop_done_scb(sc) - struct iha_softc *sc; +iha_pop_done_scb(struct iha_softc *sc) { struct iha_scb *pScb; int s; @@ -727,10 +709,7 @@ iha_pop_done_scb(sc) * queue with the supplied host status value. */ void -iha_abort_xs(sc, xs, hastat) - struct iha_softc *sc; - struct scsi_xfer *xs; - u_int8_t hastat; +iha_abort_xs(struct iha_softc *sc, struct scsi_xfer *xs, u_int8_t hastat) { struct iha_scb *pScb, *next; int i, s; @@ -776,8 +755,7 @@ iha_abort_xs(sc, xs, hastat) * correct/expected sequence. Reset the SCSI bus. */ void -iha_bad_seq(sc) - struct iha_softc *sc; +iha_bad_seq(struct iha_softc *sc) { struct iha_scb *pScb = sc->HCS_ActScb; @@ -794,9 +772,7 @@ iha_bad_seq(sc) * queue with a REQUEST_SENSE CDB. */ int -iha_push_sense_request(sc, pScb) - struct iha_softc *sc; - struct iha_scb *pScb; +iha_push_sense_request(struct iha_softc *sc, struct iha_scb *pScb) { struct scsi_sense *sensecmd; int error; @@ -875,10 +851,7 @@ iha_push_sense_request(sc, pScb) * SCB's that can be started. */ void -iha_main(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_main(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb; @@ -937,10 +910,7 @@ iha_scsi_label: * start another SCB currently in the pending queue. */ void -iha_scsi(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_scsi(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb; struct tcs *pTcs; @@ -1051,8 +1021,7 @@ iha_scsi(sc, iot, ioh) * www.t10.org for the curious with a .pdf reader. */ u_int8_t -iha_data_over_run(pScb) - struct iha_scb *pScb; +iha_data_over_run(struct iha_scb *pScb) { switch (pScb->SCB_CDB[0]) { case 0x03: /* Request Sense SPC-2 */ @@ -1106,10 +1075,8 @@ iha_data_over_run(pScb) * SCB_NxtStat member. */ int -iha_next_state(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_next_state(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { if (sc->HCS_ActScb == NULL) return (-1); @@ -1180,10 +1147,7 @@ iha_next_state(sc, iot, ioh) * which will send the SCSI CDB to the target. */ int -iha_state_1(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_1(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; struct tcs *pTcs; @@ -1241,10 +1205,7 @@ iha_state_1(sc, iot, ioh) * the SCSI CDB. */ int -iha_state_2(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_2(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; @@ -1268,10 +1229,7 @@ iha_state_2(sc, iot, ioh) * abandoned. */ int -iha_state_3(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_3(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; u_int16_t flags; @@ -1327,10 +1285,7 @@ iha_state_3(sc, iot, ioh) * processing the current SCB. */ int -iha_state_4(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_4(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; @@ -1390,10 +1345,7 @@ iha_state_4(sc, iot, ioh) * If not go to state 6 and finish the SCB. */ int -iha_state_5(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_5(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; struct iha_sg_element *pSg; @@ -1491,10 +1443,7 @@ iha_state_5(sc, iot, ioh) * the bus is free. */ int -iha_state_6(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_6(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { for (;;) switch (sc->HCS_Phase) { @@ -1534,10 +1483,7 @@ iha_state_6(sc, iot, ioh) * iha_state_8 - reset the active device and all busy SCBs using it */ int -iha_state_8(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_state_8(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb; u_int32_t i; @@ -1584,11 +1530,8 @@ iha_state_8(sc, iot, ioh) * iha_xfer_data - initiate the DMA xfer of the data */ int -iha_xfer_data(pScb, iot, ioh, direction) - struct iha_scb *pScb; - bus_space_tag_t iot; - bus_space_handle_t ioh; - int direction; +iha_xfer_data(struct iha_scb *pScb, bus_space_tag_t iot, bus_space_handle_t ioh, + int direction) { u_int32_t xferaddr, xferlen; u_int8_t xfertype; @@ -1625,10 +1568,7 @@ iha_xfer_data(pScb, iot, ioh, direction) } int -iha_xpad_in(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_xpad_in(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; @@ -1657,10 +1597,7 @@ iha_xpad_in(sc, iot, ioh) } int -iha_xpad_out(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_xpad_out(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb = sc->HCS_ActScb; @@ -1692,10 +1629,8 @@ iha_xpad_out(sc, iot, ioh) } int -iha_status_msg(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_status_msg(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { struct iha_scb *pScb; u_int8_t msg; @@ -1765,10 +1700,7 @@ iha_status_msg(sc, iot, ioh) * if an I/O was active. */ void -iha_busfree(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_busfree(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb; @@ -1790,8 +1722,7 @@ iha_busfree(sc, iot, ioh) } void -iha_reset_scsi_bus(sc) - struct iha_softc *sc; +iha_reset_scsi_bus(struct iha_softc *sc) { struct iha_scb *pScb; struct tcs *pTcs; @@ -1825,17 +1756,14 @@ iha_reset_scsi_bus(sc) * iha_resel - handle a detected SCSI bus reselection request. */ int -iha_resel(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_resel(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct iha_scb *pScb; struct tcs *pTcs; u_int8_t tag, target, lun, msg, abortmsg; if (sc->HCS_ActScb != NULL) { - if ((sc->HCS_ActScb->SCB_Status == STATUS_SELECT)) + if (sc->HCS_ActScb->SCB_Status == STATUS_SELECT) iha_push_pend_scb(sc, sc->HCS_ActScb); sc->HCS_ActScb = NULL; } @@ -1914,10 +1842,7 @@ abort: } int -iha_msgin(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgin(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { u_int16_t flags; u_int8_t msg; @@ -1982,10 +1907,8 @@ iha_msgin(sc, iot, ioh) } int -iha_msgin_ignore_wid_resid(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgin_ignore_wid_resid(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { int phase; @@ -2007,10 +1930,8 @@ iha_msgin_ignore_wid_resid(sc, iot, ioh) } int -iha_msgin_extended(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgin_extended(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { u_int16_t flags; int i, phase, msglen, msgcode; @@ -2097,8 +2018,7 @@ iha_msgin_extended(sc, iot, ioh) * as needed and return 1. Else return 0. */ int -iha_msgin_sdtr(sc) - struct iha_softc *sc; +iha_msgin_sdtr(struct iha_softc *sc) { u_int16_t flags; u_int8_t default_period; @@ -2137,11 +2057,8 @@ iha_msgin_sdtr(sc) } int -iha_msgout(sc, iot, ioh, msg) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t msg; +iha_msgout(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh, u_int8_t msg) { bus_space_write_1(iot, ioh, TUL_SFIFO, msg); @@ -2149,11 +2066,8 @@ iha_msgout(sc, iot, ioh, msg) } void -iha_msgout_abort(sc, iot, ioh, aborttype) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t aborttype; +iha_msgout_abort(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh, u_int8_t aborttype) { iha_set_ssig(iot, ioh, REQ | BSY | SEL, ATN); @@ -2174,10 +2088,8 @@ iha_msgout_abort(sc, iot, ioh, aborttype) } int -iha_msgout_reject(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgout_reject(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { iha_set_ssig(iot, ioh, REQ | BSY | SEL, ATN); @@ -2188,10 +2100,8 @@ iha_msgout_reject(sc, iot, ioh) } int -iha_msgout_extended(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgout_extended(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { int phase; @@ -2209,10 +2119,8 @@ iha_msgout_extended(sc, iot, ioh) } int -iha_msgout_wdtr(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgout_wdtr(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { sc->HCS_ActScb->SCB_Tcs->TCS_Flags |= FLAG_WIDE_DONE; @@ -2224,10 +2132,8 @@ iha_msgout_wdtr(sc, iot, ioh) } int -iha_msgout_sdtr(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_msgout_sdtr(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { u_int16_t rateindex; u_int8_t sync_rate; @@ -2245,10 +2151,7 @@ iha_msgout_sdtr(sc, iot, ioh) } void -iha_wide_done(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_wide_done(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct tcs *pTcs = sc->HCS_ActScb->SCB_Tcs; @@ -2266,10 +2169,7 @@ iha_wide_done(sc, iot, ioh) } void -iha_sync_done(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_sync_done(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh) { struct tcs *pTcs = sc->HCS_ActScb->SCB_Tcs; int i; @@ -2295,10 +2195,8 @@ iha_sync_done(sc, iot, ioh) } void -iha_reset_chip(sc, iot, ioh) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; +iha_reset_chip(struct iha_softc *sc, bus_space_tag_t iot, + bus_space_handle_t ioh) { int i; @@ -2322,12 +2220,8 @@ iha_reset_chip(sc, iot, ioh) } void -iha_select(sc, iot, ioh, pScb, select_type) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; - struct iha_scb *pScb; - u_int8_t select_type; +iha_select(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh, + struct iha_scb *pScb, u_int8_t select_type) { int s; @@ -2381,11 +2275,8 @@ iha_select(sc, iot, ioh, pScb, select_type) * the command is NO_OP, skip the command writing. */ int -iha_wait(sc, iot, ioh, cmd) - struct iha_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t cmd; +iha_wait(struct iha_softc *sc, bus_space_tag_t iot, bus_space_handle_t ioh, + u_int8_t cmd) { if (cmd != NO_OP) bus_space_write_1(iot, ioh, TUL_SCMD, cmd); @@ -2451,9 +2342,7 @@ iha_wait(sc, iot, ioh, cmd) * adaptor, now we look to see how the operation went. */ void -iha_done_scb(sc, pScb) - struct iha_softc *sc; - struct iha_scb *pScb; +iha_done_scb(struct iha_softc *sc, struct iha_scb *pScb) { struct scsi_sense_data *s1, *s2; struct scsi_xfer *xs = pScb->SCB_Xs; @@ -2540,8 +2429,7 @@ iha_done_scb(sc, pScb) } void -iha_timeout(arg) - void *arg; +iha_timeout(void *arg) { struct iha_scb *pScb = (struct iha_scb *)arg; struct scsi_xfer *xs = pScb->SCB_Xs; @@ -2554,9 +2442,7 @@ iha_timeout(arg) } void -iha_exec_scb(sc, pScb) - struct iha_softc *sc; - struct iha_scb *pScb; +iha_exec_scb(struct iha_softc *sc, struct iha_scb *pScb) { bus_space_handle_t ioh; bus_space_tag_t iot; @@ -2598,10 +2484,8 @@ iha_exec_scb(sc, pScb) * one which turns off/on the specified signals. */ void -iha_set_ssig( iot, ioh, offsigs, onsigs) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t offsigs, onsigs; +iha_set_ssig(bus_space_tag_t iot, bus_space_handle_t ioh, u_int8_t offsigs, + u_int8_t onsigs) { u_int8_t currsigs; @@ -2610,9 +2494,7 @@ iha_set_ssig( iot, ioh, offsigs, onsigs) } void -iha_print_info(sc, target) - struct iha_softc *sc; - int target; +iha_print_info(struct iha_softc *sc, int target) { u_int8_t period = sc->HCS_Tcs[target].TCS_JS_Period; u_int8_t config = sc->HCS_Tcs[target].TCS_SConfig0; @@ -2642,8 +2524,7 @@ iha_print_info(sc, target) * iha_alloc_scbs - allocate and map the SCB's for the supplied iha_softc */ int -iha_alloc_scbs(sc) - struct iha_softc *sc; +iha_alloc_scbs(struct iha_softc *sc) { bus_dma_segment_t seg; int error, rseg; @@ -2676,10 +2557,8 @@ iha_alloc_scbs(sc) * by parameter nvram. */ void -iha_read_eeprom(iot, ioh, nvram) - bus_space_tag_t iot; - bus_space_handle_t ioh; - struct iha_nvram *nvram; +iha_read_eeprom(bus_space_tag_t iot, bus_space_handle_t ioh, + struct iha_nvram *nvram) { u_int32_t chksum; u_int16_t *np; @@ -2717,10 +2596,7 @@ iha_read_eeprom(iot, ioh, nvram) * */ u_int16_t -iha_se2_rd(iot, ioh, addr) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t addr; +iha_se2_rd(bus_space_tag_t iot, bus_space_handle_t ioh, u_int8_t addr) { u_int16_t readWord; u_int8_t bit; @@ -2754,10 +2630,7 @@ iha_se2_rd(iot, ioh, addr) * iha_se2_instr - write an octet to serial E2PROM one bit at a time */ void -iha_se2_instr(iot, ioh, instr) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t instr; +iha_se2_instr(bus_space_tag_t iot, bus_space_handle_t ioh, u_int8_t instr) { u_int8_t b; int i; @@ -2794,9 +2667,7 @@ iha_se2_instr(iot, ioh, instr) * the other bits are fixed at initialization. */ void -iha_reset_tcs(pTcs, config0) - struct tcs *pTcs; - u_int8_t config0; +iha_reset_tcs(struct tcs *pTcs, u_int8_t config0) { pTcs->TCS_Flags &= ~(FLAG_SYNC_DONE | FLAG_WIDE_DONE); pTcs->TCS_JS_Period = 0; diff --git a/sys/dev/ic/lpt.c b/sys/dev/ic/lpt.c index 046dc87611b..4053411ebc3 100644 --- a/sys/dev/ic/lpt.c +++ b/sys/dev/ic/lpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpt.c,v 1.8 2011/09/17 08:36:06 miod Exp $ */ +/* $OpenBSD: lpt.c,v 1.9 2012/01/11 16:22:33 dhill Exp $ */ /* $NetBSD: lpt.c,v 1.42 1996/10/21 22:41:14 thorpej Exp $ */ /* @@ -110,12 +110,8 @@ int lptpushbytes(struct lpt_softc *); * Internal routine to lptprobe to do port tests of one byte value. */ int -lpt_port_test(iot, ioh, base, off, data, mask) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_addr_t base; - bus_size_t off; - u_int8_t data, mask; +lpt_port_test(bus_space_tag_t iot, bus_space_handle_t ioh, bus_addr_t base, + bus_size_t off, u_int8_t data, u_int8_t mask) { int timeout; u_int8_t temp; @@ -133,8 +129,7 @@ lpt_port_test(iot, ioh, base, off, data, mask) } void -lpt_attach_common(sc) - struct lpt_softc *sc; +lpt_attach_common(struct lpt_softc *sc) { printf("\n"); @@ -147,11 +142,7 @@ lpt_attach_common(sc) * Reset the printer, then wait until it's selected and not busy. */ int -lptopen(dev, flag, mode, p) - dev_t dev; - int flag; - int mode; - struct proc *p; +lptopen(dev_t dev, int flag, int mode, struct proc *p) { int unit = LPTUNIT(dev); u_int8_t flags = LPTFLAGS(dev); @@ -229,9 +220,7 @@ lptopen(dev, flag, mode, p) } int -lpt_not_ready(status, sc) - u_int8_t status; - struct lpt_softc *sc; +lpt_not_ready(u_int8_t status, struct lpt_softc *sc) { u_int8_t new; @@ -250,8 +239,7 @@ lpt_not_ready(status, sc) } void -lptwakeup(arg) - void *arg; +lptwakeup(void *arg) { struct lpt_softc *sc = arg; int s; @@ -267,11 +255,7 @@ lptwakeup(arg) * Close the device, and free the local line buffer. */ int -lptclose(dev, flag, mode, p) - dev_t dev; - int flag; - int mode; - struct proc *p; +lptclose(dev_t dev, int flag, int mode, struct proc *p) { int unit = LPTUNIT(dev); struct lpt_softc *sc = lpt_cd.cd_devs[unit]; @@ -294,8 +278,7 @@ lptclose(dev, flag, mode, p) } int -lptpushbytes(sc) - struct lpt_softc *sc; +lptpushbytes(struct lpt_softc *sc) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -362,10 +345,7 @@ lptpushbytes(sc) * chars moved to the output queue. */ int -lptwrite(dev, uio, flags) - dev_t dev; - struct uio *uio; - int flags; +lptwrite(dev_t dev, struct uio *uio, int flags) { struct lpt_softc *sc = lpt_cd.cd_devs[LPTUNIT(dev)]; size_t n; @@ -395,8 +375,7 @@ lptwrite(dev, uio, flags) * another char. */ int -lptintr(arg) - void *arg; +lptintr(void *arg) { struct lpt_softc *sc = arg; bus_space_tag_t iot = sc->sc_iot; diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c index 04a70c9e613..4ad6df0a432 100644 --- a/sys/dev/pci/auich.c +++ b/sys/dev/pci/auich.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auich.c,v 1.95 2011/07/03 15:47:16 matthew Exp $ */ +/* $OpenBSD: auich.c,v 1.96 2012/01/11 16:22:33 dhill Exp $ */ /* * Copyright (c) 2000,2001 Michael Shalayeff @@ -364,10 +364,7 @@ unsigned int auich_calibrate(struct auich_softc *); void auich_spdif_event(void *, int); int -auich_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; +auich_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; int i; @@ -381,9 +378,7 @@ auich_match(parent, match, aux) } void -auich_attach(parent, self, aux) - struct device *parent, *self; - void *aux; +auich_attach(struct device *parent, struct device *self, void *aux) { struct auich_softc *sc = (struct auich_softc *)self; struct pci_attach_args *pa = aux; @@ -581,10 +576,7 @@ auich_activate(struct device *self, int act) } int -auich_read_codec(v, reg, val) - void *v; - u_int8_t reg; - u_int16_t *val; +auich_read_codec(void *v, u_int8_t reg, u_int16_t *val) { struct auich_softc *sc = v; int i; @@ -606,10 +598,7 @@ auich_read_codec(v, reg, val) } int -auich_write_codec(v, reg, val) - void *v; - u_int8_t reg; - u_int16_t val; +auich_write_codec(void *v, u_int8_t reg, u_int16_t val) { struct auich_softc *sc = v; int i; @@ -631,9 +620,7 @@ auich_write_codec(v, reg, val) } int -auich_attach_codec(v, cif) - void *v; - struct ac97_codec_if *cif; +auich_attach_codec(void *v, struct ac97_codec_if *cif) { struct auich_softc *sc = v; @@ -642,8 +629,7 @@ auich_attach_codec(v, cif) } void -auich_reset_codec(v) - void *v; +auich_reset_codec(void *v) { struct auich_softc *sc = v; u_int32_t control; @@ -679,9 +665,7 @@ auich_spdif_event(void *v, int flag) } int -auich_open(v, flags) - void *v; - int flags; +auich_open(void *v, int flags) { struct auich_softc *sc = v; @@ -694,8 +678,7 @@ auich_open(v, flags) } void -auich_close(v) - void *v; +auich_close(void *v) { struct auich_softc *sc = v; @@ -709,9 +692,7 @@ auich_get_default_params(void *addr, int mode, struct audio_params *params) } int -auich_query_encoding(v, aep) - void *v; - struct audio_encoding *aep; +auich_query_encoding(void *v, struct audio_encoding *aep) { struct auich_softc *sc = v; if (sc->sc_spdif) { @@ -787,10 +768,8 @@ auich_query_encoding(v, aep) } int -auich_set_params(v, setmode, usemode, play, rec) - void *v; - int setmode, usemode; - struct audio_params *play, *rec; +auich_set_params(void *v, int setmode, int usemode, + struct audio_params *play, struct audio_params *rec) { struct auich_softc *sc = v; struct ac97_codec_if *codec = sc->codec_if; @@ -1211,9 +1190,7 @@ auich_set_params(v, setmode, usemode, play, rec) } int -auich_round_blocksize(v, blk) - void *v; - int blk; +auich_round_blocksize(void *v, int blk) { return (blk + 0x3f) & ~0x3f; } @@ -1251,8 +1228,7 @@ auich_halt_pipe(struct auich_softc *sc, int pipe, struct auich_ring *ring) int -auich_halt_output(v) - void *v; +auich_halt_output(void *v) { struct auich_softc *sc = v; @@ -1266,8 +1242,7 @@ auich_halt_output(v) } int -auich_halt_input(v) - void *v; +auich_halt_input(void *v) { struct auich_softc *sc = v; @@ -1285,9 +1260,7 @@ auich_halt_input(v) } int -auich_getdev(v, adp) - void *v; - struct audio_device *adp; +auich_getdev(void *v, struct audio_device *adp) { struct auich_softc *sc = v; *adp = sc->sc_audev; @@ -1295,38 +1268,28 @@ auich_getdev(v, adp) } int -auich_set_port(v, cp) - void *v; - mixer_ctrl_t *cp; +auich_set_port(void *v, mixer_ctrl_t *cp) { struct auich_softc *sc = v; return sc->codec_if->vtbl->mixer_set_port(sc->codec_if, cp); } int -auich_get_port(v, cp) - void *v; - mixer_ctrl_t *cp; +auich_get_port(void *v, mixer_ctrl_t *cp) { struct auich_softc *sc = v; return sc->codec_if->vtbl->mixer_get_port(sc->codec_if, cp); } int -auich_query_devinfo(v, dp) - void *v; - mixer_devinfo_t *dp; +auich_query_devinfo(void *v, mixer_devinfo_t *dp) { struct auich_softc *sc = v; return sc->codec_if->vtbl->query_devinfo(sc->codec_if, dp); } void * -auich_allocm(v, direction, size, pool, flags) - void *v; - int direction; - size_t size; - int pool, flags; +auich_allocm(void *v, int direction, size_t size, int pool, int flags) { struct auich_softc *sc = v; struct auich_dma *p; @@ -1381,10 +1344,7 @@ auich_freem(void *v, void *ptr, int pool) } size_t -auich_round_buffersize(v, direction, size) - void *v; - int direction; - size_t size; +auich_round_buffersize(void *v, int direction, size_t size) { if (size > AUICH_DMALIST_MAX * AUICH_DMASEG_MAX) size = AUICH_DMALIST_MAX * AUICH_DMASEG_MAX; @@ -1393,11 +1353,7 @@ auich_round_buffersize(v, direction, size) } paddr_t -auich_mappage(v, mem, off, prot) - void *v; - void *mem; - off_t off; - int prot; +auich_mappage(void *v, void *mem, off_t off, int prot) { struct auich_softc *sc = v; struct auich_dma *p; @@ -1418,15 +1374,13 @@ auich_mappage(v, mem, off, prot) } int -auich_get_props(v) - void *v; +auich_get_props(void *v) { return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX; } int -auich_intr(v) - void *v; +auich_intr(void *v) { struct auich_softc *sc = v; int ret = 0, sts, gsts; @@ -1615,13 +1569,8 @@ auich_intr_pipe(struct auich_softc *sc, int pipe, struct auich_ring *ring) int -auich_trigger_output(v, start, end, blksize, intr, arg, param) - void *v; - void *start, *end; - int blksize; - void (*intr)(void *); - void *arg; - struct audio_params *param; +auich_trigger_output(void *v, void *start, void *end, int blksize, + void (*intr)(void *), void *arg, struct audio_params *param) { struct auich_softc *sc = v; struct auich_dma *p; diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index 5f527032f40..b24d20a84e7 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4280.c,v 1.40 2011/07/03 15:47:17 matthew Exp $ */ +/* $OpenBSD: cs4280.c,v 1.41 2012/01/11 16:22:33 dhill Exp $ */ /* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */ /* @@ -298,20 +298,14 @@ const struct pci_matchid cs4280_devices[] = { }; int -cs4280_match(parent, ma, aux) - struct device *parent; - void *ma; - void *aux; +cs4280_match(struct device *parent, void *ma, void *aux) { return (pci_matchbyid((struct pci_attach_args *)aux, cs4280_devices, nitems(cs4280_devices))); } int -cs4280_read_codec(sc_, add, data) - void *sc_; - u_int8_t add; - u_int16_t *data; +cs4280_read_codec(void *sc_, u_int8_t add, u_int16_t *data) { struct cs4280_softc *sc = sc_; int n; @@ -351,10 +345,7 @@ cs4280_read_codec(sc_, add, data) } int -cs4280_write_codec(sc_, add, data) - void *sc_; - u_int8_t add; - u_int16_t data; +cs4280_write_codec(void *sc_, u_int8_t add, u_int16_t data) { struct cs4280_softc *sc = sc_; @@ -373,8 +364,7 @@ cs4280_write_codec(sc_, add, data) } int -cs4280_src_wait(sc) - struct cs4280_softc *sc; +cs4280_src_wait(struct cs4280_softc *sc) { int n; @@ -389,9 +379,7 @@ cs4280_src_wait(sc) void -cs4280_set_adc_rate(sc, rate) - struct cs4280_softc *sc; - int rate; +cs4280_set_adc_rate(struct cs4280_softc *sc, int rate) { /* calculate capture rate: * @@ -509,9 +497,7 @@ cs4280_set_adc_rate(sc, rate) } void -cs4280_set_dac_rate(sc, rate) - struct cs4280_softc *sc; - int rate; +cs4280_set_dac_rate(struct cs4280_softc *sc, int rate) { /* * playback rate may range from 8000Hz to 48000Hz @@ -591,10 +577,7 @@ cs4280_attachhook(void *xsc) } void -cs4280_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +cs4280_attach(struct device *parent, struct device *self, void *aux) { struct cs4280_softc *sc = (struct cs4280_softc *) self; struct pci_attach_args *pa = (struct pci_attach_args *) aux; @@ -668,8 +651,7 @@ cs4280_attach(parent, self, aux) } int -cs4280_intr(p) - void *p; +cs4280_intr(void *p) { /* * XXX @@ -838,10 +820,8 @@ cs4280_intr(p) /* Download Proceessor Code and Data image */ int -cs4280_download(sc, src, offset, len) - struct cs4280_softc *sc; - const u_int32_t *src; - u_int32_t offset, len; +cs4280_download(struct cs4280_softc *sc, const u_int32_t *src, u_int32_t offset, + u_int32_t len) { u_int32_t ctr; @@ -879,8 +859,7 @@ cs4280_download(sc, src, offset, len) struct BA1struct *BA1Struct; int -cs4280_download_image(sc) - struct cs4280_softc *sc; +cs4280_download_image(struct cs4280_softc *sc) { int idx, err = 0; u_int32_t offset = 0; @@ -911,10 +890,8 @@ cs4280_download_image(sc) #ifdef CS4280_DEBUG int -cs4280_checkimage(sc, src, offset, len) - struct cs4280_softc *sc; - u_int32_t *src; - u_int32_t offset, len; +cs4280_checkimage(struct cs4280_softc *sc, u_int32_t *src, u_int32_t offset, + u_int32_t len) { u_int32_t ctr, data; int err = 0; @@ -939,8 +916,7 @@ cs4280_checkimage(sc, src, offset, len) } int -cs4280_check_images(sc) - struct cs4280_softc *sc; +cs4280_check_images(struct cs4280_softc *sc) { int idx, err; u_int32_t offset = 0; @@ -963,9 +939,7 @@ cs4280_check_images(sc) #endif int -cs4280_attach_codec(sc_, codec_if) - void *sc_; - struct ac97_codec_if *codec_if; +cs4280_attach_codec(void *sc_, struct ac97_codec_if *codec_if) { struct cs4280_softc *sc = sc_; @@ -974,8 +948,7 @@ cs4280_attach_codec(sc_, codec_if) } void -cs4280_reset_codec(sc_) - void *sc_; +cs4280_reset_codec(void *sc_) { struct cs4280_softc *sc = sc_; int n; @@ -1010,8 +983,7 @@ cs4280_reset_codec(sc_) /* Processor Soft Reset */ void -cs4280_reset(sc_) - void *sc_; +cs4280_reset(void *sc_) { struct cs4280_softc *sc = sc_; @@ -1025,16 +997,13 @@ cs4280_reset(sc_) } int -cs4280_open(addr, flags) - void *addr; - int flags; +cs4280_open(void *addr, int flags) { return (0); } void -cs4280_close(addr) - void *addr; +cs4280_close(void *addr) { struct cs4280_softc *sc = addr; @@ -1046,9 +1015,7 @@ cs4280_close(addr) } int -cs4280_query_encoding(addr, fp) - void *addr; - struct audio_encoding *fp; +cs4280_query_encoding(void *addr, struct audio_encoding *fp) { switch (fp->index) { case 0: @@ -1109,10 +1076,8 @@ cs4280_query_encoding(addr, fp) } int -cs4280_set_params(addr, setmode, usemode, play, rec) - void *addr; - int setmode, usemode; - struct audio_params *play, *rec; +cs4280_set_params(void *addr, int setmode, int usemode, + struct audio_params *play, struct audio_params *rec) { struct cs4280_softc *sc = addr; struct audio_params *p; @@ -1209,18 +1174,13 @@ cs4280_set_params(addr, setmode, usemode, play, rec) } int -cs4280_round_blocksize(hdl, blk) - void *hdl; - int blk; +cs4280_round_blocksize(void *hdl, int blk) { return (blk < CS4280_ICHUNK ? CS4280_ICHUNK : blk & -CS4280_ICHUNK); } size_t -cs4280_round_buffersize(addr, direction, size) - void *addr; - int direction; - size_t size; +cs4280_round_buffersize(void *addr, int direction, size_t size) { /* although real dma buffer size is 4KB, * let the audio.c driver use a larger buffer. @@ -1236,8 +1196,7 @@ cs4280_get_default_params(void *addr, int mode, struct audio_params *params) } int -cs4280_get_props(hdl) - void *hdl; +cs4280_get_props(void *hdl) { return (AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX); #ifdef notyet @@ -1250,9 +1209,7 @@ cs4280_get_props(hdl) } int -cs4280_mixer_get_port(addr, cp) - void *addr; - mixer_ctrl_t *cp; +cs4280_mixer_get_port(void *addr, mixer_ctrl_t *cp) { struct cs4280_softc *sc = addr; @@ -1260,11 +1217,7 @@ cs4280_mixer_get_port(addr, cp) } paddr_t -cs4280_mappage(addr, mem, off, prot) - void *addr; - void *mem; - off_t off; - int prot; +cs4280_mappage(void *addr, void *mem, off_t off, int prot) { struct cs4280_softc *sc = addr; struct cs4280_dma *p; @@ -1283,9 +1236,7 @@ cs4280_mappage(addr, mem, off, prot) int -cs4280_query_devinfo(addr, dip) - void *addr; - mixer_devinfo_t *dip; +cs4280_query_devinfo(void *addr, mixer_devinfo_t *dip) { struct cs4280_softc *sc = addr; @@ -1293,17 +1244,15 @@ cs4280_query_devinfo(addr, dip) } int -cs4280_get_portnum_by_name(sc, class, device, qualifier) - struct cs4280_softc *sc; - char *class, *device, *qualifier; +cs4280_get_portnum_by_name(struct cs4280_softc *sc, char *class, char *device, + char *qualifier) { return (sc->codec_if->vtbl->get_portnum_by_name(sc->codec_if, class, device, qualifier)); } int -cs4280_halt_output(addr) - void *addr; +cs4280_halt_output(void *addr) { struct cs4280_softc *sc = addr; u_int32_t mem; @@ -1317,8 +1266,7 @@ cs4280_halt_output(addr) } int -cs4280_halt_input(addr) - void *addr; +cs4280_halt_input(void *addr) { struct cs4280_softc *sc = addr; u_int32_t mem; @@ -1332,18 +1280,14 @@ cs4280_halt_input(addr) } int -cs4280_getdev(addr, retp) - void *addr; - struct audio_device *retp; +cs4280_getdev(void *addr, struct audio_device *retp) { *retp = cs4280_device; return (0); } int -cs4280_mixer_set_port(addr, cp) - void *addr; - mixer_ctrl_t *cp; +cs4280_mixer_set_port(void *addr, mixer_ctrl_t *cp) { struct cs4280_softc *sc = addr; int val; @@ -1355,9 +1299,7 @@ cs4280_mixer_set_port(addr, cp) int -cs4280_freemem(sc, p) - struct cs4280_softc *sc; - struct cs4280_dma *p; +cs4280_freemem(struct cs4280_softc *sc, struct cs4280_dma *p) { bus_dmamap_unload(sc->sc_dmatag, p->map); bus_dmamap_destroy(sc->sc_dmatag, p->map); @@ -1367,11 +1309,8 @@ cs4280_freemem(sc, p) } int -cs4280_allocmem(sc, size, align, p) - struct cs4280_softc *sc; - size_t size; - size_t align; - struct cs4280_dma *p; +cs4280_allocmem(struct cs4280_softc *sc, size_t size, size_t align, + struct cs4280_dma *p) { int error; @@ -1422,11 +1361,7 @@ free: void * -cs4280_malloc(addr, direction, size, pool, flags) - void *addr; - int direction; - size_t size; - int pool, flags; +cs4280_malloc(void *addr, int direction, size_t size, int pool, int flags) { struct cs4280_softc *sc = addr; struct cs4280_dma *p; @@ -1461,10 +1396,7 @@ cs4280_malloc(addr, direction, size, pool, flags) } void -cs4280_free(addr, ptr, pool) - void *addr; - void *ptr; - int pool; +cs4280_free(void *addr, void *ptr, int pool) { struct cs4280_softc *sc = addr; struct cs4280_dma **pp, *p; @@ -1481,13 +1413,8 @@ cs4280_free(addr, ptr, pool) } int -cs4280_trigger_output(addr, start, end, blksize, intr, arg, param) - void *addr; - void *start, *end; - int blksize; - void (*intr)(void *); - void *arg; - struct audio_params *param; +cs4280_trigger_output(void *addr, void *start, void *end, int blksize, + void (*intr)(void *), void *arg, struct audio_params *param) { struct cs4280_softc *sc = addr; u_int32_t pfie, pctl, mem, pdtc; @@ -1574,13 +1501,8 @@ cs4280_trigger_output(addr, start, end, blksize, intr, arg, param) } int -cs4280_trigger_input(addr, start, end, blksize, intr, arg, param) - void *addr; - void *start, *end; - int blksize; - void (*intr)(void *); - void *arg; - struct audio_params *param; +cs4280_trigger_input(void *addr, void *start, void *end, int blksize, + void (*intr)(void *), void *arg, struct audio_params *param) { struct cs4280_softc *sc = addr; u_int32_t cctl, cie; @@ -1648,9 +1570,7 @@ cs4280_trigger_input(addr, start, end, blksize, intr, arg, param) int -cs4280_init(sc, init) - struct cs4280_softc *sc; - int init; +cs4280_init(struct cs4280_softc *sc, int init) { int n; u_int32_t mem; @@ -1742,9 +1662,7 @@ cs4280_init(sc, init) } int -cs4280_init2(sc, init) - struct cs4280_softc *sc; - int init; +cs4280_init2(struct cs4280_softc *sc, int init) { int n; u_int32_t mem; @@ -1853,8 +1771,7 @@ cs4280_activate(struct device *self, int act) } void -cs4280_clear_fifos(sc) - struct cs4280_softc *sc; +cs4280_clear_fifos(struct cs4280_softc *sc) { int pd = 0, cnt, n; u_int32_t mem; @@ -1888,12 +1805,8 @@ cs4280_clear_fifos(sc) #if NMIDI > 0 int -cs4280_midi_open(addr, flags, iintr, ointr, arg) - void *addr; - int flags; - void (*iintr)(void *, int); - void (*ointr)(void *); - void *arg; +cs4280_midi_open(void *addr, int flags, void (*iintr)(void, int), + void (*ointr)(void *), void *arg) { struct cs4280_softc *sc = addr; u_int32_t mem; @@ -1918,8 +1831,7 @@ cs4280_midi_open(addr, flags, iintr, ointr, arg) } void -cs4280_midi_close(addr) - void *addr; +cs4280_midi_close(void *addr) { struct cs4280_softc *sc = addr; u_int32_t mem; @@ -1934,9 +1846,7 @@ cs4280_midi_close(addr) } int -cs4280_midi_output(addr, d) - void *addr; - int d; +cs4280_midi_output(void *addr, int d) { struct cs4280_softc *sc = addr; u_int32_t mem; @@ -1961,9 +1871,7 @@ cs4280_midi_output(addr, d) } void -cs4280_midi_getinfo(addr, mi) - void *addr; - struct midi_info *mi; +cs4280_midi_getinfo(void *addr, struct midi_info *mi) { mi->name = "CS4280 MIDI UART"; mi->props = MIDI_PROP_CAN_INPUT | MIDI_PROP_OUT_INTR; diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index fdac640aefb..849a6ac5595 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.39 2011/04/03 15:36:03 jasper Exp $ */ +/* $OpenBSD: yds.c,v 1.40 2012/01/11 16:22:33 dhill Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -275,9 +275,7 @@ const static struct { #ifdef AUDIO_DEBUG static void -yds_dump_play_slot(sc, bank) - struct yds_softc *sc; - int bank; +yds_dump_play_slot(struct yds_softc *sc, int bank) { int i, j; u_int32_t *p; @@ -325,8 +323,7 @@ yds_dump_play_slot(sc, bank) #endif /* AUDIO_DEBUG */ static u_int -yds_get_dstype(id) - int id; +yds_get_dstype(int id) { int i; @@ -348,8 +345,7 @@ nswaph(u_int32_t *p, int wcount) } static int -yds_download_mcode(sc) - struct yds_softc *sc; +yds_download_mcode(struct yds_softc *sc) { u_int ctrl; const u_int32_t *p; @@ -517,15 +513,13 @@ yds_allocate_slots(struct yds_softc *sc, int resuming) } static void -yds_enable_dsp(sc) - struct yds_softc *sc; +yds_enable_dsp(struct yds_softc *sc) { YWRITE4(sc, YDS_CONFIG, YDS_DSP_SETUP); } static int -yds_disable_dsp(sc) - struct yds_softc *sc; +yds_disable_dsp(struct yds_softc *sc) { int to; u_int32_t data; @@ -544,10 +538,7 @@ yds_disable_dsp(sc) } int -yds_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; +yds_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = (struct pci_attach_args *) aux; @@ -574,8 +565,7 @@ yds_match(parent, match, aux) * to avoid conflict. */ static void -yds_configure_legacy (sc) - struct yds_softc *sc; +yds_configure_legacy(struct yds_softc *sc) #define FLEXIBLE (sc->sc_flags & YDS_CAP_LEGACY_FLEXIBLE) #define SELECTABLE (sc->sc_flags & YDS_CAP_LEGACY_SELECTABLE) { @@ -673,10 +663,7 @@ yds_configure_legacy (sc) #undef SELECTABLE void -yds_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +yds_attach(struct device *parent, struct device *self, void *aux) { struct yds_softc *sc = (struct yds_softc *)self; struct pci_attach_args *pa = (struct pci_attach_args *)aux; @@ -827,9 +814,7 @@ yds_attachhook(void *xsc) } int -yds_attach_codec(sc_, codec_if) - void *sc_; - struct ac97_codec_if *codec_if; +yds_attach_codec(void *sc_, struct ac97_codec_if *codec_if) { struct yds_codec_softc *sc = sc_; @@ -838,8 +823,7 @@ yds_attach_codec(sc_, codec_if) } static int -yds_ready_codec(sc) - struct yds_codec_softc *sc; +yds_ready_codec(struct yds_codec_softc *sc) { int to; @@ -853,10 +837,7 @@ yds_ready_codec(sc) } int -yds_read_codec(sc_, reg, data) - void *sc_; - u_int8_t reg; - u_int16_t *data; +yds_read_codec(void *sc_, u_int8_t reg, u_int16_t *data) { struct yds_codec_softc *sc = sc_; @@ -881,10 +862,7 @@ yds_read_codec(sc_, reg, data) } int -yds_write_codec(sc_, reg, data) - void *sc_; - u_int8_t reg; - u_int16_t data; +yds_write_codec(void *sc_, u_int8_t reg, u_int16_t data) { struct yds_codec_softc *sc = sc_; @@ -904,8 +882,7 @@ yds_write_codec(sc_, reg, data) * XXX: Must handle the secondary differntly!! */ void -yds_reset_codec(sc_) - void *sc_; +yds_reset_codec(void *sc_) { struct yds_codec_softc *codec = sc_; struct yds_softc *sc = codec->sc; @@ -927,8 +904,7 @@ yds_reset_codec(sc_) } int -yds_intr(p) - void *p; +yds_intr(void *p) { struct yds_softc *sc = p; u_int status; @@ -1043,11 +1019,7 @@ yds_intr(p) } int -yds_allocmem(sc, size, align, p) - struct yds_softc *sc; - size_t size; - size_t align; - struct yds_dma *p; +yds_allocmem(struct yds_softc *sc, size_t size, size_t align, struct yds_dma *p) { int error; @@ -1084,9 +1056,7 @@ free: } int -yds_freemem(sc, p) - struct yds_softc *sc; - struct yds_dma *p; +yds_freemem(struct yds_softc *sc, struct yds_dma *p) { bus_dmamap_unload(sc->sc_dmatag, p->map); bus_dmamap_destroy(sc->sc_dmatag, p->map); @@ -1096,9 +1066,7 @@ yds_freemem(sc, p) } int -yds_open(addr, flags) - void *addr; - int flags; +yds_open(void *addr, int flags) { struct yds_softc *sc = addr; int mode; @@ -1119,8 +1087,7 @@ yds_open(addr, flags) * Close function is called at splaudio(). */ void -yds_close(addr) - void *addr; +yds_close(void *addr) { struct yds_softc *sc = addr; @@ -1130,9 +1097,7 @@ yds_close(addr) } int -yds_query_encoding(addr, fp) - void *addr; - struct audio_encoding *fp; +yds_query_encoding(void *addr, struct audio_encoding *fp) { switch (fp->index) { case 0: @@ -1199,10 +1164,8 @@ yds_get_default_params(void *addr, int mode, struct audio_params *params) } int -yds_set_params(addr, setmode, usemode, play, rec) - void *addr; - int setmode, usemode; - struct audio_params *play, *rec; +yds_set_params(void *addr, int setmode, int usemode, + struct audio_params *play, struct audio_params *rec) { struct audio_params *p; int mode; @@ -1275,9 +1238,7 @@ yds_set_params(addr, setmode, usemode, play, rec) } int -yds_round_blocksize(addr, blk) - void *addr; - int blk; +yds_round_blocksize(void *addr, int blk) { /* * Block size must be bigger than a frame. @@ -1290,8 +1251,7 @@ yds_round_blocksize(addr, blk) } static u_int32_t -yds_get_lpfq(sample_rate) - u_int sample_rate; +yds_get_lpfq(u_int sample_rate) { int i; static struct lpfqt { @@ -1318,8 +1278,7 @@ yds_get_lpfq(sample_rate) } static u_int32_t -yds_get_lpfk(sample_rate) - u_int sample_rate; +yds_get_lpfk(u_int sample_rate) { int i; static struct lpfkt { @@ -1346,13 +1305,8 @@ yds_get_lpfk(sample_rate) } int -yds_trigger_output(addr, start, end, blksize, intr, arg, param) - void *addr; - void *start, *end; - int blksize; - void (*intr)(void *); - void *arg; - struct audio_params *param; +yds_trigger_output(void *addr, void *start, void *end, int blksize, + void (*intr)(void *), void *arg, struct audio_params *param) #define P44 (sc->sc_flags & YDS_CAP_HAS_P44) { struct yds_softc *sc = addr; @@ -1487,13 +1441,8 @@ yds_trigger_output(addr, start, end, blksize, intr, arg, param) #undef P44 int -yds_trigger_input(addr, start, end, blksize, intr, arg, param) - void *addr; - void *start, *end; - int blksize; - void (*intr)(void *); - void *arg; - struct audio_params *param; +yds_trigger_input(void *addr, void *start, void *end, int blksize, + void (*intr)(void *), void *arg, struct audio_params *param) { struct yds_softc *sc = addr; struct yds_dma *p; @@ -1579,8 +1528,7 @@ yds_trigger_input(addr, start, end, blksize, intr, arg, param) } static int -yds_halt(sc) - struct yds_softc *sc; +yds_halt(struct yds_softc *sc) { u_int32_t mode; @@ -1600,8 +1548,7 @@ yds_halt(sc) } int -yds_halt_output(addr) - void *addr; +yds_halt_output(void *addr) { struct yds_softc *sc = addr; @@ -1628,8 +1575,7 @@ yds_halt_output(addr) } int -yds_halt_input(addr) - void *addr; +yds_halt_input(void *addr) { struct yds_softc *sc = addr; @@ -1654,9 +1600,7 @@ yds_halt_input(addr) } int -yds_getdev(addr, retp) - void *addr; - struct audio_device *retp; +yds_getdev(void *addr, struct audio_device *retp) { *retp = yds_device; @@ -1664,9 +1608,7 @@ yds_getdev(addr, retp) } int -yds_mixer_set_port(addr, cp) - void *addr; - mixer_ctrl_t *cp; +yds_mixer_set_port(void *addr, mixer_ctrl_t *cp) { struct yds_softc *sc = addr; @@ -1675,9 +1617,7 @@ yds_mixer_set_port(addr, cp) } int -yds_mixer_get_port(addr, cp) - void *addr; - mixer_ctrl_t *cp; +yds_mixer_get_port(void *addr, mixer_ctrl_t *cp) { struct yds_softc *sc = addr; @@ -1686,9 +1626,7 @@ yds_mixer_get_port(addr, cp) } int -yds_query_devinfo(addr, dip) - void *addr; - mixer_devinfo_t *dip; +yds_query_devinfo(void *addr, mixer_devinfo_t *dip) { struct yds_softc *sc = addr; @@ -1697,20 +1635,15 @@ yds_query_devinfo(addr, dip) } int -yds_get_portnum_by_name(sc, class, device, qualifier) - struct yds_softc *sc; - char *class, *device, *qualifier; +yds_get_portnum_by_name(struct yds_softc *sc, char *class, char *device, + char *qualifier) { return (sc->sc_codec[0].codec_if->vtbl->get_portnum_by_name( sc->sc_codec[0].codec_if, class, device, qualifier)); } void * -yds_malloc(addr, direction, size, pool, flags) - void *addr; - int direction; - size_t size; - int pool, flags; +yds_malloc(void *addr, int direction, size_t size, int pool, int flags) { struct yds_softc *sc = addr; struct yds_dma *p; @@ -1730,10 +1663,7 @@ yds_malloc(addr, direction, size, pool, flags) } void -yds_free(addr, ptr, pool) - void *addr; - void *ptr; - int pool; +yds_free(void *addr, void *ptr, int pool) { struct yds_softc *sc = addr; struct yds_dma **pp, *p; @@ -1749,9 +1679,7 @@ yds_free(addr, ptr, pool) } static struct yds_dma * -yds_find_dma(sc, addr) - struct yds_softc *sc; - void *addr; +yds_find_dma(struct yds_softc *sc, void *addr) { struct yds_dma *p; @@ -1762,10 +1690,7 @@ yds_find_dma(sc, addr) } size_t -yds_round_buffersize(addr, direction, size) - void *addr; - int direction; - size_t size; +yds_round_buffersize(void *addr, int direction, size_t size) { /* * Buffer size should be at least twice as bigger as a frame. @@ -1776,11 +1701,7 @@ yds_round_buffersize(addr, direction, size) } paddr_t -yds_mappage(addr, mem, off, prot) - void *addr; - void *mem; - off_t off; - int prot; +yds_mappage(void *addr, void *mem, off_t off, int prot) { struct yds_softc *sc = addr; struct yds_dma *p; @@ -1795,8 +1716,7 @@ yds_mappage(addr, mem, off, prot) } int -yds_get_props(addr) - void *addr; +yds_get_props(void *addr) { return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX); diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 02dd4f51a4d..039f7f36eb0 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp_tty.c,v 1.23 2011/07/06 02:51:16 henning Exp $ */ +/* $OpenBSD: ppp_tty.c,v 1.24 2012/01/11 16:22:33 dhill Exp $ */ /* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */ /* @@ -179,9 +179,7 @@ void ppplogchar(struct ppp_softc *, int); */ /* ARGSUSED */ int -pppopen(dev, tp) - dev_t dev; - struct tty *tp; +pppopen(dev_t dev, struct tty *tp) { struct proc *p = curproc; /* XXX */ struct ppp_softc *sc; @@ -238,9 +236,7 @@ pppopen(dev, tp) * Mimics part of ttyclose(). */ int -pppclose(tp, flag) - struct tty *tp; - int flag; +pppclose(struct tty *tp, int flag) { struct ppp_softc *sc; int s; @@ -264,8 +260,7 @@ pppclose(tp, flag) * Relinquish the interface unit to another device. */ void -pppasyncrelinq(sc) - struct ppp_softc *sc; +pppasyncrelinq(struct ppp_softc *sc) { int s; @@ -289,10 +284,7 @@ pppasyncrelinq(sc) * Line specific (tty) read routine. */ int -pppread(tp, uio, flag) - struct tty *tp; - struct uio *uio; - int flag; +pppread(struct tty *tp, struct uio *uio, int flag) { struct ppp_softc *sc = (struct ppp_softc *)tp->t_sc; struct mbuf *m, *m0; @@ -347,10 +339,7 @@ pppread(tp, uio, flag) * Line specific (tty) write routine. */ int -pppwrite(tp, uio, flag) - struct tty *tp; - struct uio *uio; - int flag; +pppwrite(struct tty *tp, struct uio *uio, int flag) { struct ppp_softc *sc = (struct ppp_softc *)tp->t_sc; struct mbuf *m, *m0, **mp; @@ -400,12 +389,7 @@ pppwrite(tp, uio, flag) */ /* ARGSUSED */ int -ppptioctl(tp, cmd, data, flag, p) - struct tty *tp; - u_long cmd; - caddr_t data; - int flag; - struct proc *p; +ppptioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) { struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc; int error, s; @@ -501,10 +485,7 @@ static u_int16_t fcstab[256] = { * Calculate a new FCS given the current FCS and the new data. */ u_int16_t -pppfcs(fcs, cp, len) - u_int16_t fcs; - u_char *cp; - int len; +pppfcs(u_int16_t fcs, u_char *cp, int len) { while (len--) fcs = PPP_FCS(fcs, *cp++); @@ -516,8 +497,7 @@ pppfcs(fcs, cp, len) * put on a queue, at splsoftnet. */ void -pppasyncstart(sc) - struct ppp_softc *sc; +pppasyncstart(struct ppp_softc *sc) { struct tty *tp = (struct tty *) sc->sc_devp; struct mbuf *m; @@ -700,8 +680,7 @@ pppasyncstart(sc) * the inq, at splsoftnet. */ void -pppasyncctlp(sc) - struct ppp_softc *sc; +pppasyncctlp(struct ppp_softc *sc) { struct tty *tp; int s; @@ -720,9 +699,7 @@ pppasyncctlp(sc) * called later at splsoftnet. */ int -pppstart(tp, force) - struct tty *tp; - int force; +pppstart(struct tty *tp, int force) { struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc; @@ -760,8 +737,7 @@ pppstart(tp, force) * Timeout routine - try to start some more output. */ void -ppp_timeout(x) - void *x; +ppp_timeout(void *x) { struct ppp_softc *sc = (struct ppp_softc *) x; struct tty *tp = (struct tty *) sc->sc_devp; @@ -777,8 +753,7 @@ ppp_timeout(x) * Allocate enough mbuf to handle current MRU. */ void -pppgetm(sc) - struct ppp_softc *sc; +pppgetm(struct ppp_softc *sc) { struct mbuf *m, **mp; int len; @@ -809,9 +784,7 @@ static unsigned int paritytab[8] = { }; int -pppinput(c, tp) - int c; - struct tty *tp; +pppinput(int c, struct tty *tp) { struct ppp_softc *sc; struct mbuf *m; @@ -1055,9 +1028,7 @@ pppinput(c, tp) #define MAX_DUMP_BYTES 128 void -ppplogchar(sc, c) - struct ppp_softc *sc; - int c; +ppplogchar(struct ppp_softc *sc, int c) { if (c >= 0) sc->sc_rawin[sc->sc_rawin_count++] = c; @@ -1070,9 +1041,7 @@ ppplogchar(sc, c) } void -pppdumpb(b, l) - u_char *b; - int l; +pppdumpb(u_char *b, int l) { char buf[3*MAX_DUMP_BYTES+4]; char *bp = buf; |