Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/dev Pull up revision 1.196 via patch (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/a183963c43bb
branches:  netbsd-2-0
changeset: 564796:a183963c43bb
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Jun 12 21:28:27 2005 +0000

description:
Pull up revision 1.196 via patch (requested by is in ticket #1990):
Make sure buffer sizes are initialized correctly even when the pause state
is explicitly set.
Without this, the machine would crash for some audio hardware that needs
to divide by the block size (e.g., cs4281.c/cs4280.c).

diffstat:

 sys/dev/audio.c |  28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diffs (73 lines):

diff -r e7f5a19de546 -r a183963c43bb sys/dev/audio.c
--- a/sys/dev/audio.c   Sat Jun 11 12:33:28 2005 +0000
+++ b/sys/dev/audio.c   Sun Jun 12 21:28:27 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.182.2.1 2004/07/23 23:05:50 he Exp $       */
+/*     $NetBSD: audio.c,v 1.182.2.2 2005/06/12 21:28:27 tron Exp $     */
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.182.2.1 2004/07/23 23:05:50 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.182.2.2 2005/06/12 21:28:27 tron Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -2847,7 +2847,7 @@
 audiosetinfo(struct audio_softc *sc, struct audio_info *ai)
 {
        struct audio_prinfo *r = &ai->record, *p = &ai->play;
-       int cleared;
+       int cleared, pausechange;
        int s, setmode, modechange = 0;
        int error;
        struct audio_hw_if *hw = sc->hw_if;
@@ -2866,6 +2866,7 @@
        pbus = sc->sc_pbus;
        error = 0;
        cleared = 0;
+       pausechange = 0;
 
        pp = sc->sc_pparams;    /* Temporary encoding storage in */
        rp = sc->sc_rparams;    /* case setting the modes fails. */
@@ -3091,24 +3092,13 @@
 
        if (p->pause != (u_char)~0) {
                sc->sc_pr.pause = p->pause;
-               if (!p->pause && !sc->sc_pbus && (sc->sc_mode & AUMODE_PLAY)) {
-                       s = splaudio();
-                       error = audiostartp(sc);
-                       splx(s);
-                       if (error)
-                               return error;
-               }
+               pbus = !p->pause;
+               pausechange=1;
        }
        if (r->pause != (u_char)~0) {
                sc->sc_rr.pause = r->pause;
-               if (!r->pause && !sc->sc_rbus &&
-                   (sc->sc_mode & AUMODE_RECORD)) {
-                       s = splaudio();
-                       error = audiostartr(sc);
-                       splx(s);
-                       if (error)
-                               return error;
-               }
+               rbus = !r->pause;
+               pausechange=1;
        }
 
        if (ai->blocksize != ~0) {
@@ -3140,7 +3130,7 @@
                        return (error);
        }
 
-       if (cleared) {
+       if (cleared || pausechange) {
                s = splaudio();
                error = audio_initbufs(sc);
                if (error) goto err;



Home | Main Index | Thread Index | Old Index