Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/midi/sequencer.c
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
#define PCMMKMINOR(u, d, c) \ | #define PCMMKMINOR(u, d, c) \ | ||||
((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) | ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) | ||||
#define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) | #define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) | ||||
#define MIDIUNIT(y) ((dev2unit(y) >> 4) & 0x0f) | #define MIDIUNIT(y) ((dev2unit(y) >> 4) & 0x0f) | ||||
#define MIDIDEV(y) (dev2unit(y) & 0x0f) | #define MIDIDEV(y) (dev2unit(y) & 0x0f) | ||||
/* These are the entries to the sequencer driver. */ | /* These are the entries to the sequencer driver. */ | ||||
static d_open_t seq_open; | static d_open_t seq_open; | ||||
rpaulo: You're not going to change all the other functions in this file like (I think) we agreed? | |||||
Not Done Inline ActionsEventually. I'll likely do it in upstream and just pull it back into this work. adrian: Eventually. I'll likely do it in upstream and just pull it back into this work. | |||||
static d_close_t seq_close; | static d_close_t seq_close; | ||||
static d_ioctl_t seq_ioctl; | static d_ioctl_t seq_ioctl; | ||||
static d_read_t seq_read; | static d_read_t mseq_read; | ||||
static d_write_t seq_write; | static d_write_t seq_write; | ||||
static d_poll_t seq_poll; | static d_poll_t seq_poll; | ||||
static struct cdevsw seq_cdevsw = { | static struct cdevsw seq_cdevsw = { | ||||
.d_version = D_VERSION, | .d_version = D_VERSION, | ||||
.d_open = seq_open, | .d_open = seq_open, | ||||
.d_close = seq_close, | .d_close = seq_close, | ||||
.d_read = seq_read, | .d_read = mseq_read, | ||||
.d_write = seq_write, | .d_write = seq_write, | ||||
.d_ioctl = seq_ioctl, | .d_ioctl = seq_ioctl, | ||||
.d_poll = seq_poll, | .d_poll = seq_poll, | ||||
.d_name = "sequencer", | .d_name = "sequencer", | ||||
}; | }; | ||||
struct seq_softc { | struct seq_softc { | ||||
KOBJ_FIELDS; | KOBJ_FIELDS; | ||||
▲ Show 20 Lines • Show All 732 Lines • ▼ Show 20 Lines | |||||
err: | err: | ||||
SEQ_DEBUG(3, printf("seq_close: closed ret = %d.\n", ret)); | SEQ_DEBUG(3, printf("seq_close: closed ret = %d.\n", ret)); | ||||
mtx_unlock(&scp->seq_lock); | mtx_unlock(&scp->seq_lock); | ||||
return ret; | return ret; | ||||
} | } | ||||
int | int | ||||
seq_read(struct cdev *i_dev, struct uio *uio, int ioflag) | mseq_read(struct cdev *i_dev, struct uio *uio, int ioflag) | ||||
{ | { | ||||
int retval, used; | int retval, used; | ||||
struct seq_softc *scp = i_dev->si_drv1; | struct seq_softc *scp = i_dev->si_drv1; | ||||
#define SEQ_RSIZE 32 | #define SEQ_RSIZE 32 | ||||
u_char buf[SEQ_RSIZE]; | u_char buf[SEQ_RSIZE]; | ||||
if (scp == NULL) | if (scp == NULL) | ||||
return ENXIO; | return ENXIO; | ||||
SEQ_DEBUG(7, printf("seq_read: unit %d, resid %zd.\n", | SEQ_DEBUG(7, printf("mseq_read: unit %d, resid %zd.\n", | ||||
scp->unit, uio->uio_resid)); | scp->unit, uio->uio_resid)); | ||||
mtx_lock(&scp->seq_lock); | mtx_lock(&scp->seq_lock); | ||||
if ((scp->fflags & FREAD) == 0) { | if ((scp->fflags & FREAD) == 0) { | ||||
SEQ_DEBUG(2, printf("seq_read: unit %d is not for reading.\n", | SEQ_DEBUG(2, printf("mseq_read: unit %d is not for reading.\n", | ||||
scp->unit)); | scp->unit)); | ||||
retval = EIO; | retval = EIO; | ||||
goto err1; | goto err1; | ||||
} | } | ||||
/* | /* | ||||
* Begin recording. | * Begin recording. | ||||
*/ | */ | ||||
/* | /* | ||||
Show All 36 Lines | while (uio->uio_resid > 0) { | ||||
retval = uiomove(buf, used, uio); | retval = uiomove(buf, used, uio); | ||||
if (retval) | if (retval) | ||||
goto err1; | goto err1; | ||||
} | } | ||||
retval = 0; | retval = 0; | ||||
err1: | err1: | ||||
mtx_unlock(&scp->seq_lock); | mtx_unlock(&scp->seq_lock); | ||||
SEQ_DEBUG(6, printf("seq_read: ret %d, resid %zd.\n", | SEQ_DEBUG(6, printf("mseq_read: ret %d, resid %zd.\n", | ||||
retval, uio->uio_resid)); | retval, uio->uio_resid)); | ||||
return retval; | return retval; | ||||
} | } | ||||
int | int | ||||
seq_write(struct cdev *i_dev, struct uio *uio, int ioflag) | seq_write(struct cdev *i_dev, struct uio *uio, int ioflag) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,157 Lines • Show Last 20 Lines |
You're not going to change all the other functions in this file like (I think) we agreed?