diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ed/if_ed.c | 41 | ||||
-rw-r--r-- | sys/dev/fdc/fdc.c | 87 | ||||
-rw-r--r-- | sys/dev/ie/if_ie.c | 64 | ||||
-rw-r--r-- | sys/dev/mcd/mcd.c | 23 | ||||
-rw-r--r-- | sys/dev/mse/mse.c | 12 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 39 |
6 files changed, 147 insertions, 119 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 600f611..47c0664 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -20,7 +20,7 @@ */ /* - * $Id: if_ed.c,v 2.14 1993/11/22 10:55:30 davidg Exp davidg $ + * $Id: if_ed.c,v 1.23 1993/11/22 11:08:14 davidg Exp $ */ /* @@ -185,10 +185,16 @@ struct ed_softc { u_char next_packet; /* pointer to next unread RX packet */ } ed_softc[NED]; -int ed_attach(), ed_init(), edintr(), ed_ioctl(), ed_probe(), - ed_start(), ed_reset(), ed_watchdog(); - -static void ed_stop(); +int ed_attach(struct isa_device *); +void ed_init(int); +void edintr(int); +int ed_ioctl(struct ifnet *, int, caddr_t); +int ed_probe(struct isa_device *); +void ed_start(struct ifnet *); +void ed_reset(int, int); +void ed_watchdog(int); +static void ed_get_packet(struct ed_softc *, char *, int /*u_short*/); +static void ed_stop(int); static inline void ed_rint(); static inline void ed_xmit(); @@ -1113,15 +1119,16 @@ ed_attach(isa_dev) #if NBPFILTER > 0 bpfattach(&sc->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); #endif - + return 1; } /* * Reset interface. */ -int -ed_reset(unit) +void +ed_reset(unit, uban) int unit; + int uban; /* XXX */ { int s; @@ -1167,7 +1174,7 @@ ed_stop(unit) * Device timeout/watchdog routine. Entered if the device neglects to * generate an interrupt after a transmit has been started on it. */ -int +void ed_watchdog(unit) int unit; { @@ -1176,12 +1183,13 @@ ed_watchdog(unit) log(LOG_ERR, "ed%d: device timeout\n", unit); ++sc->arpcom.ac_if.if_oerrors; - ed_reset(unit); + ed_reset(unit, 0); } /* * Initialize device. */ +void ed_init(unit) int unit; { @@ -1410,7 +1418,7 @@ static inline void ed_xmit(ifp) * 2) that the IFF_OACTIVE flag is checked before this code is called * (i.e. that the output part of the interface is idle) */ -int +void ed_start(ifp) struct ifnet *ifp; { @@ -1666,7 +1674,7 @@ ed_rint(unit) "ed%d: NIC memory corrupt - invalid packet length %d\n", unit, len); ++sc->arpcom.ac_if.if_ierrors; - ed_reset(unit); + ed_reset(unit, 0); return; } @@ -1708,7 +1716,7 @@ ed_rint(unit) /* * Ethernet interface interrupt processor */ -int +void edintr(unit) int unit; { @@ -1831,7 +1839,7 @@ edintr(unit) /* * Stop/reset/re-init NIC */ - ed_reset(unit); + ed_reset(unit, 0); } else { /* @@ -2054,13 +2062,14 @@ ed_ioctl(ifp, command, data) * Retreive packet from shared memory and send to the next level up via * ether_input(). If there is a BPF listener, give a copy to BPF, too. */ +static void ed_get_packet(sc, buf, len) struct ed_softc *sc; char *buf; u_short len; { struct ether_header *eh; - struct mbuf *m, *head, *ed_ring_to_mbuf(); + struct mbuf *m, *head = 0, *ed_ring_to_mbuf(); u_short off; int resid; u_short etype; @@ -2381,7 +2390,7 @@ ed_pio_write_mbufs(sc,m,dst) if (!maxwait) { log(LOG_WARNING, "ed%d: remote transmit DMA failed to complete\n", sc->arpcom.ac_if.if_unit); - ed_reset(sc->arpcom.ac_if.if_unit); + ed_reset(sc->arpcom.ac_if.if_unit, 0); } return(len); diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index c287ef1..0cde9c6 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.5 1993/09/15 23:27:45 rgrimes Exp $ + * $Id: fd.c,v 1.6 1993/09/23 15:22:57 rgrimes Exp $ * */ @@ -45,6 +45,7 @@ #include "param.h" #include "dkbad.h" #include "systm.h" +#include "kernel.h" #include "conf.h" #include "file.h" #include "ioctl.h" @@ -175,18 +176,20 @@ char *fdstates[] = int fd_debug = 1; #define TRACE0(arg) if(fd_debug) printf(arg) #define TRACE1(arg1,arg2) if(fd_debug) printf(arg1,arg2) -#else DEBUG +#else /* DEBUG */ #define TRACE0(arg) #define TRACE1(arg1,arg2) -#endif DEBUG +#endif /* DEBUG */ -extern int hz; -/* state needed for current transfer */ +static void fdstart(fdcu_t); +void fdintr(fdcu_t); +static void fd_turnoff(caddr_t, int); /****************************************************************************/ /* autoconfiguration stuff */ /****************************************************************************/ -int fdprobe(), fdattach(), fd_turnoff(); +static int fdprobe(struct isa_device *); +static int fdattach(struct isa_device *); struct isa_driver fddriver = { fdprobe, fdattach, "fd", @@ -195,8 +198,9 @@ struct isa_driver fddriver = { /* * probe for existance of controller */ +int fdprobe(dev) -struct isa_device *dev; + struct isa_device *dev; { fdcu_t fdcu = dev->id_unit; if(fdc_data[fdcu].flags & FDC_ATTACHED) @@ -220,8 +224,9 @@ struct isa_device *dev; /* * wire controller into system, look for floppy units */ +int fdattach(dev) -struct isa_device *dev; + struct isa_device *dev; { unsigned fdt,st0, cyl; int hdr; @@ -285,17 +290,18 @@ struct isa_device *dev; } fdt <<= 4; - fd_turnoff(fdu); + fd_turnoff((caddr_t)fdu, 0); hdr = 1; } /* Set transfer to 500kbps */ outb(fdc->baseport+fdctl,0); /*XXX*/ + return 1; } int fdsize(dev) -dev_t dev; + dev_t dev; { return(0); } @@ -303,8 +309,7 @@ dev_t dev; /****************************************************************************/ /* fdstrategy */ /****************************************************************************/ -fdstrategy(bp) - register struct buf *bp; /* IO operation to perform */ +void fdstrategy(struct buf *bp) { register struct buf *dp,*dp0,*dp1; long nblocks,blknum; @@ -359,6 +364,7 @@ bad: /* motor control stuff */ /* remember to not deselect the drive we're working on */ /****************************************************************************/ +void set_motor(fdcu, fdu, reset) fdcu_t fdcu; fdu_t fdu; @@ -389,9 +395,10 @@ set_motor(fdcu, fdu, reset) | (m1 ? FDO_MOEN1 : 0))); } -fd_turnoff(fdu) - fdu_t fdu; +static void +fd_turnoff(caddr_t arg1, int arg2) { + fdu_t fdu = (fdu_t)arg1; int s; fd_p fd = fd_data + fdu; @@ -401,9 +408,10 @@ fd_turnoff(fdu) splx(s); } -fd_motor_on(fdu) - fdu_t fdu; +void +fd_motor_on(caddr_t arg1, int arg2) { + fdu_t fdu = (fdu_t)arg1; int s; fd_p fd = fd_data + fdu; @@ -416,6 +424,9 @@ fd_motor_on(fdu) splx(s); } +static void fd_turnon1(fdu_t); + +void fd_turnon(fdu) fdu_t fdu; { @@ -424,12 +435,12 @@ fd_turnon(fdu) { fd_turnon1(fdu); fd->flags |= FD_MOTOR_WAIT; - timeout(fd_motor_on,fdu,hz); /* in 1 sec its ok */ + timeout(fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */ } } -fd_turnon1(fdu) - fdu_t fdu; +static void +fd_turnon1(fdu_t fdu) { fd_p fd = fd_data + fdu; fd->flags |= FD_MOTOR; @@ -459,6 +470,7 @@ in_fdc(fdcu) #endif } +int out_fdc(fdcu, x) fdcu_t fdcu; int x; @@ -485,6 +497,7 @@ out_fdc(fdcu, x) /****************************************************************************/ /* fdopen/fdclose */ /****************************************************************************/ +int Fdopen(dev, flags) dev_t dev; int flags; @@ -501,8 +514,10 @@ Fdopen(dev, flags) return 0; } +int fdclose(dev, flags) dev_t dev; + int flags; { fdu_t fdu = FDUNIT(minor(dev)); fd_data[fdu].flags &= ~FD_OPEN; @@ -519,6 +534,7 @@ fdclose(dev, flags) * If the controller is already busy, we need do nothing, as it * * will pick up our work when the present work completes * \***************************************************************/ +static void fdstart(fdcu) fdcu_t fdcu; { @@ -534,9 +550,10 @@ fdstart(fdcu) splx(s); } -fd_timeout(fdcu) - fdcu_t fdcu; +static void +fd_timeout(caddr_t arg1, int arg2) { + fdcu_t fdcu = (fdcu_t)arg1; fdu_t fdu = fdc_data[fdcu].fdu; int st0, st3, cyl; struct buf *dp,*bp; @@ -580,9 +597,10 @@ fd_timeout(fdcu) } /* just ensure it has the right spl */ -fd_pseudointr(fdcu) - fdcu_t fdcu; +static void +fd_pseudointr(caddr_t arg1, int arg2) { + fdcu_t fdcu = (fdcu_t)arg1; int s; s = splbio(); fdintr(fdcu); @@ -594,22 +612,24 @@ fd_pseudointr(fdcu) * keep calling the state machine until it returns a 0 * * ALWAYS called at SPLBIO * \***********************************************************************/ -fdintr(fdcu) - fdcu_t fdcu; +void +fdintr(fdcu_t fdcu) { fdc_p fdc = fdc_data + fdcu; - while(fdstate(fdcu, fdc)); + while(fdstate(fdcu, fdc)) + ; } /***********************************************************************\ * The controller state machine. * * if it returns a non zero value, it should be called again immediatly * \***********************************************************************/ -int fdstate(fdcu, fdc) +int +fdstate(fdcu, fdc) fdcu_t fdcu; fdc_p fdc; { - int read,head,trac,sec,i,s,sectrac,cyl,st0; + int read, head, trac, sec = 0, i = 0, s, sectrac, cyl, st0; unsigned long blknum; fdu_t fdu = fdc->fdu; fd_p fd; @@ -645,7 +665,7 @@ int fdstate(fdcu, fdc) TRACE1("[%s]",fdstates[fdc->state]); TRACE1("(0x%x)",fd->flags); untimeout(fd_turnoff, fdu); - timeout(fd_turnoff,fdu,4 * hz); + timeout(fd_turnoff, (caddr_t)fdu, 4 * hz); switch (fdc->state) { case DEVIDLE: @@ -689,12 +709,12 @@ int fdstate(fdcu, fdc) out_fdc(fdcu,bp->b_cylin * fd->ft->steptrac); fd->track = -2; fdc->state = SEEKWAIT; - timeout(fd_timeout,fdcu,2 * hz); + timeout(fd_timeout, (caddr_t)fdcu, 2 * hz); return(0); /* will return later */ case SEEKWAIT: untimeout(fd_timeout,fdcu); /* allow heads to settle */ - timeout(fd_pseudointr,fdcu,hz/50); + timeout(fd_pseudointr, (caddr_t)fdcu, hz / 50); fdc->state = SEEKCOMPLETE; return(0); /* will return later */ break; @@ -743,7 +763,7 @@ int fdstate(fdcu, fdc) out_fdc(fdcu,fd->ft->gap); /* gap size */ out_fdc(fdcu,fd->ft->datalen); /* data length */ fdc->state = IOCOMPLETE; - timeout(fd_timeout,fdcu,2 * hz); + timeout(fd_timeout, (caddr_t)fdcu, 2 * hz); return(0); /* will return later */ case IOCOMPLETE: /* IO DONE, post-analyze */ untimeout(fd_timeout,fdcu); @@ -800,7 +820,7 @@ int fdstate(fdcu, fdc) return(0); /* will return later */ case RECALWAIT: /* allow heads to settle */ - timeout(fd_pseudointr,fdcu,hz/30); + timeout(fd_pseudointr, (caddr_t)fdcu, hz / 30); fdc->state = RECALCOMPLETE; return(0); /* will return later */ case RECALCOMPLETE: @@ -848,6 +868,7 @@ int fdstate(fdcu, fdc) return(1); /* Come back immediatly to new state */ } +int retrier(fdcu) fdcu_t fdcu; { diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index 2a68b1c..613f03e 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -39,7 +39,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: if_ie.c,v 1.1 1993/10/12 06:52:31 rgrimes Exp $ */ /* @@ -106,7 +106,6 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff. #include "param.h" #include "systm.h" #include "mbuf.h" -#include "buf.h" #include "protosw.h" #include "socket.h" #include "ioctl.h" @@ -135,7 +134,6 @@ iomem, and to make 16-pointers, we subtract iomem and and with 0xffff. #endif #include "i386/isa/isa.h" -/*#include "machine/cpufunc.h"*/ #include "i386/isa/isa_device.h" #include "i386/isa/ic/i82586.h" #include "i386/isa/if_iereg.h" @@ -171,14 +169,14 @@ int ie_debug = IED_RNR; /* Forward declaration */ struct ie_softc; -int ieprobe(struct isa_device *dvp); -int ieattach(struct isa_device *dvp); -int ieinit(int unit); -int ieioctl(struct ifnet *ifp, int command, void *data); -int iestart(struct ifnet *ifp); +static int ieprobe(struct isa_device *dvp); +static int ieattach(struct isa_device *dvp); +static void ieinit(int unit); +static int ieioctl(struct ifnet *ifp, int command, caddr_t data); +static void iestart(struct ifnet *ifp); static void sl_reset_586(int unit); static void sl_chan_attn(int unit); -int iereset(int unit, int dummy); +static void iereset(int unit, int dummy); static void ie_readframe(int unit, struct ie_softc *ie, int bufno); static void ie_drop_packet_buffer(int unit, struct ie_softc *ie); static void sl_read_ether(int unit, unsigned char addr[6]); @@ -407,7 +405,7 @@ ieattach(dvp) while(ifa && ifa->ifa_addr && ifa->ifa_addr->sa_family != AF_LINK) ifa = ifa->ifa_next; - if(!ifa || !ifa->ifa_addr) return; + if(!ifa || !ifa->ifa_addr) return 1; /* Provide our ether address to the higher layers */ sdl = (struct sockaddr_dl *)ifa->ifa_addr; @@ -415,6 +413,7 @@ ieattach(dvp) sdl->sdl_alen = 6; sdl->sdl_slen = 0; bcopy(ie->arpcom.ac_enaddr, LLADDR(sdl), 6); + return 1; } } @@ -1075,8 +1074,9 @@ static void ie_drop_packet_buffer(int unit, struct ie_softc *ie) { /* * Start transmission on an interface. */ -int iestart(ifp) - struct ifnet *ifp; +static void +iestart(ifp) + struct ifnet *ifp; { struct ie_softc *ie = &ie_softc[ifp->if_unit]; struct mbuf *m0, *m; @@ -1086,9 +1086,9 @@ int iestart(ifp) volatile u_short *bptr = &ie->scb->ie_command_list; if(!(ifp->if_flags & IFF_RUNNING)) - return 0; + return; if(ifp->if_flags & IFF_OACTIVE) - return 0; + return; do { IF_DEQUEUE(&ie->arpcom.ac_if.if_snd, m); @@ -1147,7 +1147,7 @@ int iestart(ifp) ifp->if_flags |= IFF_OACTIVE; } - return 0; + return; } /* @@ -1281,14 +1281,15 @@ void sl_read_ether(unit, addr) } -int iereset(unit, dummy) - int unit, dummy; +static void +iereset(unit, dummy) + int unit, dummy; { int s = splimp(); if(unit >= NIE) { splx(s); - return -1; + return; } printf("ie%d: reset\n", unit); @@ -1313,17 +1314,18 @@ int iereset(unit, dummy) ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0); splx(s); - return 0; + return; } /* * This is called if we time out. */ -static int chan_attn_timeout(rock) - caddr_t rock; +static void +chan_attn_timeout(rock, arg2) + caddr_t rock; + int arg2; { *(int *)rock = 1; - return 0; } /* @@ -1545,7 +1547,8 @@ static int mc_setup(int unit, caddr_t ptr, * * THIS ROUTINE MUST BE CALLED AT splimp() OR HIGHER. */ -int ieinit(unit) +static void +ieinit(unit) int unit; { struct ie_softc *ie = &ie_softc[unit]; @@ -1570,7 +1573,7 @@ int ieinit(unit) if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { printf("ie%d: configure command failed\n", unit); - return 0; + return; } } /* @@ -1590,7 +1593,7 @@ int ieinit(unit) if(command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { printf("ie%d: individual address setup command failed\n", unit); - return 0; + return; } } @@ -1645,7 +1648,7 @@ int ieinit(unit) ie->arpcom.ac_if.if_flags |= IFF_RUNNING; /* tell higher levels that we are here */ start_receiver(unit); - return 0; + return; } static void ie_stop(unit) @@ -1654,10 +1657,11 @@ static void ie_stop(unit) command_and_wait(unit, IE_RU_DISABLE, 0, 0); } -int ieioctl(ifp, command, data) - struct ifnet *ifp; - int command; - void *data; +static int +ieioctl(ifp, command, data) + struct ifnet *ifp; + int command; + caddr_t data; { struct ifaddr *ifa = (struct ifaddr *)data; struct ie_softc *ie = &ie_softc[ifp->if_unit]; diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index 3064d08..97b3f51 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -34,7 +34,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.1 1993/10/12 06:08:29 rgrimes Exp $ + * $Id: mcd.c,v 1.2 1993/10/16 13:46:13 rgrimes Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -141,7 +141,7 @@ struct mcd_data { /* prototypes */ int mcdopen(dev_t dev); int mcdclose(dev_t dev); -int mcdstrategy(struct buf *bp); +void mcdstrategy(struct buf *bp); int mcdioctl(dev_t dev, int cmd, caddr_t addr, int flags); int mcdsize(dev_t dev); static void mcd_done(struct mcd_mbx *mbx); @@ -289,7 +289,8 @@ int mcdclose(dev_t dev) return 0; } -int mcdstrategy(struct buf *bp) +void +mcdstrategy(struct buf *bp) { struct mcd_data *cd; struct buf *qp; @@ -787,7 +788,9 @@ static int mcd_volinfo(int unit) return -1; } -int mcdintr(unit) +void +mcdintr(unit) + int unit; { int port = mcd_data[unit].iobase; u_int i; @@ -830,13 +833,13 @@ loop: /* get status */ outb(port+mcd_command, MCD_CMDGETSTAT); mbx->count = RDELAY_WAITSTAT; - timeout(mcd_doread,MCD_S_WAITSTAT,hz/100); + timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */ return; case MCD_S_WAITSTAT: untimeout(mcd_doread,MCD_S_WAITSTAT); if (mbx->count-- >= 0) { if (inb(port+mcd_xfer) & MCD_ST_BUSY) { - timeout(mcd_doread,MCD_S_WAITSTAT,hz/100); + timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */ return; } mcd_setflags(unit,cd); @@ -860,7 +863,7 @@ loop: mcd_put(port+mcd_command, MCD_CMDSETMODE); mcd_put(port+mcd_command, rm); - timeout(mcd_doread,MCD_S_WAITMODE,hz/100); + timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */ return; } else { #ifdef MCD_TO_WARNING_ON @@ -878,7 +881,7 @@ loop: goto readerr; } if (inb(port+mcd_xfer) & MCD_ST_BUSY) { - timeout(mcd_doread,MCD_S_WAITMODE,hz/100); + timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITMODE,hz/100); return; } mcd_setflags(unit,cd); @@ -905,7 +908,7 @@ nextblock: mcd_put(port+mcd_command,0); mcd_put(port+mcd_command,1); mbx->count = RDELAY_WAITREAD; - timeout(mcd_doread,MCD_S_WAITREAD,hz/100); + timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */ return; case MCD_S_WAITREAD: untimeout(mcd_doread,MCD_S_WAITREAD); @@ -935,7 +938,7 @@ nextblock: } if ((k & 4)==0) mcd_getstat(unit,0); - timeout(mcd_doread,MCD_S_WAITREAD,hz/100); + timeout((timeout_func_t)mcd_doread,(caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */ return; } else { #ifdef MCD_TO_WARNING_ON diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c index 60621cc..eebe163 100644 --- a/sys/dev/mse/mse.c +++ b/sys/dev/mse/mse.c @@ -55,7 +55,9 @@ #include "i386/isa/isa_device.h" #include "i386/isa/icu.h" -int mseprobe(), mseattach(), mseintr(); +static int mseprobe(struct isa_device *); +static int mseattach(struct isa_device *); +void mseintr(int); struct isa_driver msedriver = { mseprobe, mseattach, "mse" @@ -146,6 +148,7 @@ struct mse_types { { 0, }, }; +int mseprobe(idp) register struct isa_device *idp; { @@ -169,6 +172,7 @@ mseprobe(idp) return (0); } +int mseattach(idp) struct isa_device *idp; { @@ -181,6 +185,7 @@ mseattach(idp) /* * Exclusive open the mouse, initialize it and enable interrupts. */ +int mseopen(dev, flag) dev_t dev; int flag; @@ -210,7 +215,9 @@ mseopen(dev, flag) /* * mseclose: just turn off mouse innterrupts. */ +int mseclose(dev, flag) + dev_t dev; int flag; { struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)]; @@ -228,6 +235,7 @@ mseclose(dev, flag) * using bytes 4 and 5. * (Yes this is cheesy, but it makes the X386 server happy, so...) */ +int mseread(dev, uio) dev_t dev; struct uio *uio; @@ -288,6 +296,7 @@ mseread(dev, uio) /* * mseselect: check for mouse input to be processed. */ +int mseselect(dev, rw, p) dev_t dev; int rw; @@ -315,6 +324,7 @@ mseselect(dev, rw, p) /* * mseintr: update mouse status. sc_deltax and sc_deltay are accumulative. */ +void mseintr(unit) int unit; { diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 45596ed..39f2e59 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.14 1993/11/14 23:29:01 ache Exp $ + * $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $ */ #include "sio.h" @@ -196,13 +196,6 @@ struct com_s { u_char ibuf2[2 * RS_IBUFSIZE]; }; -/* XXX - these functions ought to be declared in systm.h. */ -#define nonint int -nonint timeout __P((timeout_func_t func, caddr_t arg, int t)); -int tsleep __P((caddr_t chan, int pri, char *wmesg, int timo)); -int ttnread __P((struct tty *tp)); -nonint wakeup __P((caddr_t chan)); - /* * These functions in the com module ought to be declared (with a prototype) * in a com-driver system header. The void ones may need to be int to match @@ -223,23 +216,12 @@ void siocnputc __P((Dev_t dev, int c)); int sioopen __P((Dev_t dev, int oflags, int devtype, struct proc *p)); /* - * sioopen gets compared to the d_open entry in struct cdevsw. d_open and - * other functions are declared in <sys/conf.h> with short types like dev_t - * in the prototype. Such declarations are broken because they vary with - * __P (significantly in theory - the compiler is allowed to push a short - * arg if it has seen the prototype; insignificantly in practice - gcc - * doesn't push short args and it would be slower on 386's to do so). - * * Also, most of the device switch functions are still declared old-style * so they take a Dev_t arg and shorten it to a dev_t. It would be simpler * and faster if dev_t's were always promoted (to ints or whatever) as * early as possible. - * - * Until <sys/conf.h> is fixed, we cast sioopen to the following `wrong' type - * when comparing it to the d_open entry just to avoid compiler warnings. */ -typedef int (*bogus_open_t) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); + int sioread __P((Dev_t dev, struct uio *uio, int ioflag)); int sioselect __P((Dev_t dev, int rw, struct proc *p)); void siostop __P((struct tty *tp, int rw)); @@ -257,8 +239,8 @@ static int commctl __P((struct com_s *com, int bits, int how)); static int comparam __P((struct tty *tp, struct termios *t)); static int sioprobe __P((struct isa_device *dev)); static void compoll __P((void)); -static int comstart __P((struct tty *tp)); -static nonint comwakeup __P((caddr_t chan, int ticks)); +static void comstart __P((struct tty *tp)); +static void comwakeup __P((caddr_t chan, int ticks)); static int tiocm_xxx2mcr __P((int tiocm_xxx)); /* table and macro for fast conversion from a unit number to its com struct */ @@ -724,7 +706,7 @@ bidir_open_top: out: splx(s); if (error == 0) - error = (*linesw[tp->t_line].l_open)(dev, tp); + error = (*linesw[tp->t_line].l_open)(dev, tp, 0); #ifdef COM_BIDIR /* wakeup sleepers */ @@ -1161,7 +1143,7 @@ compoll() s = spltty(); repeat: for (unit = 0; unit < NSIO; ++unit) { - u_char *buf; + u_char *buf = 0; u_char *ibuf; int incc; struct tty *tp; @@ -1447,7 +1429,7 @@ retry: return (0); } -static int /* XXX - should be void */ +static void comstart(tp) struct tty *tp; { @@ -1502,7 +1484,6 @@ comstart(tp) } out: splx(s); - return (1); } void @@ -1555,7 +1536,7 @@ commctl(com, bits, how) return (bits); } -static nonint +static void comwakeup(chan, ticks) caddr_t chan; int ticks; @@ -1577,7 +1558,7 @@ comwakeup(chan, ticks) enable_intr(); } } - return (0); + return; } void @@ -1601,7 +1582,7 @@ siocnprobe(cp) /* locate the major number */ for (commajor = 0; commajor < nchrdev; commajor++) - if (cdevsw[commajor].d_open == (bogus_open_t) sioopen) + if (cdevsw[commajor].d_open == sioopen) break; /* XXX: ick */ |