diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-03-22 17:18:44 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-03-22 17:18:44 +0000 |
commit | 1e89433bccdd066088e605a8eb62fb068239a36a (patch) | |
tree | 926a6f9b38860cab68716e87d3dadc003fc87133 /sys/dev/sound | |
parent | 3b3c7827c36e5eb42ffdee05f0813da041948ee3 (diff) | |
download | FreeBSD-src-1e89433bccdd066088e605a8eb62fb068239a36a.zip FreeBSD-src-1e89433bccdd066088e605a8eb62fb068239a36a.tar.gz |
MFC r263159:
Workaround for USB MIDI adapters which use non-supported values of
wMaxPacketSize for BULK endpoints.
Diffstat (limited to 'sys/dev/sound')
-rw-r--r-- | sys/dev/sound/usb/uaudio.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 3299f22..33ff274 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -5674,6 +5674,25 @@ umidi_probe(device_t dev) DPRINTF("error=%s\n", usbd_errstr(error)); goto detach; } + + /* + * Some USB MIDI device makers couldn't resist using + * wMaxPacketSize = 4 for RX and TX BULK endpoints, although + * that size is an unsupported value for FULL speed BULK + * endpoints. The same applies to some HIGH speed MIDI devices + * which are using a wMaxPacketSize different from 512 bytes. + * + * Refer to section 5.8.3 in USB 2.0 PDF: Cite: "All Host + * Controllers are required to have support for 8-, 16-, 32-, + * and 64-byte maximum packet sizes for full-speed bulk + * endpoints and 512 bytes for high-speed bulk endpoints." + */ + if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER])) + chan->single_command = 1; + + if (chan->single_command != 0) + device_printf(dev, "Single command MIDI quirk enabled\n"); + if ((chan->max_cable > UMIDI_CABLES_MAX) || (chan->max_cable == 0)) { chan->max_cable = UMIDI_CABLES_MAX; |