'\" te .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH asy 7D "9 Oct 2004" "SunOS 5.11" "Devices" .SH NAME asy \- asynchronous serial port driver .SH SYNOPSIS .LP .nf #include .fi .LP .nf #include .fi .LP .nf open("/dev/term/\fIn\fR", \fImode\fR); .fi .LP .nf open("/dev/tty/\fIn\fR", \fImode\fR); .fi .LP .nf open("/dev/cua/\fIn\fR", \fImode\fR); .fi .SH DESCRIPTION .sp .LP The \fBasy\fR module is a loadable STREAMS driver that provides basic support for Intel-8250, National Semiconductor-16450, 16550, and some 16650 and 16750 and equivalent UARTs connected via the ISA-bus, in addition to basic asynchronous communication support. The \fBasy\fR module supports those \fBtermio\fR(7I) device control functions specified by flags in the \fBc_cflag\fR word of the \fBtermios\fR structure, and by the \fBIGNBRK,\fR \fBIGNPAR,\fR \fBPARMRK\fR, \fBINPCK\fR, \fBIXON\fR, \fBIXANY\fR, or \fBIXOFF\fR flags in the c_iflag word of the termios structure. All other \fBtermio\fR(7I) functions must be performed by \fBSTREAMS\fR modules pushed atop the driver. When a device is opened, the \fBldterm\fR(7M) and \fBttcompat\fR(7M) \fBSTREAMS\fR modules are automatically pushed on top of the stream, providing the standard \fBtermio\fR(7I) interface. .sp .LP The character-special devices \fB/dev/term/a\fR, \fB/dev/term/b\fR, \fB/dev/term/c\fR and \fB/dev/term/d\fR are used to access the four standard serial ports (COM1, COM2, COM3 and COM4 at I/O addresses 3f8, 2f8, 3e8 and 2e8 respectively). Serial ports on non-standard ISA-bus I/O addresses are accessed via the character-special devices \fB/dev/term/0\fR, \fB/dev/term/1\fR, etc. Device names are typically used to provide a logical access point for a dial-in line that is used with a modem. .sp .LP To allow a single tty line to be connected to a modem and used for incoming and outgoing calls, a special feature is available that is controlled by the minor device number. By accessing character-special devices with names of the form \fB/dev/cua/\fR\fIn, \fR it is possible to open a port without the \fBCarrier Detect\fR signal being asserted, either through hardware or an equivalent software mechanism. These devices are commonly known as dial-out lines. .LP Note - .sp .RS 2 This module is affected by the setting of certain eeprom variables, ttya-ignore-cd and ttya-rts-dtr-off (and similarly for ttyb-, ttyc-, and ttyd- parameters). For information on these parameters, see the \fBeeprom\fR(1M) man page. .RE .LP Note - .sp .RS 2 For serial ports on the standard COM1 to COM4 I/O addresses above, the default setting for ttya-ignore-cd and ttya-rts-dtr-off is true. If any of these ports are connected to a modem, these settings should be changed to false. For serial ports on non-standard I/O addresses, the default setting for ttya-ignore-cd and ttya-rts-dtr-off is false. .RE .SH APPLICATION PROGRAMMING INTERFACE .sp .LP Once a \fB/dev/cua/\fR\fIn\fR line is opened, the corresponding tty line cannot be opened until the \fB/dev/cua/\fR\fIn\fR line is closed. A blocking open will wait until the \fB/dev/cua/\fR\fIn\fR line is closed (which will drop \fBData Terminal Ready\fR, after which \fBCarrier Detect\fR will usually drop as well) and carrier is detected again. A non-blocking open will return an error. If the \fB/dev/ttyd\fR\fIn\fR line has been opened successfully (usually only when carrier is recognized on the modem), the corresponding \fB/dev/cua/\fR\fIn\fR line cannot be opened. This allows a modem to be attached to \fB/dev/term/\fR[\fIn\fR] (renamed from \fB/dev/tty\fR[\fIn\fR]) and used for dial-in (by enabling the line for login in \fB/etc/inittab\fR) or dial-out (by \fBtip\fR(1) or \fBuucp\fR(1C)) as \fB/dev/cua/\fR\fIn\fR when no one is logged in on the line. .SH IOCTLS .sp .LP The standard set of \fBtermio\fR \fBioctl()\fR calls are supported by \fBasy\fR. .sp .LP Breaks can be generated by the \fBTCSBRK,\fR \fBTIOCSBRK,\fR and \fBTIOCCBRK\fR \fBioctl()\fR calls. .sp .LP The input and output line speeds may be set to any speed that is supported by \fBtermio\fR. The speeds cannot be set independently; for example, when the output speed is set, the input speed is automatically set to the same speed. .sp .LP When the \fBasy\fR module is used to service the serial console port, it supports a BREAK condition that allows the system to enter the debugger or the monitor. The BREAK condition is generated by hardware and it is usually enabled by default. .sp .LP A BREAK condition originating from erroneous electrical signals cannot be distinguished from one deliberately sent by remote DCE. The Alternate Break sequence can be used as a remedy against this. Due to a risk of incorrect sequence interpretation, SLIP and certain other binary protocols should not be run over the serial console port when Alternate Break sequence is in effect. Although PPP is a binary protocol, it is able to avoid these sequences using the ACCM feature in \fIRFC 1662\fR. For Solaris PPP 4.0, you do this by adding the following line to the \fB/etc/ppp/options\fR file (or other configuration files used for the connection; see \fBpppd\fR(1M) for details): .sp .in +2 .nf asyncmap 0x00002000 .fi .in -2 .sp .LP By default, the Alternate Break sequence is a three character sequence: carriage return, tilde and control-B (CR ~ CTRL-B), but may be changed by the driver. For more information on breaking (entering the debugger or monitor), see \fBkbd\fR(1) and \fBkb\fR(7M). .SH ERRORS .sp .LP An \fBopen()\fR will fail under the following conditions: .sp .ne 2 .mk .na \fB\fBENXIO\fR\fR .ad .RS 9n .rt The unit being opened does not exist. .RE .sp .ne 2 .mk .na \fB\fBEBUSY\fR\fR .ad .RS 9n .rt The dial-out device is being opened while the dial-in device is already open, or the dial-in device is being opened with a no-delay open and the dial-out device is already open. .RE .sp .ne 2 .mk .na \fB\fBEBUSY\fR\fR .ad .RS 9n .rt The unit has been marked as exclusive-use by another process with a \fBTIOCEXCL\fR \fBioctl()\fR call. .RE .sp .ne 2 .mk .na \fB\fBEINTR\fR\fR .ad .RS 9n .rt The open was interrupted by the delivery of a signal. .RE .SH FILES .sp .ne 2 .mk .na \fB\fB/dev/term/\fR[\fIa-d\fR]\fR .ad .br .na \fB\fB/dev/term/\fR[\fI012...\fR]\fR .ad .RS 25n .rt dial-in tty lines .RE .sp .ne 2 .mk .na \fB\fB/dev/cua/\fR[\fIa-d\fR]\fR .ad .br .na \fB\fB/dev/cua/\fR[\fI012...\fR]\fR .ad .RS 25n .rt dial-out tty lines .RE .sp .ne 2 .mk .na \fB\fB/kernel/drv/amd64/asy\fR\fR .ad .RS 25n .rt 64-bit kernel module for 64-bit x86 platform .RE .sp .ne 2 .mk .na \fB\fB/kernel/drv/asy.conf\fR\fR .ad .RS 25n .rt \fBasy\fR configuration file .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Architecturex86 .TE .SH SEE ALSO .sp .LP \fBtip\fR(1), \fBkbd\fR(1), \fBuucp\fR(1C), \fBeeprom\fR(1M), \fBpppd\fR(1M), \fBioctl\fR(2), \fBopen\fR(2), \fBtermios\fR(3C), \fBattributes\fR(5), \fBldterm\fR(7M), \fBttcompat\fR(7M), \fBkb\fR(7M), \fBtermio\fR(7I) .SH DIAGNOSTICS .sp .ne 2 .mk .na \fB\fBasy\fR\fIn\fR\fB\|: silo overflow.\fR\fR .ad .sp .6 .RS 4n The hardware overrun occurred before the input character could be serviced. .RE .sp .ne 2 .mk .na \fB\fBasy\fR\fIn\fR\fB\|: ring buffer overflow.\fR\fR .ad .sp .6 .RS 4n The driver's character input ring buffer overflowed before it could be serviced. .RE