summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-12-18 19:08:19 +0000
committerthompsa <thompsa@FreeBSD.org>2008-12-18 19:08:19 +0000
commitb439d24ba915e74a0004a88246a8825f0cb8ce4d (patch)
tree125341e90983c124f9d85517f79b0195824f6d6a /sys/dev/usb
parent153773c7cb44ee4f1fe3dc6d34130d58aa4afc91 (diff)
downloadFreeBSD-src-b439d24ba915e74a0004a88246a8825f0cb8ce4d.zip
FreeBSD-src-b439d24ba915e74a0004a88246a8825f0cb8ce4d.tar.gz
Attempt to handoff the entire buffer with ttydisc_rint_bypass() before banging
each char separately.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ucom.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 9f595dd..3c39570 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -706,17 +706,20 @@ ucomrxchars(struct ucom_softc *sc, u_char *cp, u_int32_t cc)
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);
}
OpenPOWER on IntegriCloud