From owner-svn-src-head@freebsd.org Tue Aug 14 13:52:11 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 96310107898A; Tue, 14 Aug 2018 13:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9E08F62A; Tue, 14 Aug 2018 13:52:11 +0000 (UTC) (envelope-from imp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 162791C6FB; Tue, 14 Aug 2018 13:52:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7EDqAoP001955; Tue, 14 Aug 2018 13:52:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7EDqA6F001954; Tue, 14 Aug 2018 13:52:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808141352.w7EDqA6F001954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 14 Aug 2018 13:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337750 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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:52:11 -0000 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?