X fas - asynchronous serial character device driver
X
X DESCRIPTION
X _F_A_S, which is an acronym for _Final _Async _Solution, is a
X "dumb"-port character device driver for 286/386 based UNIX
X systems that adds several features that are often not pro-
X vided by vendors drivers.
X
X It supports
X
X - the _N_S_1_6_4_5_0 and _u_m_8_2_4_5_0 UART chips.
X - the _N_S_1_6_5_5_0_A and _i_8_2_5_1_0 UART chips in FIFO mode.
X - up to 115200 bps with _N_S_1_6_5_5_0_A.
X - built-in modem line sharing for dialin and dialout.
X - modem control on both dialin and dialout devices.
X - full and half duplex hardware flow control.
X - concurrent hardware and software (XON/XOFF) flow control.
X - shared interrupts.
X - multiplexed UART registers (_H_U_B-_6 card etc.).
X - any mix of up to 16 UARTs.
X - any I/O address, any IRQ.
X - _V_P/_i_x, the ISC DOS emulator.
X
X _F_A_S was successfully tested under the following operating
X systems:
X
X ISC UNIX 2.0.2 and later
X SCO UNIX 3.2.2 and later
X SCO XENIX 286 2.3.2 and later
X SCO XENIX 386 2.3.2 and later
X Microport SVR3.0
X ESIX SVR3.2 Rev. C & D
X Bell Tech/Intel SVR3.2
X AT&T SVR3.2 V 2.1
X SVR4.0 (with tty compatibility drivers)
X
X This driver should work with most of the UNIX SVR[34].x fla-
X vors currently available. You can have both this and the
X original vendor driver in the same kernel (if you really
X like to, but I wouldn't know why). Each driver controls its
X own separate set of serial ports. The only restriction here
X is that each interrupt vector must not be used by more than
X one of the drivers. The kernel config program will complain
X otherwise.
X
X WHICH SERIAL CARDS ARE SUPPORTED ?
X _F_A_S supports and has been tested on many async serial
X "dumb"-port cards. It can handle most combinations of
X shared interrupts. The current version can be used with
X _N_S_1_6_4_5_0, _N_S_1_6_5_5_0_A, _u_m_8_2_4_5_0 and _i_8_2_5_1_0 UARTs. _8_2_5_0 chips are
X not supported due to various bugs and speed problems in
X these parts. They have no place in any 286/386 or other
X
X
X Rev. Release 2.11.0 Page 1
X
X
X
X
X
X
X FAS(7) UNIX System V FAS(7)
X
X
X
X high performance system. Replace them with one of the sup-
X ported chips. They are pin-to-pin compatible.
X
X IMPORTANT: Don't use _N_S_1_6_5_5_0 (without the trailing AAAA) or any
X chips from a second source manufacturer! They
X have a reputation of being buggy and might not
X work with _F_A_S. Some aren't even recognized by
X the FIFO auto-detect code in _F_A_S. The quality of
X the second source chips might have improved
X lately but there is no way to know for sure.
X Therefore, even if they are cheaper, don't buy
X them.
X
X Take a look at the _s_p_a_c_e-* files for details on how to set
X up for various devices. Sample config files are provided
X for the following cards:
X
X *-_a_s_t_4_c_1_2 _A_S_T 4-port card plus COM1 and COM2
X *-_a_s_t_8_c_1_2 Two _A_S_T 4-port cards plus COM1 and COM2
X *-_c_1_2_3 COM1, COM2 and COM3
X *-_g_e_n_8_c_1_2 Generic 8-port card plus COM1 and COM2 (you can
X use these files for the _D_i_g_i_C_h_a_n_n_e_l _P_C/_8,
X _A_P_T _H_S_S_0_8, _H_o_s_t_e_s_s, _B_o_c_a and _A_r_n_e_t 8-port cards)
X *-_h_u_b_6_c_1_2 _B_e_l_l _T_e_c_h _H_U_B-_6 card plus COM1 and COM2
X *-_u_s_e_4_c_1_2 _U_S_E_N_E_T _I_I 4-port card plus COM1 and COM2
X
X Internal modems are also supported. Some of them, however,
X use a UART emulation instead of a genuine UART chip. These
X types of internal modems usually don't pass the UART test at
X boot time. Therefore, you may want to set the NNNNOOOO____TTTTEEEESSSSTTTT flag
X in the _f_a_s__m_o_d_i_f_y[] array (_s_p_a_c_e._c) to skip the UART test.
X On the other hand, most of the internal modems with a UART
X emulation have a receiver overrun protection so that charac-
X ters can't be lost at high baud rates. For these modems, it
X is advisable to set the NNNNOOOO____OOOOVVVVEEEERRRRRRRRUUUUNNNN flag in the _f_a_s__m_o_d_i_f_y[]
X array (_s_p_a_c_e._c). If an internal modem with overrun protec-
X tion emulates an _N_S_1_6_5_5_0_A UART, you should additionally use
X the FFFFIIIIFFFFOOOO____TTTTRRRRIIIIGGGGGGGGEEEERRRR____11114444 symbol in the _f_a_s__f_i_f_o__c_t_l[] array
X (_s_p_a_c_e._c). This sets the receiver FIFO size to the highest
X possible trigger level in order to reduce the interrupt fre-
X quency. Please refer to the sections MMMMOOOODDDDIIIIFFFFYYYYIIIINNNNGGGG AAAA PPPPOOOORRRRTTTT''''SSSS
X DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBEEEEHHHHAAAAVVVVIIIIOOOOUUUURRRR and UUUUAAAARRRRTTTT FFFFIIIIFFFFOOOO CCCCOOOONNNNTTTTRRRROOOOLLLL for further details.
X
X There are serial cards on the market that emulate an
X _N_S_1_6_5_5_0_A UART and have receiver overrun protection due to an
X additional character buffer. They look like an ordinary COM
X port from the software side but have their own CPU, RAM, ROM
X etc. on-board. The special considerations for internal
X modems pointed out above apply to these serial cards as
X well. One example is the _Q_u_e_u_e_C_O_M-_1_1_5 card for which you
X should set the NNNNOOOO____TTTTEEEESSSSTTTT and NNNNOOOO____OOOOVVVVEEEERRRRRRRRUUUUNNNN flags and use the
X FFFFIIIIFFFFOOOO____TTTTRRRRIIIIGGGGGGGGEEEERRRR____11114444 symbol.
X
X
X
X Rev. Release 2.11.0 Page 2
X
X
X
X
X
X
X FAS(7) UNIX System V FAS(7)
X
X
X
X BOOT TIME STATUS MESSAGE
X At boot time you will see a status message on the screen
X with symbols that show the init state of each port. The
X symbols are as follows:
X
X ---- not defined in the _f_a_s__p_o_r_t[] array
X ???? can't initialize port
X 1111-9999 error during UART test phase indicated by number
X !!!! configuration error (check _s_p_a_c_e._c and _f_a_s._h)
X **** port is initialized (_N_S_1_6_4_5_0)
X ++++ port is initialized and has FIFOs forced off
X ffff port is initialized and has FIFOs (_i_8_2_5_1_0)
X FFFF port is initialized and has FIFOs (_N_S_1_6_5_5_0_A)
X
X This is convenient to check whether you have entered the
X proper port base addresses in _s_p_a_c_e._c.
X
X SHARED INTERRUPTS
X Many multi-port cards have jumpers or dip switches that let
X you assign more than one port to the same interrupt (IRQ)
X line. This alone is nnnnoooo guaranty that they really support
X shared interrupts! These cards may be designed for the DOS
X world where you may want two or more serial ports but don't
X need to run them concurrently, that is, no more than one of
X those ports assigned to the same IRQ line is allowed to be
X in use at a time. For DOS this is sufficient as DOS is no
X multitasking operating system. For UNIX this won't work
X because in the worst case all serial ports may be in use at
X the same time.
X
X The basic problem is that the PC (and AT) I/O bus can't han-
X dle shared interrupts itself. This is due to a brain-dead
X hardware design. Therefore, there must be some special
X logic on the serial card to provide shared interrupts. And
X those cards are quite rare (and usually more expensive).
X
X Therefore, you have the choice to give every port on the
X card its own IRQ line or to buy a multi-port card that
X really has shared interrupts. But in the latter case you
X better ask your vendor twice to make sure that it has this
X functionality because from the card's manuals it often isn't
X obvious which type of card it is. One well-known shared
X interrupts card is the _A_S_T 4-port card. There are many com-
X patible clones available that are usually much cheaper than
X the original. You can even buy _A_S_T compatible 8-port cards
X where two _A_S_T 4-port blocks are on the same board.
X
X DIALIN/DIALOUT ON THE SAME PORT
X This driver supports shared line usage by having two logical
X devices sharing one physical device. Each logical device
X has its own name.
X
X For example, for the first port the names are ttttttttyyyyFFFF00000000 (minor
X
X
X Rev. Release 2.11.0 Page 3
X
X
X
X
X
X
X FAS(7) UNIX System V FAS(7)
X
X
X
X device 0000) and ttttttttyyyyFFFFMMMM00000000 (minor device 111199992222). The ttttttttyyyyFFFF00000000 device
X is used for _c_u, _k_e_r_m_i_t, _u_u_c_i_c_o and other programs that want
X to dial out. It ignores the modem signals and therefore
X doesn't care about whether the modem provides the carrier
X detect signal or not. The ttttttttyyyyFFFFMMMM00000000 device, on the other
X hand, is strictly for dialin processes, usually _g_e_t_t_y.
X
X When _g_e_t_t_y opens ttttttttyyyyFFFFMMMM00000000 the driver blocks the _o_p_e_n(2|S)
X call until the modem asserts the carrier detect signal and
X then lets the open complete. If _c_u opens ttttttttyyyyFFFF00000000 while _g_e_t_t_y
X is waiting for its own open to complete the device is given
X to _c_u and the _g_e_t_t_y open must wait for _c_u to finish and will
X then wait for the carrier, again.
X
X If _c_u tries to open the ttttttttyyyyFFFF00000000 device while _g_e_t_t_y has
X ttttttttyyyyFFFFMMMM00000000 open _c_u will get an EBUSY error. If _g_e_t_t_y tries to
X open ttttttttyyyyFFFFMMMM00000000 while _c_u has ttttttttyyyyFFFF00000000 open the _g_e_t_t_y open will
X just block and wait for _c_u to close the device and will then
X wait for the carrier.
X
X So in short, you should put up a _g_e_t_t_y on ttttttttyyyyFFFFMMMM00000000 with a
X `-t 60' and use ttttttttyyyyFFFF00000000 for _c_u, _u_u_c_i_c_o and other dialout pro-
X grams.
X
X Note: In the description above the rrrreeeeaaaallll _g_e_t_t_y is meant.
X With _F_A_S you don't need hacks like _u_u_g_e_t_t_y to dial in
X and out on the same port.
X
X OPERATING MODES AND MINOR DEVICE NUMBERS
X In the example in the previous section ttttttttyyyyFFFF00000000 had a minor
X device number of 0000 and ttttttttyyyyFFFFMMMM00000000 one of 111199992222. But there are
X several other possible minor device numbers for each port.
X
X The higher four bits of the 8-bit minor device number con-
X trol the operating mode of the device. A physical device
X can't be opened with two or more different minor device
X numbers at the same time.
X
X Minor device numbers are built according to the following
X description:
X
X Bitmap: _m _m _f _f _x _x _x _x
X
X _m _m are the mode bits as follows:
X
X 0 0 This is a dialout device. The carrier signal is
X totally ignored. With carrier high->low nnnnoooo SIGHUP
X signal is generated. The device does nnnnooootttt block on
X open if there is no carrier.
X
X 0 1 This is a dialout device. After an initial open,
X the actual carrier is ignored and is assumed to be
X present. However, as soon as there is a low->high
X
X
X Rev. Release 2.11.0 Page 4
X
X
X
X
X
X
X FAS(7) UNIX System V FAS(7)
X
X
X
X carrier transition, this device switches to carrier
X controlled behaviour until the last process has
X closed the device. This includes sending a SIGHUP
X signal on carrier loss.
X
X Note that after a carrier loss an _i_o_c_t_l(2|S) call
X with a TCSETA* command that sets and again clears
X the CLOCAL flag resets the device to ignore the
X actual carrier again and to assume that it is
X present until the next carrier low->high. Then the
X device switches to the carrier controlled mode,
X again. Without this command sequence the device
X would ignore the actual carrier and assume that it
X is missing after the first carrier loss.
X
X Additionally, after the carrier loss, as long as
X the carrier is ignored and assumed to be missing,
X the modem enable output is held low to prevent the
X modem from answering calls. The device does nnnnooootttt
X block on open if there is no carrier.
X
X 1 0 This is a dialin device. It is carrier controlled
X and blocks on open if there is no carrier.
X
X Note that after a carrier loss an _i_o_c_t_l(2|S) call
X with a TCSETA* command that sets and again clears
X the CLOCAL flag reactivates the device if there is
X a carrier present at this time. Without this com-
X mand sequence the device would ignore the actual
X carrier and assume that it is missing after the
X first carrier loss.
X
X Additionally, after the carrier loss, as long as
X the carrier is ignored and assumed to be missing,
X the modem enable output is held low to prevent the
X modem from answering calls.
X
X 1 1 This is a dialin device. Same as mode `1 0', but a
X parallel non-blocking dialout open is possible
X while waiting for carrier.
X
X _f _f are the hardware flow control bits as follows:
X
X 0 0 The RTSFLOW, CTSFLOW, CRTSFL and ORTSFL _t_e_r_m_i_o(M)
X flags (if available) enable half duplex (for output
X direction, only) or full duplex (for input and out-
X put direction) hardware flow control according to
X SCO's specifications. If these flags are not
X available no hardware flow control is used by this
X device.
X
X 0 1 The device uses full duplex hardware flow control
X (for input and output direction).
X
X
X Rev. Release 2.11.0 Page 5
X
X
X
X
X
X
X FAS(7) UNIX System V FAS(7)
X
X
X
X 1 0 The device uses half duplex hardware flow control
X (for output direction, only).
X
X 1 1 Same as mode `1 0', but additionally the output
X buffer state is signaled to the connected device.
X
X Refer to the _s_p_a_c_e._c and _f_a_s._h files to determine which
X port signals are actually used for modem and hardware
X flow control.
X
X _x _x _x _x
X This is the physical device number. _F_A_S supports
X up to 16 ports. If you need more, you should use
X an "intelligent" serial card because more than 16
X devices will eat up too much CPU time with this
X "dumb"-port approach.
X
X In a configuration with _n UARTs the valid device
X number range would be 0 to _n-1. The device number
X is an index into the _f_a_s__p_o_r_t[] etc. arrays in
X _s_p_a_c_e._c. Trying to open an unconfigured and there-
X fore invalid device gives an ENXIO error.
X
X Note: If a device is carrier controlled, this implies the
X generation of a SIGHUP signal with every carrier
X high->low. This is of course only true if the CLOCAL
X flag is nnnnooootttt set.
X
X On my own system I prefer a minor device number of
X 0000111100001111xxxxxxxxxxxxxxxx (88880000 + device #) for the non-blocking tty
X nodes and 1111111100001111xxxxxxxxxxxxxxxx (222200008888 + device #) for the blocking
X tty nodes. This gives me the SIGHUP signal on carrier
X loss and full duplex hardware flow control on both
X logical devices. Dialout while a dialin open is wait-
X ing for the carrier is also possible with this setup.
X These numbers are the defaults in the _n__f_a_s-* sample
X files.
X
X HARDWARE FLOW CONTROL
X _F_A_S supports both full and half duplex hardware flow con-
X trol, using the RS232C RRRRTTTTSSSS/CCCCTTTTSSSS control lines (by default).
X
X Full duplex flow control is a method to control character
X flow in both input and output directions while in half
X duplex flow control mode only the output direction is con-
X trolled.
X
X You can select between full and half duplex flow control via
X the minor device number of the device. In full duplex mode
X the RRRRTTTTSSSS line controls the input direction and the CCCCTTTTSSSS line
X is responsible for the output direction. In half duplex
X mode RRRRTTTTSSSS tells the connected device whether there is data in
X the output buffer (optional), and the CCCCTTTTSSSS line has the same
X
X
X Rev. Release 2.11.0 Page 6
X
X
X
X
X
X
X FAS(7) UNIX System V FAS(7)
X
X
X
X function as in full duplex mode.
X
X Full duplex mode
X As long as the _F_A_S input buffer hasn't reached a certain
X threshold the RRRRTTTTSSSS line is set high to signal the connected
X device that it may send characters. If the input buffer
X level rises beyond this threshold RRRRTTTTSSSS will go low and the
X device is supposed to stop sending characters. As soon as
X there is sufficient space in the input buffer RRRRTTTTSSSS will go
X high again and the character flow may continue.
X
X The CCCCTTTTSSSS line works the other way round. If the connected
X device sets CCCCTTTTSSSS to high the _F_A_S character output is enabled.
X If CCCCTTTTSSSS is low, the output is stopped. There is a special
X feature for the CCCCTTTTSSSS part of the handshake. CCCCTTTTSSSS is only
X looked at if the DDDDSSSSRRRR line is high. If DDDDSSSSRRRR is low or not
X connected, hardware output handshake is disabled, that is,
X _F_A_S sends characters regardless of the state of CCCCTTTTSSSS.
X
X This has two advantages. At first, if you switch off a
X serial device connected to an _F_A_S port with hardware flow