summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-15 05:48:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-15 05:48:10 +0000
commite02f33c17583951524a9ea1674d1ad7a85f6506b (patch)
treed0386db425dea045812a2840cb6eeede194d8f11
parentd4a94683b0a8c2972b69426aa681af6484125c80 (diff)
from netbsd via dlg, umass.c revision 1.97:
Well, this is bloody obscure... My Imation USB FlashGO! adapter responds to a Get Max Lun request with a stall. With uhci, this does the expected thing. With ohci, it was returning a "data underrun" error because we weren't setting "buffer rounding" (i.e. USBD_SHORT_XFER_OK), and the underrun was taking priority. This happened with both the ohci in a Mac cube and the builtin ohci on the S3C2410. So, set USBD_SHORT_XFER_OK on the Get Max Lun. Now I get a stall reported and umass attaches correctly.
-rw-r--r--sys/dev/usb/umass.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 65db9de25d7..46dd6d6b93f 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: umass.c,v 1.26 2004/06/08 00:24:13 krw Exp $ */
-/* $NetBSD: umass.c,v 1.96 2003/04/26 12:46:59 dsainty Exp $ */
+/* $OpenBSD: umass.c,v 1.27 2004/07/15 05:48:09 deraadt Exp $ */
+/* $NetBSD: umass.c,v 1.97 2003/09/04 00:02:59 mycroft Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
* Nick Hibma <n_hibma@freebsd.org>
@@ -1675,7 +1675,8 @@ umass_bbb_get_max_lun(struct umass_softc *sc, u_int8_t *maxlun)
USETW(req.wIndex, sc->sc_ifaceno);
USETW(req.wLength, 1);
- err = usbd_do_request(sc->sc_udev, &req, maxlun);
+ err = usbd_do_request_flags(sc->sc_udev, &req, maxlun,
+ USBD_SHORT_XFER_OK, 0, USBD_DEFAULT_TIMEOUT);
switch (err) {
case USBD_NORMAL_COMPLETION:
DPRINTF(UDMASS_BBB, ("%s: Max Lun %d\n",