diff options
author | jkh <jkh@FreeBSD.org> | 1995-02-13 22:49:06 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-02-13 22:49:06 +0000 |
commit | ab14a440443e93831ee428f1d1b624427878010f (patch) | |
tree | 3fc568af4b42ccb69382765a6b5d5743b0ae5baf /sys/i386/isa/sound/soundcard.c | |
parent | 1a5b05c3c75abfbbd38a2349a215e7269f320915 (diff) | |
download | FreeBSD-src-ab14a440443e93831ee428f1d1b624427878010f.zip FreeBSD-src-ab14a440443e93831ee428f1d1b624427878010f.tar.gz |
The following patches are for the sound drivers. These changes will
add a an ioctl call to set the transfer block size (SNDCTL_DSP_SETBLKSIZE)
and add the select system call to the drivers. They also fix a problem with
the #EXCLUDE macros for the PAS-16 card.
Submitted by: Jim Lowe <james@blatz.cs.uwm.edu>
Diffstat (limited to 'sys/i386/isa/sound/soundcard.c')
-rw-r--r-- | sys/i386/isa/sound/soundcard.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c index aab352d..213f263 100644 --- a/sys/i386/isa/sound/soundcard.c +++ b/sys/i386/isa/sound/soundcard.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: soundcard.c,v 1.19 1994/09/27 17:58:30 davidg Exp $ + * $Id: soundcard.c,v 1.20 1994/10/01 02:17:14 swallace Exp $ */ #include "sound_config.h" @@ -54,6 +54,7 @@ static int soundcards_installed = 0; /* Number of installed static int soundcard_configured = 0; static struct fileinfo files[SND_NDEVS]; +struct selinfo selinfo[SND_NDEVS >> 4]; int sndprobe (struct isa_device *dev); int sndattach (struct isa_device *dev); @@ -62,7 +63,7 @@ int sndclose (dev_t dev, int flags); int sndioctl (dev_t dev, int cmd, caddr_t arg, int mode); int sndread (int dev, struct uio *uio); int sndwrite (int dev, struct uio *uio); -int sndselect (int dev, int rw); +int sndselect (int dev, int rw, struct proc *p); static void sound_mem_init(void); unsigned @@ -122,6 +123,9 @@ sndopen (dev_t dev, int flags) else if (flags & FWRITE) files[dev].mode = OPEN_WRITE; + selinfo[dev >> 4].si_pid = 0; + selinfo[dev >> 4].si_flags = 0; + FIX_RETURN(sound_open_sw (dev, &files[dev])); } @@ -144,13 +148,33 @@ sndioctl (dev_t dev, int cmd, caddr_t arg, int mode) } int -sndselect (int dev, int rw) +sndselect (int dev, int rw, struct proc *p) { + int r,s; + dev = minor (dev); DEB (printk ("sound_ioctl(dev=%d, cmd=0x%x, arg=0x%x)\n", dev, cmd, arg)); - FIX_RETURN (0); + r = 0; + DISABLE_INTR(s); + switch (rw) { + case FREAD: /* record */ + if(DMAbuf_input_ready(dev >> 4)) + r = 1; + else + selrecord(p, &selinfo[dev >> 4]); + break; + case FWRITE: /* play */ + if(DMAbuf_output_ready(dev >> 4)) + r = 1; + else + selrecord(p, &selinfo[dev >> 4]); + break; + } + RESTORE_INTR(s); + + return r; } static unsigned short |