summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2008-06-26 21:00:28 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2008-06-26 21:00:28 +0000
commit53d3daf5ce7529a1629ec3430ce6e27226320032 (patch)
treedc02dc9eebd336cf8f517210a4fea4a2d3fc4c8a
parent547426e1fa649b9016279490b553525e25c0a312 (diff)
Make video stream work properly on uhci and ohci by adding an ohci
isoc xfer workaround. Improved and OK deraadt@
-rw-r--r--sys/dev/usb/uvideo.c11
-rw-r--r--sys/dev/usb/uvideo.h5
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 7449eb25e8c..0623b96d974 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.41 2008/06/23 04:58:00 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.42 2008/06/26 21:00:27 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -1078,7 +1078,14 @@ uvideo_vs_open(struct uvideo_softc *sc)
}
/* calculate optimal isoc xfer size */
- sc->sc_nframes = UVIDEO_SFRAMES_MAX / sc->sc_vs_curr->max_packet_size;
+ if (strncmp(sc->sc_udev->bus->bdev.dv_xname, "ohci", 4) == 0) {
+ /* ohci workaround */
+ sc->sc_nframes = 6400 /
+ sc->sc_vs_curr->max_packet_size;
+ } else {
+ sc->sc_nframes = UGETDW(sc->sc_desc_probe.dwMaxVideoFrameSize) /
+ sc->sc_vs_curr->max_packet_size;
+ }
if (sc->sc_nframes > UVIDEO_NFRAMES_MAX)
sc->sc_nframes = UVIDEO_NFRAMES_MAX;
DPRINTF(1, "%s: nframes=%d\n", DEVNAME(sc), sc->sc_nframes);
diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h
index c9a9e449b94..3ef0a92ca61 100644
--- a/sys/dev/usb/uvideo.h
+++ b/sys/dev/usb/uvideo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.h,v 1.14 2008/06/09 20:51:31 mglocker Exp $ */
+/* $OpenBSD: uvideo.h,v 1.15 2008/06/26 21:00:27 mglocker Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -327,8 +327,7 @@ struct usb_video_frame_mjpeg_desc {
/*
* Driver specific private definitions.
*/
-#define UVIDEO_NFRAMES_MAX 34 /* XXX find optimal value */
-#define UVIDEO_SFRAMES_MAX 6400 /* XXX find optimal value */
+#define UVIDEO_NFRAMES_MAX 40
struct uvideo_vs_iface {
struct uvideo_softc *sc;