svn commit: r215484 - stable/8/sys/dev/sound/usb
Andrew Thompson
thompsa at FreeBSD.org
Fri Nov 19 01:31:00 UTC 2010
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;
More information about the svn-src-stable
mailing list