Date: Thu, 18 Dec 2008 19:08:19 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186292 - head/sys/dev/usb Message-ID: <200812181908.mBIJ8J6l050013@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812181908.mBIJ8J6l050013>