From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 19 01:31:00 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B0C810656A3; Fri, 19 Nov 2010 01:31:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3A348FC24; Fri, 19 Nov 2010 01:30:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAJ1Uxif051822; Fri, 19 Nov 2010 01:30:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAJ1Ux3a051819; Fri, 19 Nov 2010 01:30:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011190130.oAJ1Ux3a051819@svn.freebsd.org> From: Andrew Thompson Date: Fri, 19 Nov 2010 01:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215484 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 01:31:00 -0000 Author: thompsa Date: Fri Nov 19 01:30:59 2010 New Revision: 215484 URL: http://svn.freebsd.org/changeset/base/215484 Log: MFC r209452 - fix for USB audio devices which use the 7-byte endpoint descriptor instead of the 9-byte one. - remove sync-endpoint code, which is currently unused. Reported by: Antun Matanovi Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/sound/usb/uaudioreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Fri Nov 19 01:30:23 2010 (r215483) +++ stable/8/sys/dev/sound/usb/uaudio.c Fri Nov 19 01:30:59 2010 (r215484) @@ -792,7 +792,8 @@ uaudio_chan_dump_ep_desc(const usb_endpo ed, ed->bLength, ed->bDescriptorType, ed->bEndpointAddress, ed->bmAttributes, UGETW(ed->wMaxPacketSize), ed->bInterval, - ed->bRefresh, ed->bSynchAddress); + UEP_HAS_REFRESH(ed) ? ed->bRefresh : 0, + UEP_HAS_SYNCADDR(ed) ? ed->bSynchAddress : 0); } } @@ -817,8 +818,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ uint16_t alt_index = 0; uint16_t wFormat; uint8_t ep_dir; - uint8_t ep_type; - uint8_t ep_sync; uint8_t bChannels; uint8_t bBitResolution; uint8_t x; @@ -896,34 +895,12 @@ uaudio_chan_fill_info_sub(struct uaudio_ } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= sizeof(*ed1))) { + (desc->bLength >= UEP_MINSIZE)) { if (ed1 == NULL) { ed1 = (void *)desc; if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { ed1 = NULL; } - } else { - if (ed2 == NULL) { - ed2 = (void *)desc; - if (UE_GET_XFERTYPE(ed2->bmAttributes) != UE_ISOCHRONOUS) { - ed2 = NULL; - continue; - } - if (ed2->bSynchAddress != 0) { - DPRINTFN(11, "invalid endpoint: bSynchAddress != 0\n"); - ed2 = NULL; - continue; - } - if (ed2->bEndpointAddress != ed1->bSynchAddress) { - DPRINTFN(11, "invalid endpoint addresses: " - "ep[0]->bSynchAddress=0x%x " - "ep[1]->bEndpointAddress=0x%x\n", - ed1->bSynchAddress, - ed2->bEndpointAddress); - ed2 = NULL; - continue; - } - } } } if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && @@ -936,35 +913,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ if (audio_if && asid && asf1d && ed1 && sed) { ep_dir = UE_GET_DIR(ed1->bEndpointAddress); - ep_type = UE_GET_ISO_TYPE(ed1->bmAttributes); - ep_sync = 0; - - if ((sc->sc_uq_au_inp_async) && - (ep_dir == UE_DIR_IN) && (ep_type == UE_ISO_ADAPT)) { - ep_type = UE_ISO_ASYNC; - } - if ((ep_dir == UE_DIR_IN) && (ep_type == UE_ISO_ADAPT)) { - ep_sync = 1; - } - if ((ep_dir != UE_DIR_IN) && (ep_type == UE_ISO_ASYNC)) { - ep_sync = 1; - } - /* Ignore sync endpoint information until further. */ -#if 0 - if (ep_sync && (!ed2)) { - continue; - } - /* - * we can't handle endpoints that need a sync pipe - * yet - */ - if (ep_sync) { - DPRINTF("skipped sync interface\n"); - audio_if = 0; - continue; - } -#endif + /* We ignore sync endpoint information until further. */ wFormat = UGETW(asid->wFormatTag); bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); Modified: stable/8/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- stable/8/sys/dev/sound/usb/uaudioreg.h Fri Nov 19 01:30:23 2010 (r215483) +++ stable/8/sys/dev/sound/usb/uaudioreg.h Fri Nov 19 01:30:59 2010 (r215484) @@ -47,6 +47,11 @@ #define UDESCSUB_AC_PROCESSING 7 #define UDESCSUB_AC_EXTENSION 8 +/* These macros check if the endpoint descriptor has additional fields */ +#define UEP_MINSIZE 7 +#define UEP_HAS_REFRESH(ep) ((ep)->bLength >= 8) +#define UEP_HAS_SYNCADDR(ep) ((ep)->bLength >= 9) + /* The first fields are identical to struct usb_endpoint_descriptor */ typedef struct { uByte bLength;