From owner-svn-src-stable@FreeBSD.ORG Mon Mar 12 18:38:40 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF38106564A; Mon, 12 Mar 2012 18:38:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2E28FC20; Mon, 12 Mar 2012 18:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2CIce7Q079685; Mon, 12 Mar 2012 18:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2CIceHY079682; Mon, 12 Mar 2012 18:38:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201203121838.q2CIceHY079682@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 Mar 2012 18:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232877 - stable/9/sys/dev/sound/usb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2012 18:38:40 -0000 Author: hselasky Date: Mon Mar 12 18:38:40 2012 New Revision: 232877 URL: http://svn.freebsd.org/changeset/base/232877 Log: MFC r228485 and r227843: Stop USB audio transfers early so that any audio applications will time out and close opened /dev/dspX.Y device(s), if any. Modified: stable/9/sys/dev/sound/usb/uaudio.c stable/9/sys/dev/sound/usb/uaudio.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:22:04 2012 (r232876) +++ stable/9/sys/dev/sound/usb/uaudio.c Mon Mar 12 18:38:40 2012 (r232877) @@ -773,7 +773,17 @@ uaudio_detach(device_t dev) { struct uaudio_softc *sc = device_get_softc(dev); - if (bus_generic_detach(dev)) { + /* + * Stop USB transfers early so that any audio applications + * will time out and close opened /dev/dspX.Y device(s), if + * any. + */ + if (sc->sc_play_chan.valid) + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + if (sc->sc_rec_chan.valid) + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + + if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); } sbuf_delete(&sc->sc_sndstat); Modified: stable/9/sys/dev/sound/usb/uaudio.h ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.h Mon Mar 12 18:22:04 2012 (r232876) +++ stable/9/sys/dev/sound/usb/uaudio.h Mon Mar 12 18:38:40 2012 (r232877) @@ -27,6 +27,9 @@ /* prototypes from "uaudio.c" used by "uaudio_pcm.c" */ +#ifndef _UAUDIO_H_ +#define _UAUDIO_H_ + struct uaudio_chan; struct uaudio_softc; struct snd_dbuf; @@ -63,3 +66,5 @@ extern uint32_t uaudio_mixer_setrecsrc(s int uaudio_get_vendor(device_t dev); int uaudio_get_product(device_t dev); int uaudio_get_release(device_t dev); + +#endif /* _UAUDIO_H_ */