svn commit: r314500 - stable/11/sys/dev/usb/serial

Ian Lepore ian at FreeBSD.org
Wed Mar 1 18:19:47 UTC 2017


Author: ian
Date: Wed Mar  1 18:19:46 2017
New Revision: 314500
URL: https://svnweb.freebsd.org/changeset/base/314500

Log:
  MFC r303346:
  
   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:
  stable/11/sys/dev/usb/serial/umoscom.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/serial/umoscom.c
==============================================================================
--- stable/11/sys/dev/usb/serial/umoscom.c	Wed Mar  1 18:05:40 2017	(r314499)
+++ stable/11/sys/dev/usb/serial/umoscom.c	Wed Mar  1 18:19:46 2017	(r314500)
@@ -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-all mailing list