man Pages(7): Special Files
  Search only this book
Download this book in PDF

NAME

asy - asynchronous serial port driver

SYNOPSIS

#include <fcntl.h>
#include <sys/termios.h>
open("/dev/ttynn", mode);
open("/dev/ttydn", mode);
open("/dev/cuan", mode);

AVAILABILITY

x86

DESCRIPTION

The asy module is a loadable STREAMS driver that provides basic support for the standard UARTS that use Intel-8250, National Semiconductor-16450/16550 hardware, together with basic asynchronous communication support. The driver supports those termio (7)device control functions specified by flags in the c_cflag word of the termios structure and by the IGNBRK ,IGNPAR ,PARMRK ,or INPCK flags in the c_iflag word of the termios structure. All other termio (7)functions must be performed by STREAMS modules pushed atop the driver. When a device is opened, the ldterm(7) and ttcompat(7) STREAMS modules are automatically pushed on top of the stream, providing the standard termio (7)interface.
The character-special devices /dev/tty00 and /dev/tty01 are used to access the two standard serial ports (COM1 and COM2) on an x86 system. The asy driver supports up to four serial ports, including the standard ports. These ttynn devices have minor device numbers in the range 00-03.
By convention these same devices may be given names of the form /dev/ttydn, where n denotes which line is to be accessed. Such device names are typically used to provide a logical access point for a dial-in line being used with a modem.
To allow a single tty line to be connected to a modem and used for both incoming and outgoing calls, a special feature, controlled by the minor device number, is available. By accessing character-special devices with names of the form /dev/cuan it is possible to open a port without the Carrier Detect signal being asserted, either through hardware or an equivalent software mechanism. These devices are commonly known as dial-out lines.
Once a /dev/cuan line is opened, the corresponding tty, or ttyd line cannot be opened until the /dev/cuan line is closed; a blocking open will wait until the /dev/cuan line is closed (which will drop Data Terminal Ready, after which Carrier Detect will usually drop as well) and carrier is detected again, and a non-blocking open will return an error. Also, if the /dev/ttydn line has been opened successfully (usually only when carrier is recognized on the modem) the corresponding /dev/cuan line can not be opened. This allows a modem to be attached to, for example, /dev/ttyd0 (renamed from /dev/tty00) and used for dial-in (by enabling the line for login in /etc/inittab) and also used for dialout (by tip(1) or uucp(1C)) as /dev/cua0 when no one is logged in on the line.

IOCTLS

The standard set of termio ioctl( ) calls are supported by asy .
Breaks can be generated by the TCSBRK ,TIOCSBRK ,and TIOCCBRK ioctl( ) calls.
The input and output line speeds may be set to any of the speeds supported by termio . The speeds cannot be set independently; when the output speed is set, the input speed is set to the same speed.

ERRORS

An open( ) will fail if:
ENXIO
The unit being opened does not exist.
EBUSY
The dial-out device is being opened and 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.
EBUSY
The unit has been marked as exclusive-use by another process with a TIOCEXCL ioctl( ) call.
EINTR
The open was interrupted by the delivery of a signal.

FILES

/dev/tty[00-03]
hardwired tty lines
/dev/ttyd[0-3]
dial-in tty lines
/dev/cua[0-3]
dial-out tty lines

SEE ALSO

tip(1), uucp(1C), ldterm(7), termio (7),ttcompat(7)

DIAGNOSTICS

asy n: silo overflow.
The hardware overrun occurred before the input character could be serviced.
asy n: ring buffer overflow.
The driver's character input ring buffer overflowed before it could be serviced.