From owner-svn-src-all@FreeBSD.ORG Tue Jan 27 19:37:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14BCD106566B; Tue, 27 Jan 2009 19:37:31 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02A948FC21; Tue, 27 Jan 2009 19:37:31 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0RJbUA1094650; Tue, 27 Jan 2009 19:37:30 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0RJbUfY094649; Tue, 27 Jan 2009 19:37:30 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200901271937.n0RJbUfY094649@svn.freebsd.org> From: Nick Hibma Date: Tue, 27 Jan 2009 19:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187780 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2009 19:37:31 -0000 Author: n_hibma Date: Tue Jan 27 19:37:30 2009 New Revision: 187780 URL: http://svn.freebsd.org/changeset/base/187780 Log: 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?). Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Tue Jan 27 19:25:00 2009 (r187779) +++ head/sys/dev/usb/u3g.c Tue Jan 27 19:37:30 2009 (r187780) @@ -108,6 +108,9 @@ static const struct u3g_speeds_s u3g_spe {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;