From owner-svn-src-head@FreeBSD.ORG Thu Dec 18 19:08:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9001065676; Thu, 18 Dec 2008 19:08:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70BF38FC0C; Thu, 18 Dec 2008 19:08:19 +0000 (UTC) (envelope-from thompsa@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 mBIJ8JFm050014; Thu, 18 Dec 2008 19:08:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIJ8J6l050013; Thu, 18 Dec 2008 19:08:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812181908.mBIJ8J6l050013@svn.freebsd.org> From: Andrew Thompson Date: Thu, 18 Dec 2008 19:08:19 +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: r186292 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 19:08:19 -0000 Author: thompsa Date: Thu Dec 18 19:08:19 2008 New Revision: 186292 URL: http://svn.freebsd.org/changeset/base/186292 Log: Attempt to handoff the entire buffer with ttydisc_rint_bypass() before banging each char separately. Modified: head/sys/dev/usb/ucom.c Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Thu Dec 18 18:44:46 2008 (r186291) +++ head/sys/dev/usb/ucom.c Thu Dec 18 19:08:19 2008 (r186292) @@ -706,17 +706,20 @@ ucomrxchars(struct ucom_softc *sc, u_cha struct tty *tp = sc->sc_tty; /* Give characters to tty layer. */ - while (cc > 0) { - DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); - if (ttydisc_rint(tp, *cp, 0) == -1) { - /* XXX what should we do? */ - printf("%s: lost %d chars\n", - device_get_nameunit(sc->sc_dev), cc); - break; + if (ttydisc_can_bypass(tp)) { + DPRINTFN(7, ("ucomreadcb: buf = %*D\n", cc, cp, "")); + cc = ttydisc_rint_bypass(tp, cp, cc); + } else { + while (cc > 0) { + DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); + if (ttydisc_rint(tp, *cp, 0) == -1) + break; + cc--; + cp++; } - cc--; - cp++; } + if (cc > 0) + device_printf(sc->sc_dev, "lost %d chars\n", cc); ttydisc_rint_done(tp); }