Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2015 07:09:20 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r283184 - stable/8/sys/dev/sound/usb
Message-ID:  <201505210709.t4L79KKt006531@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 21 07:09:19 2015
New Revision: 283184
URL: https://svnweb.freebsd.org/changeset/base/283184

Log:
  MFC r282652:
  Ensure the USB audio driver doesn't attach twice on the same USB
  device by grabbing all the USB audio device interfaces.

Modified:
  stable/8/sys/dev/sound/usb/uaudio.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/usb/   (props changed)

Modified: stable/8/sys/dev/sound/usb/uaudio.c
==============================================================================
--- stable/8/sys/dev/sound/usb/uaudio.c	Thu May 21 07:09:01 2015	(r283183)
+++ stable/8/sys/dev/sound/usb/uaudio.c	Thu May 21 07:09:19 2015	(r283184)
@@ -1574,6 +1574,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) {
@@ -1809,9 +1822,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505210709.t4L79KKt006531>