From owner-svn-src-head@freebsd.org Tue Aug 14 13:59:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C5A11078E23 for ; Tue, 14 Aug 2018 13:59:07 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 4BF1470038 for ; Tue, 14 Aug 2018 13:59:06 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 309d5c47-9fca-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 309d5c47-9fca-11e8-93fa-f3ebd9db2b94; Tue, 14 Aug 2018 13:58:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7EDwvBs071755; Tue, 14 Aug 2018 07:58:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1534255137.31375.121.camel@freebsd.org> Subject: Re: svn commit: r337750 - head/share/man/man4 From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 14 Aug 2018 07:58:57 -0600 In-Reply-To: <201808141352.w7EDqA6F001954@repo.freebsd.org> References: <201808141352.w7EDqA6F001954@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 13:59:08 -0000 On Tue, 2018-08-14 at 13:52 +0000, Warner Losh wrote: > Author: imp > Date: Tue Aug 14 13:52:10 2018 > New Revision: 337750 > URL: https://svnweb.freebsd.org/changeset/base/337750 > > Log: >   Add good description of init and lock devices from sio to uart. > > Modified: >   head/share/man/man4/uart.4 > > Modified: head/share/man/man4/uart.4 > ===================================================================== > ========= > --- head/share/man/man4/uart.4 Tue Aug 14 13:52:08 2018 > (r337749) > +++ head/share/man/man4/uart.4 Tue Aug 14 13:52:10 2018 > (r337750) > @@ -225,6 +225,52 @@ Generally speaking, a connection to a DB-9 style > conne >  level signal at up to 12 volts. >  A connection to header pins or an edge-connector on an embedded > board >  is typically a TTL signal at 3.3 or 5 volts. > +.Sh Special Devices > +The > +.Nm > +driver also supports an initial-state and a lock-state control > +device for each of the callin and the callout "data" devices. > +The termios settings of a data device are copied > +from those of the corresponding initial-state device > +on first opens and are not inherited from previous opens. > +Use > +.Xr stty 1 > +in the normal way on the initial-state devices to program > +initial termios states suitable for your setup. > +.Pp > +The lock termios state acts as flags to disable changing > +the termios state. > +E.g., to lock a flag variable such as CRTSCTS, use > +.Em stty crtscts > +on the lock-state device. > +Speeds and special characters > +may be locked by setting the corresponding value in the lock-state > +device to any nonzero value. > +E.g., to lock a speed to 115200, use > +.Dq Li stty 115200 > +on the initial-state device and > +.Dq Li stty 1 > +on the lock-state device. > +.Pp > +Correct programs talking to correctly wired external devices > +work with almost arbitrary initial states and almost no locking, > +but other setups may benefit from changing some of the default > +initial state and locking the state. > +In particular, the initial states for non (POSIX) standard flags > +should be set to suit the devices attached and may need to be > +locked to prevent buggy programs from changing them. > +E.g., CRTSCTS should be locked on for devices that support > +RTS/CTS handshaking at all times and off for devices that do not > +support it at all. > +CLOCAL should be locked on for devices that do not support carrier. > +HUPCL may be locked off if you do not > +want to hang up for some reason. > +In general, very bad things happen > +if something is locked to the wrong state, and things should not > +be locked for devices that support more than one setting. > +The CLOCAL flag on callin ports should be locked off for logins > +to avoid certain security holes, but this needs to be done by > +getty if the callin port is used for anything else. >  .Sh FILES >  .Bl -tag -width "/dev/ttyu?.init" -compact >  .It Pa /dev/ttyu? > Now they're documented together with a different single driver of many that supports the feature. This is implemented in the tty layer and applies to all serial drivers, shouldn't it be documented in tty(4)? -- Ian