summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2009-01-27 19:37:30 +0000
committern_hibma <n_hibma@FreeBSD.org>2009-01-27 19:37:30 +0000
commit1390224b8b49d352c41b4718b41ab0d285cf7404 (patch)
tree754a16010dd893fbc77e3bd098f70109b4d46d0e /sys/dev/usb
parent66a879082d57194a36c70600d6cc8a3c18040509 (diff)
downloadFreeBSD-src-1390224b8b49d352c41b4718b41ab0d285cf7404.zip
FreeBSD-src-1390224b8b49d352c41b4718b41ab0d285cf7404.tar.gz
Fix the input buffer at 1024. The previous calculated buffer size
exceeded the maximum size of 1 page for OHCI controllers. Other serial drivers use the same size, so I assume this should be enough (1MB/s throughput?).
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/u3g.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/usb/u3g.c b/sys/dev/usb/u3g.c
index 67722a9..366337b 100644
--- a/sys/dev/usb/u3g.c
+++ b/sys/dev/usb/u3g.c
@@ -108,6 +108,9 @@ static const struct u3g_speeds_s u3g_speeds[] = {
{7200000, 384000},
};
+#define U3GIBUFSIZE 1024
+#define U3GOBUFSIZE 1024
+
/*
* Various supported device vendors/products.
*/
@@ -296,10 +299,9 @@ u3g_attach(device_t self)
ucom->sc_iface = uaa->ifaces[i];
ucom->sc_bulkin_no = bulkin_no;
ucom->sc_bulkout_no = bulkout_no;
- // Allocate a buffer enough for 10ms worth of data
- ucom->sc_ibufsize = u3g_speeds[sc->sc_speed].ispeed/10/USB_FRAMES_PER_SECOND*10;
- ucom->sc_ibufsizepad = ucom->sc_ibufsize;
- ucom->sc_obufsize = u3g_speeds[sc->sc_speed].ospeed/10/USB_FRAMES_PER_SECOND*10;
+ ucom->sc_ibufsize = U3GIBUFSIZE;
+ ucom->sc_ibufsizepad = U3GIBUFSIZE;
+ ucom->sc_obufsize = U3GOBUFSIZE;
ucom->sc_opkthdrlen = 0;
ucom->sc_callback = &u3g_callback;
@@ -362,7 +364,6 @@ u3g_open(void *addr, int portno)
* anyway.
* Note: We abuse the fact that ucom sets the speed through
* ispeed/ospeed, not through ispeedwat/ospeedwat.
- * XXX Are the speeds correct?
*/
if (portno == 0) {
struct u3g_softc *sc = addr;
OpenPOWER on IntegriCloud