diff options
author | hselasky <hselasky@FreeBSD.org> | 2010-10-14 21:45:41 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2010-10-14 21:45:41 +0000 |
commit | d6c8505c8726e52a33070dba24c533bf2d8d18c7 (patch) | |
tree | f7aab80e6c7b0f5a05348d405125c43235387a23 /sys | |
parent | 505e0120bfc950095feca15ce1c099dad7c4b8ee (diff) | |
download | FreeBSD-src-d6c8505c8726e52a33070dba24c533bf2d8d18c7.zip FreeBSD-src-d6c8505c8726e52a33070dba24c533bf2d8d18c7.tar.gz |
Fix forwarding of Line Register Status changes to TTY layer.
PR: usb/149675
Approved by: thompsa (mentor)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/serial/usb_serial.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index 6573d8e..5404bd8 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -942,6 +942,7 @@ ucom_cfg_status_change(struct usb_proc_msg *_task) uint8_t new_msr; uint8_t new_lsr; uint8_t onoff; + uint8_t lsr_delta; tp = sc->sc_tty; @@ -965,6 +966,7 @@ ucom_cfg_status_change(struct usb_proc_msg *_task) return; } onoff = ((sc->sc_msr ^ new_msr) & SER_DCD); + lsr_delta = (sc->sc_lsr ^ new_lsr); sc->sc_msr = new_msr; sc->sc_lsr = new_lsr; @@ -977,6 +979,30 @@ ucom_cfg_status_change(struct usb_proc_msg *_task) ttydisc_modem(tp, onoff); } + + if ((lsr_delta & ULSR_BI) && (sc->sc_lsr & ULSR_BI)) { + + DPRINTF("BREAK detected\n"); + + ttydisc_rint(tp, 0, TRE_BREAK); + ttydisc_rint_done(tp); + } + + if ((lsr_delta & ULSR_FE) && (sc->sc_lsr & ULSR_FE)) { + + DPRINTF("Frame error detected\n"); + + ttydisc_rint(tp, 0, TRE_FRAMING); + ttydisc_rint_done(tp); + } + + if ((lsr_delta & ULSR_PE) && (sc->sc_lsr & ULSR_PE)) { + + DPRINTF("Parity error detected\n"); + + ttydisc_rint(tp, 0, TRE_PARITY); + ttydisc_rint_done(tp); + } } void |