Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2016 22:26:49 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303346 - head/sys/dev/usb/serial
Message-ID:  <201607262226.u6QMQn15092693@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607262226.u6QMQn15092693>