From owner-svn-src-head@FreeBSD.ORG Fri May 8 17:48:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25659760; Fri, 8 May 2015 17:48:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 133AB1A16; Fri, 8 May 2015 17:48:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t48Hmm76002836; Fri, 8 May 2015 17:48:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48HmmHJ002835; Fri, 8 May 2015 17:48:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201505081748.t48HmmHJ002835@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 May 2015 17:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282652 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 17:48:49 -0000 Author: hselasky Date: Fri May 8 17:48:48 2015 New Revision: 282652 URL: https://svnweb.freebsd.org/changeset/base/282652 Log: Ensure the USB audio driver doesn't attach twice on the same USB device by grabbing all the USB audio device interfaces. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri May 8 17:07:11 2015 (r282651) +++ head/sys/dev/sound/usb/uaudio.c Fri May 8 17:48:48 2015 (r282652) @@ -1575,6 +1575,19 @@ uaudio_chan_fill_info_sub(struct uaudio_ asf1d.v1 = NULL; ed1 = NULL; sed.v1 = NULL; + + /* + * There can only be one USB audio instance + * per USB device. Grab all USB audio + * interfaces on this USB device so that we + * don't attach USB audio twice: + */ + if (alt_index == 0 && curidx != sc->sc_mixer_iface_index && + (id->bInterfaceClass == UICLASS_AUDIO || audio_if != 0 || + midi_if != 0)) { + usbd_set_parent_iface(sc->sc_udev, curidx, + sc->sc_mixer_iface_index); + } } if (audio_if == 0) { @@ -1810,9 +1823,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - usbd_set_parent_iface(sc->sc_udev, curidx, - sc->sc_mixer_iface_index); - if (ep_dir == UE_DIR_IN) chan_alt->usb_cfg = uaudio_cfg_record; else