gemini@geminix.in-berlin.de (Uwe Doering) (09/19/90)
#!/bin/sh # this is fas207.03 (part 3 of a multipart archive) # do not concatenate these parts, unpack them in order with /bin/sh # file fas.c continued # if test ! -r _shar_seq_.tmp; then echo 'Please unpack part 1 first!' exit 1 fi (read Scheck if test "$Scheck" != 3; then echo Please unpack part "$Scheck" next! exit 1 else exit 0 fi ) < _shar_seq_.tmp || exit 1 if test ! -f _shar_wnt_.tmp; then echo 'x - still skipping fas.c' else echo 'x - continuing file fas.c' sed 's/^X//' << 'SHAR_EOF' >> 'fas.c' && X with different line settings X */ X outb (LINE_CTL_PORT, lcrval [i]); X X /* wait until the transmitter register X is empty X */ X for (delay_count = 20000; X delay_count && (~inb (LINE_STATUS_PORT) X & (LS_XMIT_AVAIL X | LS_XMIT_COMPLETE)); X delay_count--) X ; X X if (!delay_count) X { X done = 2; X break; X } X X /* send test pattern */ X outb (XMT_DATA_PORT, *cptr); X X /* wait until the test pattern is received */ X for (delay_count = 20000; X delay_count && ((inb (LINE_STATUS_PORT) X & LS_RCV_INT) X != LS_RCV_AVAIL); X delay_count--) X ; X X if (!delay_count) X { X done = 3; X break; X } X X /* check test pattern */ X if (inb (RCV_DATA_PORT) != *cptr) X { X done = 4; X break; X } X } X X if (done) X break; X } while (*cptr++); X } X X if (!done) X { X /* wait until the transmitter register is empty */ X for (delay_count = 20000; X delay_count && (~inb (LINE_STATUS_PORT) X & (LS_XMIT_AVAIL | LS_XMIT_COMPLETE)); X delay_count--) X ; X X if (!delay_count) X done = 5; X } X X if (!done) X { X /* test pattern */ X cptr = (unchar *) "\005\142\012\237\006\130\011\257\017\361\0\017\0\0"; X X /* clear delta bits */ X inb (MDM_STATUS_PORT); X X do X { X /* test modem control and status lines */ X outb (MDM_CTL_PORT, *cptr | MC_SET_LOOPBACK); X if (inb (MDM_STATUS_PORT) != *(cptr + 1)) X { X done = 6; X break; X } X } while (*((ushort *) cptr)++); X } X X /* switch back to normal operation */ X outb (MDM_CTL_PORT, 0); X X return (done); X} X X#if defined (NEED_PUT_GETCHAR) X Xint Xasyputchar (arg1) Xunchar arg1; X{ X register struct fas_info *fip; X REGVAR; X X if (!fas_is_initted) X (void) fasinit (); X X fip = &fas_info [0]; X if (fip->device_flags.i & DF_DEVICE_CONFIGURED) X { X while (!(inb (LINE_STATUS_PORT) & LS_XMIT_AVAIL)) X ; X outb (XMT_DATA_PORT, arg1); X if (arg1 == 10) X (void) asyputchar (13); X } X return (0); X} X Xint Xasygetchar () X{ X register struct fas_info *fip; X REGVAR; X X if (!fas_is_initted) X (void) fasinit (); X X fip = &fas_info [0]; X if ((fip->device_flags.i & DF_DEVICE_CONFIGURED) X && (inb (LINE_STATUS_PORT) & LS_RCV_AVAIL)) X return (inb (RCV_DATA_PORT)); X else X return (-1); X} X#endif X X#if defined (NEED_INIT8250) X X/* reset the requested port to be used directly by a DOS process */ Xint Xinit8250 (port, ier) Xushort port, ier; /* ier not used in this stub */ X{ X register struct fas_info *fip; X register uint physical_unit; X int old_level; X REGVAR; X X /* See if the port address matches a port that is used by X the fas driver. X */ X for (physical_unit = 0; physical_unit < fas_physical_units; X physical_unit++) X if (port == fas_port [physical_unit]) X break; X X if (physical_unit >= fas_physical_units) X return (-1); /* port didn't match */ X X fip = fas_info_ptr [physical_unit]; X X old_level = SPLINT (); X X fip->ier = IE_NONE; X outb (INT_ENABLE_PORT, fip->ier); X if (INT_ACK_PORT) X outb (INT_ACK_PORT, fip->int_ack); X X fip->mcr &= ~fip->flow.m.ic; X outb (MDM_CTL_PORT, fip->mcr); X X if (fip->device_flags.i & DF_DEVICE_IS_NS16550) X outb (NS_FIFO_CTL_PORT, STANDARD_NS_FIFO_CLEAR); X else if (fip->device_flags.i & DF_DEVICE_IS_I82510) X { X outb (I_BANK_PORT, I_BANK_1); X outb (I_TCM_PORT, I_FIFO_CLR_XMIT); X outb (I_RCM_PORT, I_FIFO_CLR_RECV); X outb (I_BANK_PORT, I_BANK_2); X outb (I_IDM_PORT, STANDARD_I_FIFO_CLEAR); X outb (I_BANK_PORT, I_BANK_0); X } X X inb (MDM_STATUS_PORT); X inb (RCV_DATA_PORT); X inb (RCV_DATA_PORT); X inb (LINE_STATUS_PORT); X inb (INT_ID_PORT); X (void) splx (old_level); X return (0); X} X#endif SHAR_EOF echo 'File fas.c is complete' && true || echo 'restore of fas.c failed' rm -f _shar_wnt_.tmp fi # ============= fas.h ============== if test -f 'fas.h' -a X"$1" != X"-c"; then echo 'x - skipping fas.h (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting fas.h (Text)' sed 's/^X//' << 'SHAR_EOF' > 'fas.h' && X/* This file contains various defines for the FAS async driver. X If you change anything here you have to recompile the driver module. X*/ X X#ident "@(#)fas.h 2.07" X X#include <sys/param.h> X#include <sys/types.h> X#include <sys/signal.h> X#include <sys/buf.h> X#include <sys/iobuf.h> X#include <sys/dir.h> X#if defined (XENIX) X#include <sys/page.h> X#include <sys/seg.h> X#endif X#include <sys/user.h> X#include <sys/errno.h> X#include <sys/tty.h> X#include <sys/conf.h> X#include <sys/sysinfo.h> X#include <sys/file.h> X#if !defined (XENIX) X#include <sys/termio.h> X#endif X#include <sys/ioctl.h> X#include <macros.h> X X#if defined (XENIX) Xtypedef unsigned char unchar; X#endif X X#if defined (TRUE) X#undef TRUE X#endif X#define TRUE (1) X X#if defined (FALSE) X#undef FALSE X#endif X#define FALSE (0) X X/* Uncomment the following line if you need asyputchar and asygetchar. X This is only required if you link the kernel without the original X asy driver and these functions aren't provided by any other kernel X module. X*/ X/* #define NEED_PUT_GETCHAR /* */ X X/* Uncomment the following line if you have VP/ix support in the X kernel. X*/ X/* #define HAVE_VPIX /* */ X X/* Uncomment the following line if you need init8250. DosMerge needs X this function, but only if you link the kernel without the original X asy driver. X*/ X/* #define NEED_INIT8250 /* */ X X/* Initial line control register. Value will only be meaningful for X asyputchar and asygetchar and they are only meaningful if X NEED_PUT_GETCHAR is defined. X*/ X#define INITIAL_LINE_CONTROL LC_WORDLEN_8 X X/* Initial baud rate. Value will only be meaningful for X asyputchar and asygetchar and they are only meaningful if X NEED_PUT_GETCHAR is defined. X*/ X#define INITIAL_BAUD_RATE (BAUD_BASE/9600) X X/* Initial modem control register. This should probably not have to X be touched. It is here because some terminals used as the console X require one or more of the modem signals set. It is only meaningful X for asyputchar and asygetchar and they are only meaningful if X NEED_PUT_GETCHAR is defined. X*/ X#define INITIAL_MDM_CONTROL 0 X X#if defined (HAVE_VPIX) X#if !defined (XENIX) X#include <sys/tss.h> X#include <sys/immu.h> X#include <sys/region.h> X#endif X#include <sys/proc.h> X#include <sys/v86.h> X#endif X X/****************************************************/ X/* Nothing past this line should have to be changed */ X/****************************************************/ X X#define NUM_INT_VECTORS 16 /* sixteen vectors possible but only X the first eight are normally used X */ X X#define MAX_UNITS 16 /* we will only use that many units */ X X/* Miscellaneous Constants */ X X#define BAUD_BASE (1843200 / 16) /* 115200 bps */ X#define HANGUP_DELAY ((HZ) / 4) /* 250 msec */ X#define HANGUP_TIME (HZ) /* 1 sec */ X#define BREAK_TIME ((HZ) / 4) /* 250 msec */ X#define EVENT_TIME 1 /* 1 clock tick (must be > 0) */ X#define RECV_BUFF_SIZE 5000 /* receiver ring buffer size (MAX) */ X#define SW_LOW_WATER 2500 /* 50% MAX sw flow control */ X#define SW_HIGH_WATER 4000 /* 80% MAX trigger levels */ X#define HW_LOW_WATER 4200 /* MAX - 800 hw flow control */ X#define HW_HIGH_WATER 4700 /* MAX - 300 trigger levels */ X#define XMIT_BUFF_SIZE 2500 /* transmitter ring buffer size */ X#define MAX_UNIX_FILL (TTYHOG) /* read buffer max UNIX fill level */ X#define MAX_VPIX_FILL 64 /* read buffer max VP/ix fill level */ X#define MIN_READ_CHUNK 32 /* must be <= MAX_????_FILL/2 */ X#define READ_PORT 0x0100 /* read command for fas_init_seq */ X#define SPLWRK spl5 /* SPL for character processing */ X#if defined (XENIX) X#define SPLINT spl7 /* SPL to disable FAS interrupts */ X#else X#define SPLINT spltty /* SPL to disable FAS interrupts */ X#endif X X#if (MAX_UNIX_FILL) > (TTYHOG) X#undef MAX_UNIX_FILL X#define MAX_UNIX_FILL (TTYHOG) X#endif X X#if (MAX_VPIX_FILL) > (TTYHOG) X#undef MAX_VPIX_FILL X#define MAX_VPIX_FILL (TTYHOG) X#endif X X#if (MIN_READ_CHUNK) > ((MAX_UNIX_FILL) / 2) X#undef MIN_READ_CHUNK X#define MIN_READ_CHUNK ((MAX_UNIX_FILL) / 2) X#endif X X#if (MIN_READ_CHUNK) > ((MAX_VPIX_FILL) / 2) X#undef MIN_READ_CHUNK X#define MIN_READ_CHUNK ((MAX_VPIX_FILL) / 2) X#endif X X X/* Here are the modem control flags for the fas_modem array in space.c. X They are arranged in three 8-bit masks which are combined to a 32-bit X word. Each of these 32-bit words represents one entry in the fas_modem X array. X X The lowest byte is used as a mask to manipulate the modem control X register for modem enable. Use the MC_* macros to build the mask. X X The second lowest byte is used to mask signals from the modem status X register that will be used as the carrier detect signal. Use the MS_* X macros to build the mask and shift them 8 bits to the left. If you use X more than one signal, carrier is considered on only when all signals X are on. X X The second highes byte is used to mask signals from the modem status X register that will be used as the unblock signal. Use the MS_* macros X to build the mask and shift them 16 bits to the left. If you use more X than one signal, unblock occurs only when all signals are on. X X The highest byte is reserved for future use. X X Here are some useful macros for the space.c file. You may create your X own macros if you have some special requirements not met by the X predefined ones. X*/ X X/* modem enable (choose one) */ X#define EN_RTS MC_SET_RTS /* RTS enables modem */ X#define EN_DTR MC_SET_DTR /* DTR enables modem */ X#define EN_RTS_AND_DTR (MC_SET_RTS | MC_SET_DTR) X X/* carrier detect signal (choose one) */ X#define CA_DCD (MS_DCD_PRESENT << 8) /* DCD is carr. detect */ X#define CA_CTS (MS_CTS_PRESENT << 8) /* CTS is carr. detect */ X#define CA_DSR (MS_DSR_PRESENT << 8) /* DSR is carr. detect */ X X/* unblock signal (choose one) */ X#define UB_DCD (MS_DCD_PRESENT << 16) /* leading edge ! */ X#define UB_RING (MS_RING_PRESENT << 16) /* trailing edge ! */ X X X/* Here are the hardware handshake flags for the fas_flow array in space.c. X They are arranged in three 8-bit masks which are combined to a 32-bit X word. Each of these 32-bit words represents one entry in the fas_flow X array. X X The lowest byte is used as a mask to manipulate the modem control X register for input flow control. Use the MC_* macros to build the mask. X X The second lowest byte is used to mask signals from the modem status X register that will be used for output flow control. Use the MS_* macros X to build the mask and shift them 8 bits to the left. If you use more X than one signal, output is allowed only when all signals are on. X X The second highest byte is used to mask signals from the modem status X register that will be used to enable the output flow control selected X by the second lowest byte. Use the MS_* macros to build the mask and X shift them 16 bits to the left. If you use more than one signal, output X flow control is enabled only when all signals are on. X X The highest byte is reserved for future use. X X Here are some useful macros for the space.c file. You may create your X own macros if you have some special requirements not met by the X predefined ones. X*/ X X/* input flow control (choose one) */ X#define HI_RTS MC_SET_RTS /* RTS input flow ctrl */ X#define HI_DTR MC_SET_DTR /* DTR input flow ctrl */ X#define HI_RTS_AND_DTR (MC_SET_RTS | MC_SET_DTR) X X/* output flow control (choose one) */ X#define HO_CTS (MS_CTS_PRESENT << 8) /* CTS output flow ctrl */ X#define HO_DSR (MS_DSR_PRESENT << 8) /* DSR output flow ctrl */ X#define HO_CTS_AND_DSR ((MS_CTS_PRESENT | MS_DSR_PRESENT) << 8) X#define HO_CTS_ON_DSR ((MS_CTS_PRESENT << 8) | (MS_DSR_PRESENT << 16)) X#define HO_CTS_ON_DSR_AND_DCD ((MS_CTS_PRESENT << 8) \ X | ((MS_DSR_PRESENT | MS_DCD_PRESENT) << 16)) X X X/* define the local open flags */ X X#define OS_DEVICE_CLOSED 0x0000 X#define OS_OPEN_FOR_DIALOUT 0x0001 X#define OS_OPEN_FOR_GETTY 0x0002 X#define OS_WAIT_OPEN 0x0004 X#define OS_NO_DIALOUT 0x0008 X#define OS_CHECK_CARR_ON_OPEN 0x0010 X#define OS_FAKE_CARR_ON 0x0020 X#define OS_UNBLOCK_ENABLE 0x0040 X#define OS_CLOCAL 0x0080 X#define OS_HW_HANDSHAKE 0x0100 X#define OS_EXCLUSIVE_OPEN_1 0x0200 X#define OS_EXCLUSIVE_OPEN_2 0x0400 /* SYSV 3.2 Xenix compatibility */ X X#define OS_OPEN_STATES (OS_OPEN_FOR_DIALOUT | OS_OPEN_FOR_GETTY) X#define OS_TEST_MASK (OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \ X | OS_CHECK_CARR_ON_OPEN | OS_FAKE_CARR_ON \ X | OS_UNBLOCK_ENABLE | OS_CLOCAL \ X | OS_HW_HANDSHAKE | OS_EXCLUSIVE_OPEN_1 \ X | OS_EXCLUSIVE_OPEN_2) X#define OS_SU_TEST_MASK (OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \ X | OS_CHECK_CARR_ON_OPEN | OS_FAKE_CARR_ON \ X | OS_UNBLOCK_ENABLE | OS_CLOCAL \ X | OS_HW_HANDSHAKE | OS_EXCLUSIVE_OPEN_1) X X/* define the device status flags */ X X#define DF_DEVICE_CONFIGURED 0x0001 /* device is configured */ X#define DF_DEVICE_IS_NS16550 0x0002 /* it's an NS16550 */ X#define DF_DEVICE_IS_I82510 0x0004 /* it's an I82510 */ X#define DF_DEVICE_OPEN 0x0008 /* physical device is open */ X#define DF_DEVICE_LOCKED 0x0010 /* physical device locked */ X#define DF_MODEM_ENABLED 0x0020 /* modem enabled */ X#define DF_XMIT_BUSY 0x0040 /* transmitter busy */ X#define DF_XMIT_BREAK 0x0080 /* transmitter sends break */ X#define DF_XMIT_LOCKED 0x0100 /* transmitter locked against output */ X#define DF_DO_HANGUP 0x0200 /* delayed hangup request */ X#define DF_DO_BREAK 0x0400 /* delayed break request */ X#define DF_GUARD_TIMEOUT 0x0800 /* protect last char from corruption */ X X/* define the flow control status flags */ X X#define FF_HWO_HANDSHAKE 0x0001 /* output hw handshake enabled */ X#define FF_HWI_HANDSHAKE 0x0002 /* input hw handshake enabled */ X#define FF_HWO_STOPPED 0x0004 /* output stopped by hw handshake */ X#define FF_HWI_STOPPED 0x0008 /* input stopped by hw handshake */ X#define FF_SWO_STOPPED 0x0010 /* output stopped by sw flow control */ X#define FF_SWI_STOPPED 0x0020 /* input stopped by sw flow control */ X#define FF_SW_FC_REQ 0x0040 /* sw input flow control request */ X#define FF_RXFER_STOPPED 0x0080 /* rxfer function stopped */ X X/* define the scheduled events flags */ X X#define EF_EVENT_SCHEDULED 0x0001 /* event function scheduled */ X#define EF_DO_RXFER 0x0002 /* rxfer function request */ X#define EF_DO_XXFER 0x0004 /* xxfer function request */ X#define EF_DO_BRKINT 0x0008 /* break int request */ X#define EF_DO_MPROC 0x0010 /* mproc function request */ X#define EF_SIGNAL_VPIX 0x0020 /* send pseudorupt to VP/ix */ X X#define EF_EVENT_MASK (EF_DO_RXFER | EF_DO_XXFER | EF_DO_BRKINT \ X | EF_DO_MPROC | EF_SIGNAL_VPIX) X X/* define an easy way to refenence the absolute port addresses */ X X#define RCV_DATA_PORT (fip->uart_port_0) X#define XMT_DATA_PORT (fip->uart_port_0) X#define INT_ENABLE_PORT (fip->uart_port_1) X#define INT_ID_PORT (fip->uart_port_2) X#define NS_FIFO_CTL_PORT (fip->uart_port_2) X#define I_BANK_PORT (fip->uart_port_2) X#define LINE_CTL_PORT (fip->uart_port_3) X#define MDM_CTL_PORT (fip->uart_port_4) X#define I_IDM_PORT (fip->uart_port_4) X#define LINE_STATUS_PORT (fip->uart_port_5) X#define I_RCM_PORT (fip->uart_port_5) X#define MDM_STATUS_PORT (fip->uart_port_6) X#define I_TCM_PORT (fip->uart_port_6) X#define DIVISOR_LSB_PORT (fip->uart_port_0) X#define DIVISOR_MSB_PORT (fip->uart_port_1) X#define INT_ACK_PORT (fip->int_ack_port) X X/* modem control port */ X X#define MC_SET_DTR 0x01 X#define MC_SET_RTS 0x02 X#define MC_SET_OUT1 0x04 X#define MC_SET_OUT2 0x08 /* tristates int line when false */ X#define MC_SET_LOOPBACK 0x10 X X/* modem status port */ X X#define MS_CTS_DELTA 0x01 X#define MS_DSR_DELTA 0x02 X#define MS_RING_TEDGE 0x04 X#define MS_DCD_DELTA 0x08 X#define MS_CTS_PRESENT 0x10 X#define MS_DSR_PRESENT 0x20 X#define MS_RING_PRESENT 0x40 X#define MS_DCD_PRESENT 0x80 X X#define MS_ANY_DELTA (MS_CTS_DELTA | MS_DSR_DELTA | MS_RING_TEDGE \ X | MS_DCD_DELTA) X#define MS_ANY_PRESENT (MS_CTS_PRESENT | MS_DSR_PRESENT | MS_RING_PRESENT \ X | MS_DCD_PRESENT) X X/* interrupt enable port */ X X#define IE_NONE 0x00 X#define IE_RECV_DATA_AVAILABLE 0x01 X#define IE_XMIT_HOLDING_BUFFER_EMPTY 0x02 X#define IE_LINE_STATUS 0x04 X#define IE_MODEM_STATUS 0x08 X X#define IE_INIT_MODE (IE_RECV_DATA_AVAILABLE | IE_XMIT_HOLDING_BUFFER_EMPTY \ X | IE_LINE_STATUS | IE_MODEM_STATUS) X X/* interrupt id port */ X X#define II_NO_INTS_PENDING 0x01 X#define II_CODE_MASK 0x07 X#define II_MODEM_STATE 0x00 X#define II_XMTD_CHAR 0x02 X#define II_RCVD_CHAR 0x04 X#define II_RCV_ERROR 0x06 X#define II_NS_FIFO_TIMEOUT 0x08 X#define II_NS_FIFO_ENABLED 0xC0 X X/* line control port */ X X#define LC_WORDLEN_MASK 0x03 X#define LC_WORDLEN_5 0x00 X#define LC_WORDLEN_6 0x01 X#define LC_WORDLEN_7 0x02 X#define LC_WORDLEN_8 0x03 X#define LC_STOPBITS_LONG 0x04 X#define LC_ENABLE_PARITY 0x08 X#define LC_EVEN_PARITY 0x10 X#define LC_STICK_PARITY 0x20 X#define LC_SET_BREAK_LEVEL 0x40 X#define LC_ENABLE_DIVISOR 0x80 X X/* line status port */ X X#define LS_RCV_AVAIL 0x01 X#define LS_OVERRUN 0x02 X#define LS_PARITY_ERROR 0x04 X#define LS_FRAMING_ERROR 0x08 X#define LS_BREAK_DETECTED 0x10 X#define LS_XMIT_AVAIL 0x20 X#define LS_XMIT_COMPLETE 0x40 X#define LS_ERROR_IN_NS_FIFO 0x80 /* NS16550 only */ X X#define LS_RCV_INT (LS_RCV_AVAIL | LS_OVERRUN | LS_PARITY_ERROR \ X | LS_FRAMING_ERROR | LS_BREAK_DETECTED) X X/* fifo control port (NS16550 only) */ X X#define NS_FIFO_ENABLE 0x01 X#define NS_FIFO_CLR_RECV 0x02 X#define NS_FIFO_CLR_XMIT 0x04 X#define NS_FIFO_START_DMA 0x08 X#define NS_FIFO_SIZE_1 0x00 X#define NS_FIFO_SIZE_4 0x40 X#define NS_FIFO_SIZE_8 0x80 X#define NS_FIFO_SIZE_14 0xC0 X#define NS_FIFO_SIZE_MASK 0xC0 X X#define STANDARD_NS_FIFO_CLEAR 0 X#define STANDARD_NS_FIFO_SETUP (NS_FIFO_SIZE_4 | NS_FIFO_ENABLE) X#define STANDARD_NS_FIFO_INIT (STANDARD_NS_FIFO_SETUP | NS_FIFO_CLR_RECV \ X | NS_FIFO_CLR_XMIT) X X#define INPUT_NS_FIFO_SIZE 16 X#define OUTPUT_NS_FIFO_SIZE 16 X X/* fifo control ports (i82510 only) */ X X#define I_BANK_0 0x00 X#define I_BANK_1 0x20 X#define I_BANK_2 0x40 X#define I_BANK_3 0x60 X#define I_FIFO_ENABLE 0x08 X#define I_FIFO_CLR_RECV 0x30 X#define I_FIFO_CLR_XMIT 0x0c X X#define STANDARD_I_FIFO_CLEAR 0 X#define STANDARD_I_FIFO_SETUP I_FIFO_ENABLE X X#define INPUT_I_FIFO_SIZE 4 X#define OUTPUT_I_FIFO_SIZE 4 X X/* defines for ioctl calls (VP/ix) */ X X#define AIOC ('A'<<8) X#define AIOCINTTYPE (AIOC|60) /* set interrupt type */ X#define AIOCDOSMODE (AIOC|61) /* set DOS mode */ X#define AIOCNONDOSMODE (AIOC|62) /* reset DOS mode */ X#define AIOCSERIALOUT (AIOC|63) /* serial device data write */ X#define AIOCSERIALIN (AIOC|64) /* serial device data read */ X#define AIOCSETSS (AIOC|65) /* set start/stop chars */ X#define AIOCINFO (AIOC|66) /* tell us what device we are */ X X/* ioctl alternate names used by VP/ix */ X X#define VPC_SERIAL_DOS AIOCDOSMODE X#define VPC_SERIAL_NONDOS AIOCNONDOSMODE X#define VPC_SERIAL_INFO AIOCINFO X#define VPC_SERIAL_OUT AIOCSERIALOUT X#define VPC_SERIAL_IN AIOCSERIALIN X X/* serial in/out requests */ X X#define SO_DIVLLSB 1 X#define SO_DIVLMSB 2 X#define SO_LCR 3 X#define SO_MCR 4 X#define SI_MSR 1 X#define SIO_MASK(x) (1<<((x)-1)) X X X/* This structure contains everything one would like to know about X an open device. There is one of it for each physical unit. X X We use several unions to eliminate most integer type conversions X at run-time. The standard UNIX V 3.X/386 C compiler forces all X operands in expressions and all function parameters to type int. X To save some time, with the means of unions we deliver type int X at the proper locations while dealing with the original type X wherever int would be slower. X X This is highly compiler implementation specific. But for the sake X of speed the end justifies the means. X X Take care that the size of the area that contains the various X structure fields (up to, but excluding the ring buffers) X is <= 128 bytes. Otherwise a 4-byte offset is used to access X some of the structure fields. For the first 128 bytes a 1-byte X offset is used, which is faster. X*/ X Xstruct fas_info X{ X struct tty *tty; /* the tty structure */ X struct fas_info *prev_int_user;/* link to previous fas_info struct */ X struct fas_info *next_int_user;/* link to next fas_info struct */ X int timeout_idx; /* timeout index for untimeout () */ X uint iflag; /* current terminal input flags */ X uint cflag; /* current terminal hardware control flags */ X union { /* flags about the device state */ X ushort s; X uint i; X } device_flags; X union { /* flags about the flow control state */ X ushort s; X uint i; X } flow_flags; X union { /* flags about the scheduled events */ X ushort s; X uint i; X } event_flags; X uint o_state; /* current open state */ X uint po_state; /* previous open state */ X union { /* modem control masks */ X struct { X unchar en; /* mask for modem enable */ X unchar ca; /* mask for carrier detect */ X unchar ub; /* mask for unblock signal */ X } m; X uint i; X } modem; X union { /* hardware flow control masks */ X struct { X unchar ic; /* control mask for inp. flow ctrl */ X unchar oc; /* control mask for outp. flow ctrl */ X unchar oe; /* enable mask for outp. flow ctrl */ X } m; X uint i; X } flow; X unchar msr; /* modem status register value */ X unchar new_msr; /* new modem status register value */ X unchar mcr; /* modem control register value */ X unchar lcr; /* line control register value */ X unchar ier; /* interrupt enable register value */ X unchar int_ack; /* int ack value */ X unchar vec; /* interrupt vector for this struct */ X#if defined (HAVE_VPIX) X unchar v86_intmask; /* VP/ix pseudorupt mask */ X v86_t *v86_proc; /* VP/ix v86proc pointer for pseudorupts */ X struct termss v86_ss; /* VP/ix start/stop characters */ X#endif X uint uart_port_0; /* uart port 0 address */ X uint uart_port_1; /* uart port 1 address */ X uint uart_port_2; /* uart port 2 address */ X uint uart_port_3; /* uart port 3 address */ X uint uart_port_4; /* uart port 4 address */ X uint uart_port_5; /* uart port 5 address */ X uint uart_port_6; /* uart port 6 address */ X uint int_ack_port; /* int ack port address */ X uint recv_ring_cnt; /* receiver ring buffer counter */ X unchar *recv_ring_put_ptr; /* recv ring buf put ptr */ X unchar *recv_ring_take_ptr; /* recv ring buf take ptr */ X uint xmit_ring_size; /* transmitter ring buffer size */ X uint xmit_ring_cnt; /* transmitter ring buffer counter */ X unchar *xmit_ring_put_ptr; /* xmit ring buf put ptr */ X unchar *xmit_ring_take_ptr; /* xmit ring buf take ptr */ X unchar recv_buffer [RECV_BUFF_SIZE]; /* recv ring buf */ X unchar xmit_buffer [XMIT_BUFF_SIZE]; /* xmit ring buf */ X}; SHAR_EOF true || echo 'restore of fas.h failed' rm -f _shar_wnt_.tmp fi # ============= i_fas-ast4 ============== if test -f 'i_fas-ast4' -a X"$1" != X"-c"; then echo 'x - skipping i_fas-ast4 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting i_fas-ast4 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast4' && XF0:2345:off:/etc/getty ttyFM00 9600 XF1:2345:off:/etc/getty ttyFM01 9600 XF2:2345:off:/etc/getty ttyFM02 9600 XF3:2345:off:/etc/getty ttyFM03 9600 SHAR_EOF true || echo 'restore of i_fas-ast4 failed' rm -f _shar_wnt_.tmp fi # ============= i_fas-c1-2 ============== if test -f 'i_fas-c1-2' -a X"$1" != X"-c"; then echo 'x - skipping i_fas-c1-2 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting i_fas-c1-2 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'i_fas-c1-2' && XF0:2345:off:/etc/getty ttyFM00 9600 XF1:2345:off:/etc/getty ttyFM01 9600 SHAR_EOF true || echo 'restore of i_fas-c1-2 failed' rm -f _shar_wnt_.tmp fi # ============= i_fas-c1-3 ============== if test -f 'i_fas-c1-3' -a X"$1" != X"-c"; then echo 'x - skipping i_fas-c1-3 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting i_fas-c1-3 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'i_fas-c1-3' && XF0:2345:off:/etc/getty ttyFM00 9600 XF1:2345:off:/etc/getty ttyFM01 9600 XF2:2345:off:/etc/getty ttyFM02 9600 SHAR_EOF true || echo 'restore of i_fas-c1-3 failed' rm -f _shar_wnt_.tmp fi # ============= makefile.ESIX ============== if test -f 'makefile.ESIX' -a X"$1" != X"-c"; then echo 'x - skipping makefile.ESIX (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting makefile.ESIX (Text)' sed 's/^X//' << 'SHAR_EOF' > 'makefile.ESIX' && X# Makefile for ESIX X XSHELL=/bin/sh XINCLSYS=/usr/include/sys XLKDRVRDIR=/etc/conf/pack.d/fas XLKSCONFDIR=/etc/conf/sdevice.d XLKNCONFDIR=/etc/conf/node.d XLKICONFDIR=/etc/conf/init.d XDRVRNAME=Driver.o XCONFNAME=fas X XCC = cc XCFLAGS = -O -DINKERNEL X XOBJS = fas.o X Xfas.o: fas.c $(INCLSYS)/fas.h X Xinstall: fas.o space.c s_$(CONFNAME) n_$(CONFNAME) i_$(CONFNAME) X -mkdir $(LKDRVRDIR) 2> /dev/null X chmod 755 $(LKDRVRDIR) X cp fas.o $(LKDRVRDIR)/$(DRVRNAME) X chmod 644 $(LKDRVRDIR)/$(DRVRNAME) X cp space.c $(LKDRVRDIR)/space.c X chmod 644 $(LKDRVRDIR)/space.c X cp s_$(CONFNAME) $(LKSCONFDIR)/$(CONFNAME) X chmod 644 $(LKSCONFDIR)/$(CONFNAME) X cp n_$(CONFNAME) $(LKNCONFDIR)/$(CONFNAME) X chmod 644 $(LKNCONFDIR)/$(CONFNAME) X cp i_$(CONFNAME) $(LKICONFDIR)/$(CONFNAME) X chmod 644 $(LKICONFDIR)/$(CONFNAME) X Xspace.c: X @echo "You must copy the proper space-xxxxx file to \`space.c'" X @false X Xs_$(CONFNAME): X @echo "You must copy the proper s_$(CONFNAME)-xxxxx file to \`s_$(CONFNAME)'" X @false X Xn_$(CONFNAME): X @echo "You must copy the proper n_$(CONFNAME)-xxxxx file to \`n_$(CONFNAME)'" X @false X Xi_$(CONFNAME): X @echo "You must copy the proper i_$(CONFNAME)-xxxxx file to \`i_$(CONFNAME)'" X @false X X$(INCLSYS)/fas.h: fas.h X cp fas.h $(INCLSYS)/fas.h X Xclean: X rm -f fas.o X Xclobber: clean X SHAR_EOF true || echo 'restore of makefile.ESIX failed' rm -f _shar_wnt_.tmp fi # ============= makefile.ISC ============== if test -f 'makefile.ISC' -a X"$1" != X"-c"; then echo 'x - skipping makefile.ISC (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting makefile.ISC (Text)' sed 's/^X//' << 'SHAR_EOF' > 'makefile.ISC' && X# Makefile for ISC SYS V/386 X XSHELL=/bin/sh XINCLSYS=/usr/include/sys XLKDRVRDIR=/etc/conf/pack.d/fas XLKSCONFDIR=/etc/conf/sdevice.d XLKNCONFDIR=/etc/conf/node.d XLKICONFDIR=/etc/conf/init.d XDRVRNAME=Driver.o XCONFNAME=fas X XCC = cc XCFLAGS = -O -DINKERNEL X XOBJS = fas.o X Xfas.o: fas.c $(INCLSYS)/fas.h X Xinstall: fas.o space.c s_$(CONFNAME) n_$(CONFNAME) i_$(CONFNAME) X -mkdir $(LKDRVRDIR) 2> /dev/null X chmod 755 $(LKDRVRDIR) X cp fas.o $(LKDRVRDIR)/$(DRVRNAME) X chmod 644 $(LKDRVRDIR)/$(DRVRNAME) X cp space.c $(LKDRVRDIR)/space.c X chmod 644 $(LKDRVRDIR)/space.c X cp s_$(CONFNAME) $(LKSCONFDIR)/$(CONFNAME) X chmod 644 $(LKSCONFDIR)/$(CONFNAME) X cp n_$(CONFNAME) $(LKNCONFDIR)/$(CONFNAME) X chmod 644 $(LKNCONFDIR)/$(CONFNAME) X cp i_$(CONFNAME) $(LKICONFDIR)/$(CONFNAME) X chmod 644 $(LKICONFDIR)/$(CONFNAME) X Xspace.c: X @echo "You must copy the proper space-xxxxx file to \`space.c'" X @false X Xs_$(CONFNAME): X @echo "You must copy the proper s_$(CONFNAME)-xxxxx file to \`s_$(CONFNAME)'" X @false X Xn_$(CONFNAME): X @echo "You must copy the proper n_$(CONFNAME)-xxxxx file to \`n_$(CONFNAME)'" X @false X Xi_$(CONFNAME): X @echo "You must copy the proper i_$(CONFNAME)-xxxxx file to \`i_$(CONFNAME)'" X @false X X$(INCLSYS)/fas.h: fas.h X cp fas.h $(INCLSYS)/fas.h X Xclean: X rm -f fas.o X Xclobber: clean X SHAR_EOF true || echo 'restore of makefile.ISC failed' rm -f _shar_wnt_.tmp fi # ============= makefile.SCO ============== if test -f 'makefile.SCO' -a X"$1" != X"-c"; then echo 'x - skipping makefile.SCO (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting makefile.SCO (Text)' sed 's/^X//' << 'SHAR_EOF' > 'makefile.SCO' && X# Makefile for SCO UNIX SYS V/386 X XSHELL=/bin/sh XINCLSYS=/usr/include/sys XLKDRVRDIR=/etc/conf/pack.d/fas XLKSCONFDIR=/etc/conf/sdevice.d XLKNCONFDIR=/etc/conf/node.d XLKICONFDIR=/etc/conf/init.d XDRVRNAME=Driver.o XCONFNAME=fas X XCC = rcc XCFLAGS = -O -DINKERNEL -DSCO X XOBJS = fas.o X Xfas.o: fas.c $(INCLSYS)/fas.h X Xinstall: fas.o space.c s_$(CONFNAME) n_$(CONFNAME) i_$(CONFNAME) X -mkdir $(LKDRVRDIR) 2> /dev/null X chmod 755 $(LKDRVRDIR) X cp fas.o $(LKDRVRDIR)/$(DRVRNAME) X chmod 644 $(LKDRVRDIR)/$(DRVRNAME) X cp space.c $(LKDRVRDIR)/space.c X chmod 644 $(LKDRVRDIR)/space.c X cp s_$(CONFNAME) $(LKSCONFDIR)/$(CONFNAME) X chmod 644 $(LKSCONFDIR)/$(CONFNAME) X cp n_$(CONFNAME) $(LKNCONFDIR)/$(CONFNAME) X chmod 644 $(LKNCONFDIR)/$(CONFNAME) X cp i_$(CONFNAME) $(LKICONFDIR)/$(CONFNAME) X chmod 644 $(LKICONFDIR)/$(CONFNAME) X Xspace.c: X @echo "You must copy the proper space-xxxxx file to \`space.c'" X @false X Xs_$(CONFNAME): X @echo "You must copy the proper s_$(CONFNAME)-xxxxx file to \`s_$(CONFNAME)'" X @false X Xn_$(CONFNAME): X @echo "You must copy the proper n_$(CONFNAME)-xxxxx file to \`n_$(CONFNAME)'" X @false X Xi_$(CONFNAME): X @echo "You must copy the proper i_$(CONFNAME)-xxxxx file to \`i_$(CONFNAME)'" X @false X X$(INCLSYS)/fas.h: fas.h X cp fas.h $(INCLSYS)/fas.h X Xclean: X rm -f fas.o X Xclobber: clean X SHAR_EOF true || echo 'restore of makefile.SCO failed' rm -f _shar_wnt_.tmp fi # ============= makefile.XENIX ============== if test -f 'makefile.XENIX' -a X"$1" != X"-c"; then echo 'x - skipping makefile.XENIX (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting makefile.XENIX (Text)' sed 's/^X//' << 'SHAR_EOF' > 'makefile.XENIX' && X# Makefile for SCO Xenix 386 X XSHELL=/bin/sh X XCC = cc XCFLAGS = -O -DXENIX -DM_KERNEL -M3e -Zp4 -c X Xfas: fas.c fas.h space.c X $(CC) $(CFLAGS) fas.c space.c X Xspace.c: X @echo "You must copy the proper space-xxxxx file to \`space.c'" X @false X Xclean: X rm -f fas.o space.o X Xclobber: clean X SHAR_EOF true || echo 'restore of makefile.XENIX failed' rm -f _shar_wnt_.tmp fi # ============= makefile.uPort ============== if test -f 'makefile.uPort' -a X"$1" != X"-c"; then echo 'x - skipping makefile.uPort (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting makefile.uPort (Text)' sed 's/^X//' << 'SHAR_EOF' > 'makefile.uPort' && X# Makefile for uPort SYS V/386 X XSHELL=/bin/sh XINCLSYS=/usr/include/sys XLKDRVRDIR=/etc/atconf/modules/fas XLKCONFDIR=/etc/atconf/modules/fas XDRVRNAME=fas.o XCONFNAME=config X XCC = cc XCFLAGS = -O -DINKERNEL -DOPTIM X XOBJS = fas.o X Xfas.o: fas.c $(INCLSYS)/fas.h X Xinstall: fas.o space.c $(CONFNAME) X -mkdir $(LKDRVRDIR) 2> /dev/null X chmod 755 $(LKDRVRDIR) X cp fas.o $(LKDRVRDIR)/$(DRVRNAME) X chmod 644 $(LKDRVRDIR)/$(DRVRNAME) X cp space.c $(LKDRVRDIR)/space.c X chmod 644 $(LKDRVRDIR)/space.c X cp $(CONFNAME) $(LKCONFDIR)/$(CONFNAME) X chmod 644 $(LKCONFDIR)/$(CONFNAME) X Xspace.c: X @echo "You must copy the proper space-xxxxx file to \`space.c'" X @false X X$(CONFNAME): X @echo "You must copy the proper $(CONFNAME)-xxxxx file to \`$(CONFNAME)'" X @false X X$(INCLSYS)/fas.h: fas.h X cp fas.h $(INCLSYS)/fas.h X Xclean: X rm -f fas.o X Xclobber: clean X SHAR_EOF true || echo 'restore of makefile.uPort failed' rm -f _shar_wnt_.tmp fi # ============= n_fas-ast4 ============== if test -f 'n_fas-ast4' -a X"$1" != X"-c"; then echo 'x - skipping n_fas-ast4 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting n_fas-ast4 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast4' && Xfas ttyF00 c 48 Xfas ttyF01 c 49 Xfas ttyF02 c 50 Xfas ttyF03 c 51 Xfas ttyFM00 c 208 Xfas ttyFM01 c 209 Xfas ttyFM02 c 210 Xfas ttyFM03 c 211 SHAR_EOF true || echo 'restore of n_fas-ast4 failed' rm -f _shar_wnt_.tmp fi # ============= n_fas-c1-2 ============== if test -f 'n_fas-c1-2' -a X"$1" != X"-c"; then echo 'x - skipping n_fas-c1-2 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting n_fas-c1-2 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'n_fas-c1-2' && Xfas ttyF00 c 48 Xfas ttyF01 c 49 Xfas ttyFM00 c 208 Xfas ttyFM01 c 209 SHAR_EOF true || echo 'restore of n_fas-c1-2 failed' rm -f _shar_wnt_.tmp fi # ============= n_fas-c1-3 ============== if test -f 'n_fas-c1-3' -a X"$1" != X"-c"; then echo 'x - skipping n_fas-c1-3 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting n_fas-c1-3 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'n_fas-c1-3' && Xfas ttyF00 c 48 Xfas ttyF01 c 49 Xfas ttyF02 c 50 Xfas ttyFM00 c 208 Xfas ttyFM01 c 209 Xfas ttyFM02 c 210 SHAR_EOF true || echo 'restore of n_fas-c1-3 failed' rm -f _shar_wnt_.tmp fi # ============= s_fas-ast4 ============== if test -f 's_fas-ast4' -a X"$1" != X"-c"; then echo 'x - skipping s_fas-ast4 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting s_fas-ast4 (Text)' sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast4' && Xfas Y 4 7 1 4 2a0 2bf 0 0 SHAR_EOF true || echo 'restore of s_fas-ast4 failed' rm -f _shar_wnt_.tmp fi # ============= s_fas-c1-2 ============== if test -f 's_fas-c1-2' -a X"$1" != X"-c"; then echo 'x - skipping s_fas-c1-2 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting s_fas-c1-2 (Text)' sed 's/^X//' << 'SHAR_EOF' > 's_fas-c1-2' && Xfas Y 1 7 1 4 3f8 3ff 0 0 Xfas Y 1 7 1 3 2f8 2ff 0 0 SHAR_EOF true || echo 'restore of s_fas-c1-2 failed' rm -f _shar_wnt_.tmp fi # ============= s_fas-c1-3 ============== if test -f 's_fas-c1-3' -a X"$1" != X"-c"; then echo 'x - skipping s_fas-c1-3 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting s_fas-c1-3 (Text)' sed 's/^X//' << 'SHAR_EOF' > 's_fas-c1-3' && Xfas Y 1 7 1 4 3f8 3ff 0 0 Xfas Y 1 7 1 3 2f8 2ff 0 0 Xfas Y 1 7 1 9 3e8 3ef 0 0 SHAR_EOF true || echo 'restore of s_fas-c1-3 failed' rm -f _shar_wnt_.tmp fi # ============= space-ast4 ============== if test -f 'space-ast4' -a X"$1" != X"-c"; then echo 'x - skipping space-ast4 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting space-ast4 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'space-ast4' && X/* Async device configuration file for the FAS async driver. */ X X/* This version is for the AST 4-port card in expanded mode. X*/ X X/* Originally written by XJim Murray encore!cloud9!jjmhome!jjm X2 Mohawk Circle harvard!m2c!jjmhome!jjm XWestboro Mass 01581 jjm%jjmhome@m2c.m2c.org XUSA voice (508) 366-2813 X*/ X X/* Current author: XUwe Doering Domain : gemini@geminix.in-berlin.de XBillstedter Pfad 17 b Bangpath : ...!unido!fub!tmpmbx!geminix!gemini X1000 Berlin 20 XGermany X*/ X X#ident "@(#)space.c 2.07" X X#if defined (XENIX) X#include "fas.h" X#else X#include <sys/fas.h> X#endif X X/* This is the number of devices to be handled by this driver. X You may define up to 16 devices. If this number is changed X the arrays below must be filled in accordingly. X*/ X#define NUM_PHYSICAL_UNITS 4 X X#if NUM_PHYSICAL_UNITS > MAX_UNITS X#undef NUM_PHYSICAL_UNITS X#define NUM_PHYSICAL_UNITS MAX_UNITS X#endif X X/* let the driver know the number of devices */ Xuint fas_physical_units = NUM_PHYSICAL_UNITS; X X/* array of base port addresses */ Xuint fas_port [NUM_PHYSICAL_UNITS] = X{ X 0x2a0, 0x2a8, 0x2b0, 0x2b8 X}; X X/* array of interrupt vectors */ Xuint fas_vec [NUM_PHYSICAL_UNITS] = X{ X 0x4, 0x4, 0x4, 0x4 X}; X X/* initialization sequence for serial card X This array contains pairs of values of the form: X X portaddress, value, X : X : X portaddress, value, X 0 X X For every line `value' will be written to `portaddress'. If X `value' is replaced with the macro `READ_PORT' then a value X is read from `portaddress' instead. The value itself will be X discarded. Therefor this makes only sense if the read access X to the port has a side effect like setting or resetting X certain flags. X X NOTE: This array *must* be terminated with a value of 0 X in the portaddress column! X*/ X Xuint fas_init_seq [] = X{ X 0x2bf, 0x80, X 0 X}; X X/* initial modem control port info X This value is ored into the modem control value for each UART. This is X normaly used to force out2 which is used to enable the interrupts of X the standard com1 and com2 ports. Several brands of cards have modes X that allow them to work in compatible mode like com1 and com2 or as a X mux. One of these cards is the AST 4-port card. When this card is X used with the common interrupt out2 must not be set or there will be X a fight on the bus. X X Note: This is one of the major trouble-spots with mux cards. Check X your manual. X*/ X Xuint fas_mcb [NUM_PHYSICAL_UNITS] = X{ X 0, 0, 0, 0 X}; X X/* array of modem control flags X You can choose which signals to use for modem control. See fas.h X for possible names and values. Whether or not modem control is X used is determined by the minor device number at open time. X*/ Xuint fas_modem [NUM_PHYSICAL_UNITS] = X{ X EN_DTR | CA_DCD | UB_RING, X EN_DTR | CA_DCD | UB_RING, X EN_DTR | CA_DCD | UB_RING, X EN_DTR | CA_DCD | UB_RING X}; X X/* array of hardware flow control flags X You can choose which signals to use for hardware handshake. See fas.h X for possible names and values. Whether or not hardware handshake is X used is determined by the minor device number at open time or by the X RTSFLOW/CTSFLOW termio(7) flags. X*/ Xuint fas_flow [NUM_PHYSICAL_UNITS] = X{ X HI_RTS | HO_CTS_ON_DSR, X HI_RTS | HO_CTS_ON_DSR, X HI_RTS | HO_CTS_ON_DSR, X HI_RTS | HO_CTS_ON_DSR X}; X X/* additional configurations for multiplexed interrupt boards X If you have a mux board, you may have to acknowledge interrupts X by writing to a special register. There may be a separate register X for every single port or for every interrupt vector or both. X The following arrays contain the special register addresses and X the corresponding values that are written to them in response X to an interrupt. X*/ X X/* array of int ack register addresses X These registers are written to every time after all interrupt X sources in the corresponding UART have been cleared. X Enter the addresses on a per unit base. An address of zero X disables this feature. X*/ X Xuint fas_int_ack_port [NUM_PHYSICAL_UNITS] = X{ X 0, 0, 0, 0 X}; X X/* array of int ack values X These values are written to the corresponding int ack register X in response to an interrupt. X*/ X Xuint fas_int_ack [NUM_PHYSICAL_UNITS] = X{ X 0, 0, 0, 0 X}; X X/* array of int ack mux register addresses X These registers are written to every time after all interrupt X sources in all of the UARTs that are tied to the corresponding X interrupt vector have been cleared. X Enter the addresses on a per vector base. An address of zero X disables this feature. X*/ X Xuint fas_mux_ack_port [NUM_INT_VECTORS] = X{ X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0 X}; X X/* array of int ack mux values X These values are written to the corresponding int ack mux register X in response to an interrupt. X*/ X Xuint fas_mux_ack [NUM_INT_VECTORS] = X{ X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0 X}; X X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE. X ============================================ X*/ X X/* array of structures to hold all info for a physical minor device */ Xstruct fas_info fas_info [NUM_PHYSICAL_UNITS]; X X/* array of ttys for logical minor devices */ Xstruct tty fas_tty [NUM_PHYSICAL_UNITS * 2]; X X/* array of pointers to fas_info structures X this prevents time consuming multiplications for index calculation X*/ Xstruct fas_info *fas_info_ptr [NUM_PHYSICAL_UNITS]; X X/* array of pointers to fas_tty structures X this prevents time consuming multiplications for index calculation X*/ Xstruct tty *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2]; SHAR_EOF true || echo 'restore of space-ast4 failed' rm -f _shar_wnt_.tmp fi # ============= space-c1-2 ============== if test -f 'space-c1-2' -a X"$1" != X"-c"; then echo 'x - skipping space-c1-2 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting space-c1-2 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'space-c1-2' && X/* Async device configuration file for the FAS async driver. */ X X/* This version is for the standard COM1 and COM2 ports. X*/ X X/* Originally written by XJim Murray encore!cloud9!jjmhome!jjm X2 Mohawk Circle harvard!m2c!jjmhome!jjm XWestboro Mass 01581 jjm%jjmhome@m2c.m2c.org XUSA voice (508) 366-2813 X*/ X X/* Current author: XUwe Doering Domain : gemini@geminix.in-berlin.de XBillstedter Pfad 17 b Bangpath : ...!unido!fub!tmpmbx!geminix!gemini X1000 Berlin 20 XGermany X*/ X X#ident "@(#)space.c 2.07" X X#if defined (XENIX) X#include "fas.h" X#else X#include <sys/fas.h> X#endif X X/* This is the number of devices to be handled by this driver. X You may define up to 16 devices. If this number is changed X the arrays below must be filled in accordingly. X*/ X#define NUM_PHYSICAL_UNITS 2 X X#if NUM_PHYSICAL_UNITS > MAX_UNITS X#undef NUM_PHYSICAL_UNITS X#define NUM_PHYSICAL_UNITS MAX_UNITS X#endif X X/* let the driver know the number of devices */ Xuint fas_physical_units = NUM_PHYSICAL_UNITS; X X/* array of base port addresses */ Xuint fas_port [NUM_PHYSICAL_UNITS] = X{ X 0x3f8, 0x2f8 X}; X X/* array of interrupt vectors */ Xuint fas_vec [NUM_PHYSICAL_UNITS] = X{ X 0x4, 0x3 X}; X X/* initialization sequence for serial card X This array contains pairs of values of the form: X X portaddress, value, X : X : X portaddress, value, X 0 X X For every line `value' will be written to `portaddress'. If X `value' is replaced with the macro `READ_PORT' then a value X is read from `portaddress' instead. The value itself will be X discarded. Therefor this makes only sense if the read access X to the port has a side effect like setting or resetting X certain flags. X X NOTE: This array *must* be terminated with a value of 0 X in the portaddress column! X*/ X Xuint fas_init_seq [] = X{ X 0 X}; X X/* initial modem control port info X This value is ored into the modem control value for each UART. This is X normaly used to force out2 which is used to enable the interrupts of X the standard com1 and com2 ports. Several brands of cards have modes X that allow them to work in compatible mode like com1 and com2 or as a X mux. One of these cards is the AST 4-port card. When this card is X used with the common interrupt out2 must not be set or there will be X a fight on the bus. X X Note: This is one of the major trouble-spots with mux cards. Check X your manual. X*/ X Xuint fas_mcb [NUM_PHYSICAL_UNITS] = X{ X MC_SET_OUT2, MC_SET_OUT2 X}; X X/* array of modem control flags X You can choose which signals to use for modem control. See fas.h X for possible names and values. Whether or not modem control is X used is determined by the minor device number at open time. X*/ Xuint fas_modem [NUM_PHYSICAL_UNITS] = X{ X EN_DTR | CA_DCD | UB_RING, X EN_DTR | CA_DCD | UB_RING X}; X X/* array of hardware flow control flags X You can choose which signals to use for hardware handshake. See fas.h X for possible names and values. Whether or not hardware handshake is X used is determined by the minor device number at open time or by the X RTSFLOW/CTSFLOW termio(7) flags. X*/ Xuint fas_flow [NUM_PHYSICAL_UNITS] = X{ X HI_RTS | HO_CTS_ON_DSR, X HI_RTS | HO_CTS_ON_DSR X}; X X/* additional configurations for multiplexed interrupt boards X If you have a mux board, you may have to acknowledge interrupts X by writing to a special register. There may be a separate register X for every single port or for every interrupt vector or both. X The following arrays contain the special register addresses and X the corresponding values that are written to them in response X to an interrupt. X*/ X X/* array of int ack register addresses X These registers are written to every time after all interrupt X sources in the corresponding UART have been cleared. X Enter the addresses on a per unit base. An address of zero X disables this feature. X*/ X Xuint fas_int_ack_port [NUM_PHYSICAL_UNITS] = X{ X 0, 0 X}; X X/* array of int ack values X These values are written to the corresponding int ack register X in response to an interrupt. X*/ X Xuint fas_int_ack [NUM_PHYSICAL_UNITS] = X{ X 0, 0 X}; X X/* array of int ack mux register addresses X These registers are written to every time after all interrupt X sources in all of the UARTs that are tied to the corresponding X interrupt vector have been cleared. X Enter the addresses on a per vector base. An address of zero X disables this feature. X*/ X Xuint fas_mux_ack_port [NUM_INT_VECTORS] = X{ X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0 X}; X X/* array of int ack mux values X These values are written to the corresponding int ack mux register X in response to an interrupt. X*/ X Xuint fas_mux_ack [NUM_INT_VECTORS] = X{ X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0 X}; X X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE. X ============================================ X*/ X X/* array of structures to hold all info for a physical minor device */ Xstruct fas_info fas_info [NUM_PHYSICAL_UNITS]; X X/* array of ttys for logical minor devices */ Xstruct tty fas_tty [NUM_PHYSICAL_UNITS * 2]; X X/* array of pointers to fas_info structures X this prevents time consuming multiplications for index calculation X*/ Xstruct fas_info *fas_info_ptr [NUM_PHYSICAL_UNITS]; X X/* array of pointers to fas_tty structures X this prevents time consuming multiplications for index calculation X*/ Xstruct tty *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2]; SHAR_EOF true || echo 'restore of space-c1-2 failed' rm -f _shar_wnt_.tmp fi # ============= space-c1-3 ============== if test -f 'space-c1-3' -a X"$1" != X"-c"; then echo 'x - skipping space-c1-3 (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting space-c1-3 (Text)' sed 's/^X//' << 'SHAR_EOF' > 'space-c1-3' && X/* Async device configuration file for the FAS async driver. */ X X/* This version is for the standard COM1 and COM2 and additional COM3 X ports. X*/ X X/* Originally written by XJim Murray encore!cloud9!jjmhome!jjm X2 Mohawk Circle harvard!m2c!jjmhome!jjm XWestboro Mass 01581 jjm%jjmhome@m2c.m2c.org XUSA voice (508) 366-2813 X*/ X X/* Current author: XUwe Doering Domain : gemini@geminix.in-berlin.de XBillstedter Pfad 17 b Bangpath : ...!unido!fub!tmpmbx!geminix!gemini X1000 Berlin 20 XGermany X*/ X X#ident "@(#)space.c 2.07" X X#if defined (XENIX) X#include "fas.h" X#else X#include <sys/fas.h> X#endif X X/* This is the number of devices to be handled by this driver. X You may define up to 16 devices. If this number is changed X the arrays below must be filled in accordingly. X*/ X#define NUM_PHYSICAL_UNITS 3 X X#if NUM_PHYSICAL_UNITS > MAX_UNITS X#undef NUM_PHYSICAL_UNITS X#define NUM_PHYSICAL_UNITS MAX_UNITS X#endif X X/* let the driver know the number of devices */ Xuint fas_physical_units = NUM_PHYSICAL_UNITS; X X/* array of base port addresses */ Xuint fas_port [NUM_PHYSICAL_UNITS] = X{ X 0x3f8, 0x2f8, 0x3e8 X}; X X/* array of interrupt vectors */ Xuint fas_vec [NUM_PHYSICAL_UNITS] = X{ X 0x4, 0x3, 0x9 X}; X X/* initialization sequence for serial card X This array contains pairs of values of the form: X X portaddress, value, X : X : X portaddress, value, X 0 X X For every line `value' will be written to `portaddress'. If X `value' is replaced with the macro `READ_PORT' then a value X is read from `portaddress' instead. The value itself will be X discarded. Therefor this makes only sense if the read access X to the port has a side effect like setting or resetting X certain flags. X X NOTE: This array *must* be terminated with a value of 0 X in the portaddress column! X*/ X Xuint fas_init_seq [] = X{ X 0 X}; X X/* initial modem control port info X This value is ored into the modem control value for each UART. This is X normaly used to force out2 which is used to enable the interrupts of X the standard com1 and com2 ports. Several brands of cards have modes X that allow them to work in compatible mode like com1 and com2 or as a X mux. One of these cards is the AST 4-port card. When this card is X used with the common interrupt out2 must not be set or there will be X a fight on the bus. X X Note: This is one of the major trouble-spots with mux cards. Check X your manual. X*/ X Xuint fas_mcb [NUM_PHYSICAL_UNITS] = X{ X MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2 X}; X X/* array of modem control flags X You can choose which signals to use for modem control. See fas.h X for possible names and values. Whether or not modem control is X used is determined by the minor device number at open time. X*/ Xuint fas_modem [NUM_PHYSICAL_UNITS] = X{ X EN_DTR | CA_DCD | UB_RING, X EN_DTR | CA_DCD | UB_RING, X EN_DTR | CA_DCD | UB_RING X}; X X/* array of hardware flow control flags X You can choose which signals to use for hardware handshake. See fas.h X for possible names and values. Whether or not hardware handshake is X used is determined by the minor device number at open time or by the X RTSFLOW/CTSFLOW termio(7) flags. X*/ Xuint fas_flow [NUM_PHYSICAL_UNITS] = X{ X HI_RTS | HO_CTS_ON_DSR, X HI_RTS | HO_CTS_ON_DSR, X HI_RTS | HO_CTS_ON_DSR X}; X X/* additional configurations for multiplexed interrupt boards X If you have a mux board, you may have to acknowledge interrupts X by writing to a special register. There may be a separate register X for every single port or for every interrupt vector or both. X The following arrays contain the special register addresses and X the corresponding values that are written to them in response X to an interrupt. X*/ X X/* array of int ack register addresses X These registers are written to every time after all interrupt X sources in the corresponding UART have been cleared. X Enter the addresses on a per unit base. An address of zero X disables this feature. X*/ X Xuint fas_int_ack_port [NUM_PHYSICAL_UNITS] = X{ X 0, 0, 0 X}; X X/* array of int ack values X These values are written to the corresponding int ack register X in response to an interrupt. X*/ X Xuint fas_int_ack [NUM_PHYSICAL_UNITS] = X{ X 0, 0, 0 X}; X X/* array of int ack mux register addresses X These registers are written to every time after all interrupt X sources in all of the UARTs that are tied to the corresponding X interrupt vector have been cleared. X Enter the addresses on a per vector base. An address of zero X disables this feature. X*/ X Xuint fas_mux_ack_port [NUM_INT_VECTORS] = X{ X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0 X}; X X/* array of int ack mux values X These values are written to the corresponding int ack mux register X in response to an interrupt. X*/ X Xuint fas_mux_ack [NUM_INT_VECTORS] = X{ X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0, X 0, 0, 0, 0 X}; X X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE. X ============================================ X*/ X X/* array of structures to hold all info for a physical minor device */ Xstruct fas_info fas_info [NUM_PHYSICAL_UNITS]; X X/* array of ttys for logical minor devices */ Xstruct tty fas_tty [NUM_PHYSICAL_UNITS * 2]; X X/* array of pointers to fas_info structures X this prevents time consuming multiplications for index calculation X*/ Xstruct fas_info *fas_info_ptr [NUM_PHYSICAL_UNITS]; X X/* array of pointers to fas_tty structures X this prevents time consuming multiplications for index calculation X*/ Xstruct tty *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2]; SHAR_EOF true || echo 'restore of space-c1-3 failed' rm -f _shar_wnt_.tmp fi rm -f _shar_seq_.tmp echo You have unpacked the last part exit 0 -- Uwe Doering | Domain : gemini@geminix.in-berlin.de Berlin |---------------------------------------------------------------- Germany | Bangpath : ...!unido!fub!tmpmbx!geminix!gemini