summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/usb
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-05-08 17:48:48 +0000
committerhselasky <hselasky@FreeBSD.org>2015-05-08 17:48:48 +0000
commit82e528e78860ca6242a565e82588c49f5667b24d (patch)
treed980071d8df4b5004d444e88b0a694d065e0a7b6 /sys/dev/sound/usb
parente88a1dfd3e17536971b129f0e01f5ac9d71e277f (diff)
downloadFreeBSD-src-82e528e78860ca6242a565e82588c49f5667b24d.zip
FreeBSD-src-82e528e78860ca6242a565e82588c49f5667b24d.tar.gz
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
Diffstat (limited to 'sys/dev/sound/usb')
-rw-r--r--sys/dev/sound/usb/uaudio.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index c255a19..063d8ce 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -1575,6 +1575,19 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
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_softc *sc, struct usb_device *udev,
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
OpenPOWER on IntegriCloud