diff options
-rw-r--r-- | sys/dev/sequencer.c | 184 |
1 files changed, 44 insertions, 140 deletions
diff --git a/sys/dev/sequencer.c b/sys/dev/sequencer.c index ebebdb5808d..b175da4e69b 100644 --- a/sys/dev/sequencer.c +++ b/sys/dev/sequencer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sequencer.c,v 1.12 2007/02/13 08:05:37 jsg Exp $ */ +/* $OpenBSD: sequencer.c,v 1.13 2007/06/06 19:42:28 mk Exp $ */ /* $NetBSD: sequencer.c,v 1.13 1998/11/25 22:17:07 augustss Exp $ */ /* @@ -153,16 +153,12 @@ int midiseq_putc(struct midi_dev *, int); void midiseq_in(struct midi_dev *, u_char *, int); void -sequencerattach(n) - int n; +sequencerattach(int n) { } int -sequenceropen(dev, flags, ifmt, p) - dev_t dev; - int flags, ifmt; - struct proc *p; +sequenceropen(dev_t dev, int flags, int ifmt, struct proc *p) { int unit = SEQUENCERUNIT(dev); struct sequencer_softc *sc; @@ -220,10 +216,7 @@ sequenceropen(dev, flags, ifmt, p) } static int -seq_sleep_timo(chan, label, timo) - int *chan; - char *label; - int timo; +seq_sleep_timo(int *chan, char *label, int timo) { int st; @@ -242,16 +235,13 @@ seq_sleep_timo(chan, label, timo) } static int -seq_sleep(chan, label) - int *chan; - char *label; +seq_sleep(int *chan, char *label) { return (seq_sleep_timo(chan, label, 0)); } static void -seq_wakeup(chan) - int *chan; +seq_wakeup(int *chan) { if (*chan) { DPRINTFN(5, ("seq_wakeup: %p\n", chan)); @@ -261,8 +251,7 @@ seq_wakeup(chan) } int -seq_drain(sc) - struct sequencer_softc *sc; +seq_drain(struct sequencer_softc *sc) { int error; @@ -275,8 +264,7 @@ seq_drain(sc) } void -seq_timeout(addr) - void *addr; +seq_timeout(void *addr) { struct sequencer_softc *sc = addr; DPRINTFN(4, ("seq_timeout: %p\n", sc)); @@ -292,8 +280,7 @@ seq_timeout(addr) } void -seq_startoutput(sc) - struct sequencer_softc *sc; +seq_startoutput(struct sequencer_softc *sc) { struct sequencer_queue *q = &sc->outq; seq_event_rec cmd; @@ -308,10 +295,7 @@ seq_startoutput(sc) } int -sequencerclose(dev, flags, ifmt, p) - dev_t dev; - int flags, ifmt; - struct proc *p; +sequencerclose(dev_t dev, int flags, int ifmt, struct proc *p) { struct sequencer_softc *sc = &seqdevs[SEQUENCERUNIT(dev)]; int n, s; @@ -334,9 +318,7 @@ sequencerclose(dev, flags, ifmt, p) } static int -seq_input_event(sc, cmd) - struct sequencer_softc *sc; - seq_event_rec *cmd; +seq_input_event(struct sequencer_softc *sc, seq_event_rec *cmd) { struct sequencer_queue *q = &sc->inq; @@ -354,9 +336,7 @@ seq_input_event(sc, cmd) } void -seq_event_intr(addr, iev) - void *addr; - seq_event_rec *iev; +seq_event_intr(void *addr, seq_event_rec *iev) { struct sequencer_softc *sc = addr; union { @@ -388,10 +368,7 @@ seq_event_intr(addr, iev) } int -sequencerread(dev, uio, ioflag) - dev_t dev; - struct uio *uio; - int ioflag; +sequencerread(dev_t dev, struct uio *uio, int ioflag) { struct sequencer_softc *sc = &seqdevs[SEQUENCERUNIT(dev)]; struct sequencer_queue *q = &sc->inq; @@ -426,10 +403,7 @@ sequencerread(dev, uio, ioflag) } int -sequencerwrite(dev, uio, ioflag) - dev_t dev; - struct uio *uio; - int ioflag; +sequencerwrite(dev_t dev, struct uio *uio, int ioflag) { struct sequencer_softc *sc = &seqdevs[SEQUENCERUNIT(dev)]; struct sequencer_queue *q = &sc->outq; @@ -477,12 +451,7 @@ sequencerwrite(dev, uio, ioflag) } int -sequencerioctl(dev, cmd, addr, flag, p) - dev_t dev; - u_long cmd; - caddr_t addr; - int flag; - struct proc *p; +sequencerioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) { struct sequencer_softc *sc = &seqdevs[SEQUENCERUNIT(dev)]; struct synth_info *si; @@ -632,10 +601,7 @@ sequencerioctl(dev, cmd, addr, flag, p) } int -sequencerpoll(dev, events, p) - dev_t dev; - int events; - struct proc *p; +sequencerpoll(dev_t dev, int events, struct proc *p) { struct sequencer_softc *sc = &seqdevs[SEQUENCERUNIT(dev)]; int revents = 0; @@ -660,8 +626,7 @@ sequencerpoll(dev, events, p) } void -seq_reset(sc) - struct sequencer_softc *sc; +seq_reset(struct sequencer_softc *sc) { int i, chn; struct midi_dev *md; @@ -678,9 +643,7 @@ seq_reset(sc) } int -seq_do_command(sc, b) - struct sequencer_softc *sc; - seq_event_rec *b; +seq_do_command(struct sequencer_softc *sc, seq_event_rec *b) { int dev; @@ -711,9 +674,7 @@ seq_do_command(sc, b) } int -seq_do_chnvoice(sc, b) - struct sequencer_softc *sc; - seq_event_rec *b; +seq_do_chnvoice(struct sequencer_softc *sc, seq_event_rec *b) { int cmd, dev, chan, note, parm, voice; int error; @@ -755,9 +716,7 @@ seq_do_chnvoice(sc, b) } int -seq_do_chncommon(sc, b) - struct sequencer_softc *sc; - seq_event_rec *b; +seq_do_chncommon(struct sequencer_softc *sc, seq_event_rec *b) { int cmd, dev, chan, p1, w14; int error; @@ -804,9 +763,7 @@ seq_do_chncommon(sc, b) } int -seq_do_timing(sc, b) - struct sequencer_softc *sc; - seq_event_rec *b; +seq_do_timing(struct sequencer_softc *sc, seq_event_rec *b) { union { int32_t i; @@ -821,17 +778,13 @@ seq_do_timing(sc, b) } int -seq_do_local(sc, b) - struct sequencer_softc *sc; - seq_event_rec *b; +seq_do_local(struct sequencer_softc *sc, seq_event_rec *b) { return (EINVAL); } int -seq_do_sysex(sc, b) - struct sequencer_softc *sc; - seq_event_rec *b; +seq_do_sysex(struct sequencer_softc *sc, seq_event_rec *b) { int dev, i; struct midi_dev *md; @@ -858,10 +811,7 @@ seq_do_sysex(sc, b) } int -seq_timer(sc, cmd, parm, b) - struct sequencer_softc *sc; - int cmd, parm; - seq_event_rec *b; +seq_timer(struct sequencer_softc *sc, int cmd, int parm, seq_event_rec *b) { struct syn_timer *t = &sc->timer; struct timeval when; @@ -942,10 +892,7 @@ seq_timer(sc, cmd, parm, b) } int -seq_do_fullsize(sc, b, uio) - struct sequencer_softc *sc; - seq_event_rec *b; - struct uio *uio; +seq_do_fullsize(struct sequencer_softc *sc, seq_event_rec *b, struct uio *uio) { struct sysex_info sysex; u_int dev; @@ -965,9 +912,7 @@ seq_do_fullsize(sc, b, uio) /* Convert an old sequencer event to a new one. */ int -seq_to_new(ev, uio) - seq_event_rec *ev; - struct uio *uio; +seq_to_new(seq_event_rec *ev, struct uio *uio) { int cmd, chan, note, parm; u_int32_t delay; @@ -1042,10 +987,7 @@ seq_to_new(ev, uio) /**********************************************/ void -midiseq_in(md, msg, len) - struct midi_dev *md; - u_char *msg; - int len; +midiseq_in(struct midi_dev *md, u_char *msg, int len) { int unit = md->unit; seq_event_rec ev; @@ -1085,9 +1027,7 @@ midiseq_in(md, msg, len) } struct midi_dev * -midiseq_open(unit, flags) - int unit; - int flags; +midiseq_open(int unit, int flags) { extern struct cfdriver midi_cd; int error; @@ -1117,8 +1057,7 @@ midiseq_open(unit, flags) } void -midiseq_close(md) - struct midi_dev *md; +midiseq_close(struct midi_dev *md) { DPRINTFN(2, ("midiseq_close: %d\n", md->unit)); midiclose(makedev(0, md->unit), 0, 0, 0); @@ -1126,19 +1065,14 @@ midiseq_close(md) } void -midiseq_reset(md) - struct midi_dev *md; +midiseq_reset(struct midi_dev *md) { /* XXX send GM reset? */ DPRINTFN(3, ("midiseq_reset: %d\n", md->unit)); } int -midiseq_out(md, buf, cc, chk) - struct midi_dev *md; - u_char *buf; - u_int cc; - int chk; +midiseq_out(struct midi_dev *md, u_char *buf, u_int cc, int chk) { DPRINTFN(5, ("midiseq_out: m=%p, unit=%d, buf[0]=0x%02x, cc=%d\n", md->msc, md->unit, buf[0], cc)); @@ -1152,9 +1086,7 @@ midiseq_out(md, buf, cc, chk) } int -midiseq_noteon(md, chan, note, vel) - struct midi_dev *md; - int chan, note, vel; +midiseq_noteon(struct midi_dev *md, int chan, int note, int vel) { u_char buf[3]; @@ -1172,9 +1104,7 @@ midiseq_noteon(md, chan, note, vel) } int -midiseq_noteoff(md, chan, note, vel) - struct midi_dev *md; - int chan, note, vel; +midiseq_noteoff(struct midi_dev *md, int chan, int note, int vel) { u_char buf[3]; @@ -1190,9 +1120,7 @@ midiseq_noteoff(md, chan, note, vel) } int -midiseq_keypressure(md, chan, note, vel) - struct midi_dev *md; - int chan, note, vel; +midiseq_keypressure(struct midi_dev *md, int chan, int note, int vel) { u_char buf[3]; @@ -1208,9 +1136,7 @@ midiseq_keypressure(md, chan, note, vel) } int -midiseq_pgmchange(md, chan, parm) - struct midi_dev *md; - int chan, parm; +midiseq_pgmchange(struct midi_dev *md, int chan, int parm) { u_char buf[2]; @@ -1223,9 +1149,7 @@ midiseq_pgmchange(md, chan, parm) } int -midiseq_chnpressure(md, chan, parm) - struct midi_dev *md; - int chan, parm; +midiseq_chnpressure(struct midi_dev *md, int chan, int parm) { u_char buf[2]; @@ -1238,9 +1162,7 @@ midiseq_chnpressure(md, chan, parm) } int -midiseq_ctlchange(md, chan, parm, w14) - struct midi_dev *md; - int chan, parm, w14; +midiseq_ctlchange(struct midi_dev *md, int chan, int parm, int w14) { u_char buf[3]; @@ -1254,9 +1176,7 @@ midiseq_ctlchange(md, chan, parm, w14) } int -midiseq_pitchbend(md, chan, parm) - struct midi_dev *md; - int chan, parm; +midiseq_pitchbend(struct midi_dev *md, int chan, int parm) { u_char buf[3]; @@ -1269,10 +1189,7 @@ midiseq_pitchbend(md, chan, parm) } int -midiseq_loadpatch(md, sysex, uio) - struct midi_dev *md; - struct sysex_info *sysex; - struct uio *uio; +midiseq_loadpatch(struct midi_dev *md, struct sysex_info *sysex, struct uio *uio) { u_char c, buf[128]; int i, cc, error; @@ -1323,9 +1240,7 @@ midiseq_loadpatch(md, sysex, uio) } int -midiseq_putc(md, data) - struct midi_dev *md; - int data; +midiseq_putc(struct midi_dev *md, int data) { u_char c = data; DPRINTFN(4,("midiseq_putc: 0x%02x\n", data)); @@ -1346,10 +1261,7 @@ midi_unit_count() } int -midiopen(dev, flags, ifmt, p) - dev_t dev; - int flags, ifmt; - struct proc *p; +midiopen(dev_t dev, int flags, int ifmt, struct proc *p) { return (ENXIO); } @@ -1357,26 +1269,18 @@ midiopen(dev, flags, ifmt, p) struct cfdriver midi_cd; void -midi_getinfo(dev, mi) - dev_t dev; - struct midi_info *mi; +midi_getinfo(dev_t dev, struct midi_info *mi) { } int -midiclose(dev, flags, ifmt, p) - dev_t dev; - int flags, ifmt; - struct proc *p; +midiclose(dev_t dev, int flags, int ifmt, struct proc *p) { return (ENXIO); } int -midi_writebytes(unit, buf, cc) - int unit; - u_char *buf; - int cc; +midi_writebytes(int unit, u_char *buf, int cc) { return (ENXIO); } |