diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-03-14 08:42:30 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-03-14 08:42:30 +0000 |
commit | 6bbd5680a4df771c980fdd36dcf78dc9dae915d7 (patch) | |
tree | 8a3b75d06927aee1ad6354b789d7bfa23e6faf3d /sys/dev/sound | |
parent | 7961add611c0111412dc670fa7b7386b3ca135d2 (diff) | |
download | FreeBSD-src-6bbd5680a4df771c980fdd36dcf78dc9dae915d7.zip FreeBSD-src-6bbd5680a4df771c980fdd36dcf78dc9dae915d7.tar.gz |
Workaround for USB MIDI adapters which use non-supported values of
wMaxPacketSize for BULK endpoints.
MFC after: 1 week
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; |