Prototype fixes

This commit is contained in:
christos 1996-04-29 19:45:32 +00:00
parent 3a77c25f3e
commit f1dd12ed4e
2 changed files with 33 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wss.c,v 1.11 1996/04/11 22:30:46 cgd Exp $ */
/* $NetBSD: wss.c,v 1.12 1996/04/29 19:46:09 christos Exp $ */
/*
* Copyright (c) 1994 John Brezak
@ -113,6 +113,8 @@ int wss_mixer_set_port __P((void *, mixer_ctrl_t *));
int wss_mixer_get_port __P((void *, mixer_ctrl_t *));
int wss_query_devinfo __P((void *, mixer_devinfo_t *));
static int wss_to_vol __P((mixer_ctrl_t *, struct ad1848_volume *));
static int wss_from_vol __P((mixer_ctrl_t *, struct ad1848_volume *));
/*
* Define our interface to the higher level audio driver.
*/
@ -361,7 +363,6 @@ wss_set_in_port(addr, port)
int port;
{
register struct ad1848_softc *ac = addr;
register struct wss_softc *sc = ac->parent;
DPRINTF(("wss_set_in_port: %d\n", port));
@ -388,7 +389,6 @@ wss_get_in_port(addr)
void *addr;
{
register struct ad1848_softc *ac = addr;
register struct wss_softc *sc = ac->parent;
int port = WSS_MIC_IN_LVL;
switch(ad1848_get_rec_port(ac)) {
@ -416,7 +416,6 @@ wss_mixer_set_port(addr, cp)
register struct ad1848_softc *ac = addr;
register struct wss_softc *sc = ac->parent;
struct ad1848_volume vol;
u_char eq;
int error = EINVAL;
DPRINTF(("wss_mixer_set_port: dev=%d type=%d\n", cp->dev, cp->type));
@ -503,7 +502,6 @@ wss_mixer_get_port(addr, cp)
register struct ad1848_softc *ac = addr;
register struct wss_softc *sc = ac->parent;
struct ad1848_volume vol;
u_char eq;
int error = EINVAL;
DPRINTF(("wss_mixer_get_port: port=%d\n", cp->dev));
@ -590,9 +588,6 @@ wss_query_devinfo(addr, dip)
void *addr;
register mixer_devinfo_t *dip;
{
register struct ad1848_softc *ac = addr;
register struct wss_softc *sc = ac->parent;
DPRINTF(("wss_query_devinfo: index=%d\n", dip->index));
switch(dip->index) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: wt.c,v 1.31 1996/04/11 22:30:49 cgd Exp $ */
/* $NetBSD: wt.c,v 1.32 1996/04/29 19:45:32 christos Exp $ */
/*
* Streamer tape driver.
@ -59,6 +59,8 @@
#include <sys/ioctl.h>
#include <sys/mtio.h>
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <vm/vm_param.h>
@ -149,6 +151,10 @@ struct wt_softc {
u_char BUSY, NOEXCEP, RESETMASK, RESETVAL, ONLINE, RESET, REQUEST, IEN;
};
/* XXX: These don't belong here really */
cdev_decl(wt);
bdev_decl(wt);
int wtwait __P((struct wt_softc *sc, int catch, char *msg));
int wtcmd __P((struct wt_softc *sc, int cmd));
int wtstart __P((struct wt_softc *sc, int flag, void *vaddr, size_t len));
@ -282,9 +288,11 @@ wtsize(dev)
* Open routine, called on every device open.
*/
int
wtopen(dev, flag)
wtopen(dev, flag, mode, p)
dev_t dev;
int flag;
int mode;
struct proc *p;
{
int unit = minor(dev) & T_UNIT;
struct wt_softc *sc;
@ -303,7 +311,7 @@ wtopen(dev, flag)
/* If the tape is in rewound state, check the status and set density. */
if (sc->flags & TPSTART) {
/* If rewind is going on, wait */
if (error = wtwait(sc, PCATCH, "wtrew"))
if ((error = wtwait(sc, PCATCH, "wtrew")) != 0)
return error;
/* Check the controller status */
@ -371,8 +379,11 @@ wtopen(dev, flag)
* Close routine, called on last device close.
*/
int
wtclose(dev)
wtclose(dev, flags, mode, p)
dev_t dev;
int flags;
int mode;
struct proc *p;
{
int unit = minor(dev) & T_UNIT;
struct wt_softc *sc = wt_cd.cd_devs[unit];
@ -422,11 +433,12 @@ done:
* ioctl(int fd, WTQICMD, int qicop) -- do QIC op
*/
int
wtioctl(dev, cmd, addr, flag)
wtioctl(dev, cmd, addr, flag, p)
dev_t dev;
u_long cmd;
void *addr;
caddr_t addr;
int flag;
struct proc *p;
{
int unit = minor(dev) & T_UNIT;
struct wt_softc *sc = wt_cd.cd_devs[unit];
@ -443,11 +455,11 @@ wtioctl(dev, cmd, addr, flag)
case QIC_ERASE: /* erase the whole tape */
if ((sc->flags & TPWRITE) == 0 || (sc->flags & TPWP))
return EACCES;
if (error = wtwait(sc, PCATCH, "wterase"))
if ((error = wtwait(sc, PCATCH, "wterase")) != 0)
return error;
break;
case QIC_RETENS: /* retension the tape */
if (error = wtwait(sc, PCATCH, "wtretens"))
if ((error = wtwait(sc, PCATCH, "wtretens")) != 0)
return error;
break;
}
@ -493,25 +505,25 @@ wtioctl(dev, cmd, addr, flag)
case MTOFFL: /* rewind and put the drive offline */
if (sc->flags & TPREW) /* rewind is running */
return 0;
if (error = wtwait(sc, PCATCH, "wtorew"))
if ((error = wtwait(sc, PCATCH, "wtorew")) != 0)
return error;
wtrewind(sc);
return 0;
case MTFSF: /* forward space file */
for (count = ((struct mtop*)addr)->mt_count; count > 0;
--count) {
if (error = wtwait(sc, PCATCH, "wtorfm"))
if ((error = wtwait(sc, PCATCH, "wtorfm")) != 0)
return error;
if (error = wtreadfm(sc))
if ((error = wtreadfm(sc)) != 0)
return error;
}
return 0;
case MTWEOF: /* write an end-of-file record */
if ((sc->flags & TPWRITE) == 0 || (sc->flags & TPWP))
return EACCES;
if (error = wtwait(sc, PCATCH, "wtowfm"))
if ((error = wtwait(sc, PCATCH, "wtowfm")) != 0)
return error;
if (error = wtwritefm(sc))
if ((error = wtwritefm(sc)) != 0)
return error;
return 0;
}
@ -600,18 +612,20 @@ xit:
}
int
wtread(dev, uio)
wtread(dev, uio, flags)
dev_t dev;
struct uio *uio;
int flags;
{
return (physio(wtstrategy, NULL, dev, B_READ, minphys, uio));
}
int
wtwrite(dev, uio)
wtwrite(dev, uio, flags)
dev_t dev;
struct uio *uio;
int flags;
{
return (physio(wtstrategy, NULL, dev, B_WRITE, minphys, uio));
@ -842,7 +856,7 @@ wtwait(sc, catch, msg)
WTDBPRINT(("wtwait() `%s'\n", msg));
while (sc->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK))
if (error = tsleep((caddr_t)sc, WTPRI | catch, msg, 0))
if ((error = tsleep((caddr_t)sc, WTPRI | catch, msg, 0)) != 0)
return error;
return 0;
}