SCN(4)

NAME
scn - Signetics DUART serial communications interface

SYNOPSIS
scn0 at mainbus? flags 0x1
scn1 at mainbus? flags 0x0
scn2 at mainbus? flags 0x0
scn3 at mainbus? flags 0x0
scn4 at mainbus? flags 0x0
scn5 at mainbus? flags 0x0
scn6 at mainbus? flags 0x0
scn7 at mainbus? flags 0x0

DESCRIPTION
The scn driver provides support for Signetics SCN2681, SCN2692, and SC26C92 EIA RS-232C (CCITT V.28) DUARTs on the pc532. The MC68681 DUART and SCC2698 OCTART are similar. The SCN2681 and SCN2692 have 3 character FIFOs; the SC26C92 has a 16-character FIFO.

Separate speeds for input and output are supported on each line. The SCN2681 and SCN2692 baud rate generator (BRG) supports the following speeds: 50, 75, 110, 134.5, 150, 200, 300, 600, 1050, 1200, 1800, 2000, 2400, 4800, 7200, 9600, 19200, and 38400 bits per second. However, because the BRG table has two separate columns of 16 speeds, and the table in use is shared between the input and output sides of the two channels, not all speeds are available at all times. The Counter/Timer will be used, when available to generate additional, arbitrary speeds up to 57600 bps but only one C/T is present in each DUART.

The SC26C92 DUART adds two additional BRG modes (each containing two 16 entry tables with two columns) supporting additional speeds of 450, 880, 900, 1076, 3600, 14400, 28800, 57600, 115200, and 230400 bits per second (as well as some of the speeds listed above).

Attempts to open(2) tty0? (dial-in) devices will block for the presence of Carrier Detect (DCD) and are generally used by getty(8).

Attempts to open(2) cu0? (callout) devices will succeed when Carrier Detect (DCD) is not present and are meant for use for dialing out on a modem (for pppd(8), tip(1), kermit, etc). When the dial-in device is in use, attempts to open(2) callout device will fail with EBUSY.

When the callout device is in use, dial-in device opens with O_NONBLOCK will fail with EBUSY. Other opens will block until the line is available.

An optional config file argument flags is supported with the following valued OR-ed together;

0x1 Sets software carrier (SOFTCAR); The line will be treated as hard-wired, with Carrier Detect (DCD) always present. DTR is not dropped on close(2).

0x2 Sets local line (CLOCAL). Opens will not block for Carrier Detect (DCD).

0x4 Sets RTS/CTS hardware flow control (CRTSCTS).

0x8 Sets DTR/DCD hardware flow control (MDMBUF). [Not yet implemented].

Various config options exist for the scn driver;

options SCN_TIMING
    Keep information on latency from time of character input in special rxintr routine to time of soft interrupt.

options CONSOLE_SPEED=Bnnn
    Sets console speed independent of default speed for other ttys.

options SCNDEF_CFLAG="CREAD+CS8+HUPCL"
    Sets default flags for scn tty lines.

FILES

/dev/tty0?

/dev/cu0?

DIAGNOSTICS

scn%d: fifo overrun The hardware FIFO in the chip has been overrun.

scn%d: ring overrun The internal ring-buffer used to hold characters until a software interrupt service routine runs to process the characters has overflowed.

SEE ALSO
termios(4), tty(4)

HISTORY
The scn driver first appeared in NetBSD 0.9. Original version by Philip Nelson (starting with Minix driver by Philip Nelson), majorly mangled by Phil Budne (using ideas and code from Dave Rand and Chris Torek). Improvements by Ian Dall and Matthias Pfaller.

BUGS
Configuration should be done on two levels: DUARTs and TTYs.

DUART configuration should take duart address in I/O region.

TTY configuration should take duart, port number and flags.

Some sequences of default tty speeds, opening ports and setting speeds may work, while others may not, due to the limitations of the chips.

The driver should reset SC26C92's to mode 0 on shutdown since the pc532 monitor PROM does not know about the additional BRG modes.

The SOFTCAR flag forced on for the console line.