svn commit: r303346 - head/sys/dev/usb/serial

Ian Lepore ian at FreeBSD.org
Tue Jul 26 22:26:50 UTC 2016


Author: ian
Date: Tue Jul 26 22:26:49 2016
New Revision: 303346
URL: https://svnweb.freebsd.org/changeset/base/303346

Log:
  Actually return line status register values from umoscom_cfg_get_status().
  
  The hardware delivers ns16550-compatible status bits, which is what the
  usb_serial code expects, so no need for translation, no need for a local
  variable to hold a temporary lsr result.

Modified:
  head/sys/dev/usb/serial/umoscom.c

Modified: head/sys/dev/usb/serial/umoscom.c
==============================================================================
--- head/sys/dev/usb/serial/umoscom.c	Tue Jul 26 21:27:02 2016	(r303345)
+++ head/sys/dev/usb/serial/umoscom.c	Tue Jul 26 22:26:49 2016	(r303346)
@@ -523,14 +523,16 @@ static void
 umoscom_cfg_get_status(struct ucom_softc *ucom, uint8_t *p_lsr, uint8_t *p_msr)
 {
 	struct umoscom_softc *sc = ucom->sc_parent;
-	uint8_t lsr;
 	uint8_t msr;
 
 	DPRINTFN(5, "\n");
 
-	/* read status registers */
+	/*
+	 * Read status registers.  MSR bits need translation from ns16550 to
+	 * SER_* values.  LSR bits are ns16550 in hardware and ucom.
+	 */
 
-	lsr = umoscom_cfg_read(sc, UMOSCOM_LSR);
+	*p_lsr = umoscom_cfg_read(sc, UMOSCOM_LSR);
 	msr = umoscom_cfg_read(sc, UMOSCOM_MSR);
 
 	/* translate bits */


More information about the svn-src-head mailing list