PERFORCE change 182430 for review

Hans Petter Selasky hselasky at FreeBSD.org
Sun Aug 15 17:48:42 UTC 2010


http://p4web.freebsd.org/@@182430?ac=10

Change 182430 by hselasky at hselasky_laptop001 on 2010/08/15 17:47:47

	USB serial:
		- fix forwarding of Line Register Status changes to TTY layer.
	
	PR:		usb/149675

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/serial/usb_serial.c#19 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/serial/usb_serial.c#19 (text+ko) ====

@@ -942,6 +942,7 @@
 	uint8_t new_msr;
 	uint8_t new_lsr;
 	uint8_t onoff;
+	uint8_t lsr_delta;
 
 	tp = sc->sc_tty;
 
@@ -965,6 +966,7 @@
 		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,27 @@
 
 		ttydisc_modem(tp, onoff);
 	}
+
+	if ((lsr_delta & ULSR_BI) && (sc->sc_lsr & ULSR_BI)) {
+
+		DPRINTF("BREAK detected\n");
+
+		ttydisc_rint(tp, 0, TRE_BREAK);
+	}
+
+	if ((lsr_delta & ULSR_FE) && (sc->sc_lsr & ULSR_FE)) {
+
+		DPRINTF("Frame error detected\n");
+
+		ttydisc_rint(tp, 0, TRE_FRAMING);
+	}
+
+	if ((lsr_delta & ULSR_PE) && (sc->sc_lsr & ULSR_PE)) {
+
+		DPRINTF("Parity error detected\n");
+
+		ttydisc_rint(tp, 0, TRE_PARITY);
+	}
 }
 
 void


More information about the p4-projects mailing list