From owner-svn-src-all@freebsd.org Tue Jul 26 22:26:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66B9ABA6169; Tue, 26 Jul 2016 22:26:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3956116C4; Tue, 26 Jul 2016 22:26:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QMQn9L092694; Tue, 26 Jul 2016 22:26:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QMQn15092693; Tue, 26 Jul 2016 22:26:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201607262226.u6QMQn15092693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 26 Jul 2016 22:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303346 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 22:26:50 -0000 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 */