From 2abc85f0c039d2d7bbccf7f8aff33173fd5793cc Mon Sep 17 00:00:00 2001 From: Cameron Grant Date: Wed, 5 Jan 2000 04:01:34 +0000 Subject: [PATCH] argh, forgot the bus_dma_tag_creates. also, panic if channel init fails instead of derefing null. --- sys/dev/sound/isa/mss.c | 2 +- sys/dev/sound/isa/sb.c | 3 ++- sys/dev/sound/isa/sb16.c | 3 ++- sys/dev/sound/isa/sb8.c | 3 ++- sys/dev/sound/pcm/channel.c | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index 8f02d45e0a96..b124124f0374 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -890,7 +890,7 @@ mss_doattach(device_t dev, struct mss_info *mss) /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/DSP_BUFFSIZE, /*nsegments*/1, + /*maxsize*/MSS_BUFFSIZE, /*nsegments*/1, /*maxsegz*/0x3ffff, /*flags*/0, &mss->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); diff --git a/sys/dev/sound/isa/sb.c b/sys/dev/sound/isa/sb.c index 1b501a4000b8..b5142d9554a7 100644 --- a/sys/dev/sound/isa/sb.c +++ b/sys/dev/sound/isa/sb.c @@ -464,6 +464,7 @@ sb_doattach(device_t dev, struct sb_info *sb) snddev_info *d = device_get_softc(dev); void *ih; char status[SND_STATUSLEN]; + int bs = (sb->bd_flags & BD_F_ESS)? ESS_BUFFSIZE : DSP_BUFFSIZE; if (sb_alloc_resources(sb, dev)) goto no; if (sb_reset_dsp(sb)) goto no; @@ -482,7 +483,7 @@ sb_doattach(device_t dev, struct sb_info *sb) /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/DSP_BUFFSIZE, /*nsegments*/1, + /*maxsize*/bs, /*nsegments*/1, /*maxsegz*/0x3ffff, /*flags*/0, &sb->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index 1b501a4000b8..b5142d9554a7 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -464,6 +464,7 @@ sb_doattach(device_t dev, struct sb_info *sb) snddev_info *d = device_get_softc(dev); void *ih; char status[SND_STATUSLEN]; + int bs = (sb->bd_flags & BD_F_ESS)? ESS_BUFFSIZE : DSP_BUFFSIZE; if (sb_alloc_resources(sb, dev)) goto no; if (sb_reset_dsp(sb)) goto no; @@ -482,7 +483,7 @@ sb_doattach(device_t dev, struct sb_info *sb) /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/DSP_BUFFSIZE, /*nsegments*/1, + /*maxsize*/bs, /*nsegments*/1, /*maxsegz*/0x3ffff, /*flags*/0, &sb->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 1b501a4000b8..b5142d9554a7 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -464,6 +464,7 @@ sb_doattach(device_t dev, struct sb_info *sb) snddev_info *d = device_get_softc(dev); void *ih; char status[SND_STATUSLEN]; + int bs = (sb->bd_flags & BD_F_ESS)? ESS_BUFFSIZE : DSP_BUFFSIZE; if (sb_alloc_resources(sb, dev)) goto no; if (sb_reset_dsp(sb)) goto no; @@ -482,7 +483,7 @@ sb_doattach(device_t dev, struct sb_info *sb) /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/DSP_BUFFSIZE, /*nsegments*/1, + /*maxsize*/bs, /*nsegments*/1, /*maxsegz*/0x3ffff, /*flags*/0, &sb->parent_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index dc63bd5b3339..3f48edd517b9 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1021,6 +1021,7 @@ chn_init(pcm_channel *c, void *devinfo, int dir) c->feeder = &feeder_root; c->buffer.chan = -1; c->devinfo = c->init(devinfo, &c->buffer, c, dir); + if (c->devinfo == NULL) panic("c->init() failed"); chn_setdir(c, dir); /* And the secondary buffer. */