home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-05 | 53.4 KB | 1,494 lines |
- Newsgroups: comp.sources.misc
- From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
- Subject: v21i081: ecu - ECU async comm package rev 3.10, Part29/37
- Message-ID: <1991Aug5.211853.8161@sparky.IMD.Sterling.COM>
- X-Md4-Signature: ad7a457ff42f3918ef1866462a053278
- Date: Mon, 5 Aug 1991 21:18:53 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
- Posting-number: Volume 21, Issue 81
- Archive-name: ecu/part29
- Environment: SCO, XENIX, ISC
- Supersedes: ecu3: Volume 16, Issue 25-59
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is ecu310.29 (part 29 of ecu310)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file fasi/README.FASI continued
- #
- if touch 2>&1 | fgrep 'amc' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 29; 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 fasi/README.FASI'
- else
- echo 'x - continuing file fasi/README.FASI'
- sed 's/^X//' << 'SHAR_EOF' >> 'fasi/README.FASI' &&
- X
- XReasons to use:
- X
- X1. You get cumulative statistics on such things as receievd and
- Xtransmitted characters, modem signals and device errors. As an
- Xexample of the information available, the ecu interactive 'fasi'
- Xcommand produces:
- X
- Xbase address: 0218 irq=3 device is 16550
- XMSR=*CTS*DSR* MCR=*DTR*RTS*OUT2*
- XLCR=*8db*1sb*NOPAR* IER=*RDAV*TBMT*LS*MS*
- Xrecv ring cnt=0 xmit ring cnt=0 xmit fifo size=16
- Xcharacters received = 3097
- Xcharacters transmitted = 22407
- Xmodem status events = 137
- Xoverrun errors=0 framing errors=0 parity errors=0
- Xrings detected=0 breaks detected=0
- Xxmtr flow off XON/XOFF=0 RTS/CTS=31
- Xrcvr flow off XON/XOFF=0 RTS/CTS=0
- Xdriver: 'FAS/i 2.08.0'
- Xspace.c: 'FAS/i 2.08:{1,4,03f8-03ff,COM1},{8,3,0210-024f,DIGI-PC8}'
- X
- X2. There are no other reasons to use.
- X
- XReasons NOT to use:
- X
- X1. It is not supported. It is released configured for one COM1 (irq 4)
- Xand one 8-port Digiboard PC-8. I will help with any issue that I can,
- Xbut I will be very uninterested in answering questions like "How do I
- Xget FAS/i to work with my PacificRim ModemBlaster 4800?"
- X
- X2. It is less efficient than FAS. Statistics take CPU cycles to accumulate.
- XAlso, Uwe has done an indescribably superb job of optimizing the driver
- Xfor efficiency. I have not analyzed the effect my changes have made to
- Xthe micromanagment of emitted code Uwe did, but it cannot have but harmed.
- X
- X3. The driver is non-standard. It barks in the face of most of
- Xwhat I look for in well-produced software.
- X
- X4. Uwe will continue to work magic and this driver is unlikely to
- Xinherit it.
- X
- X5. FAS nor FAS/i appear to support DOS access to communications
- Xdevices through MERGE.
- X
- XNow, you say, why does that Tucker kid want to turn my tty driver
- Xinto a newt ("Well, [it] got better.")? Because it can be very useful
- Xif you are developing asychronous communications systems. I find
- Xit very useful to know how many times CTS fluctuated during a test
- Xsession. Like the 'ecufriend,' it isn't for everyone, but if you
- Xneed it, there it is.
- X
- X>Message-Id: <m0jXaOF-0000ElC@geminix.in-berlin.de>
- X>From: emory!geminix.in-berlin.de!gemini (Uwe Doering)
- X>Subject: Re: [Request permission to distribute FAS 2.08 instrumented version]
- X>To: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
- X>Date: Mon, 29 Apr 91 17:43:51 MES
- X>
- X>Hello Warren,
- X>
- X>>...I am writing is to ask your permission ...
- X>>to include with ecu a modified FAS 2.08 I am calling FAS/i (for
- X>>instrumentation) so you can have access to statistics
- X>> [some stuff deleted]
- X>
- X>You sent me the necessary patches some time ago. Since then I tried to
- X>make up my mind about this issue. I decided now that I won't have the
- X>patches in the official FAS release. There is a reason for that. I want
- X>to keep FAS as clean as possible from the application program standpoint.
- X>
- X[some stuff deleted]
- X>
- X>You have my permission to release your special FAS version, but please
- X>make it clear in the docs that _you_ do the support for it, and
- X>that it is no official FAS release.
- X>
- X> Uwe
- X>--
- X>Uwe Doering | INET : gemini@geminix.in-berlin.de
- X>Berlin |----------------------------------------------------------------
- X>Germany | UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
- X
- XThe strength of my earlier comments is driven in part by Uwe's comments.
- XI will be very disasppointed and red-faced if Uwe gets ONE query or
- Xrequest in regard to this hack. I will be similarly dismayed if he
- Xgets one comment pro or con about folding these features into the
- Xofficial FAS.
- X
- XThis is a dead-end, special-purpose junkbox addition that just happens
- Xto be potentially useful.
- X
- XNow, with all that out of the way, here are a few useful tidbits:
- X
- X1. Configuration and installation are for the most part similar to
- Xthe standard FAS as of this writing.
- X
- X2. You will need to manually create a /usr/include/local directory
- Xbefore you begin any makes.
- X
- X3. The original FAS 2.08 functionality may be restored by turning
- Xoff #define FASI in several places.
- X
- X4. It has been used only on SCO.
- X
- X5. To use with ECU, you'll need to hack -DFASI_IN_USE into the
- Xecu Makefile. The other programs in ecu don't need to know about it.
- X(Hint: ecufriends can make good use of the features.)
- X
- X6. If you turn on FAS/i support in ecu, you get the undocumented
- Xfasi interactive and procedure commands and these %functions:
- X
- XInteger functions:
- X%fasi defined for all ecu versions; returns 1 if FAS/i
- X support included, else 0 if not. The other functions
- X will cause procedure termination with undefined function
- X errors "ifi %fasi==0".
- X%msr MSR current value
- X%lnerr accumulated FE+OE+PE count
- X%ridet accumulated RI count
- X%brdet accumulated BREAK count
- X
- XString functions:
- X%msrtext MSR current value in string form for easier (less efficient)
- X MSR inspecition. You can do something like
- X
- X $s20 = %msrtext
- X ifi %instr($s20,'CTS')
- X echo 'CTS present'
- X ifi %instr($s0,'RING')
- X echo 'We are receiving a RING this very instant')
- XThe returned string is one or more substrings separated by asterisks.
- XSo, you might get 'CTS*DSR*RING*'. The list of substrings, one for each
- Xbit in the canonized 8250 MSR:
- X
- XdCTS delta CTS <---+
- XdDSR delta DSR | you are unlikely to see these
- XdRI delta RI | since the driver catches interrupts
- XdDCD delta DCD <----
- XCTS
- XDSR
- XRING
- XDCD
- X
- X7. The fasiintf.c modules contains examples of each FAS/i-specific
- Xioctl. These are also the only 'documentation' ever likely to be
- Xproduced for them other than this list:
- X
- XFASIC_SIP get entire fas_info struct
- XFASIC_MSR get various registers
- XFASIC_LCR
- XFASIC_IER
- XFASIC_MCR
- XFASIC_DVR_IDENT get driver revision
- XFASIC_SPACE_IDENT get space.c revision
- XFASIC_RESET_STAT reset statistics
- X
- X8. This hacked 'release' is in the style of a purpose-specific
- Xdriver. If you have an SCO UNIX 3.2.x system with a standard COM1
- Xport and a Digiboard PC-8 on COM2, man are you in luck. Otherwise,
- X
- X while(!bored && !fed_up && !success)
- X {
- X adopt();
- X adapt();
- X improve();
- X } /* "... I always say." -- thanks to John Cleese */
- X exit(!success);
- X
- SHAR_EOF
- echo 'File fasi/README.FASI is complete' &&
- $TOUCH -am 0709233191 'fasi/README.FASI' &&
- chmod 0644 fasi/README.FASI ||
- echo 'restore of fasi/README.FASI failed'
- Wc_c="`wc -c < 'fasi/README.FASI'`"
- test 6394 -eq "$Wc_c" ||
- echo 'fasi/README.FASI: original size 6394, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= fasi/RELEASENOTES ==============
- if test -f 'fasi/RELEASENOTES' -a X"$1" != X"-c"; then
- echo 'x - skipping fasi/RELEASENOTES (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting fasi/RELEASENOTES (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'fasi/RELEASENOTES' &&
- XThis is the original RELEASENOTES from FAS 2.08 for reference only.
- XRead README.FASI. DO NOT CONTACT UWE DOERING REGARDING THIS HACKED VERSION
- X ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- X
- X release 1.1a Sat Nov 11, 1989
- X
- X This is an unofficial release as I'm not the original author
- X of this async driver.
- X
- X Uwe Doering INET : gemini@geminix.in-berlin.de
- X Billstedter Pfad 17 b UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
- X 1000 Berlin 20
- X Germany
- X
- X New Features:
- X
- X Added a third minor tty device number for every physical
- X port. See description preceding the asyopen function in
- X asy.c. Changed the behavior of ttyxx, too.
- X
- X Added output hardware handshake support for DSR. Now you
- X can do handshake with CTS, DSR or both. Input hardware
- X handshake is on if you use at least one of the output
- X handshake signals.
- X
- X More flexible support of additional interrupt registers
- X on mux boards. This is fully configurable now.
- X
- X Added support for the CREAD flag. If not set, receiver
- X interrupts are still serviced, but the received characters
- X are simply thrown away. This is not as elegant as disabeling
- X the interrupts themselves, but with the already existing
- X driver it was the easiest way, and the most new-bugs-preventing,
- X too.
- X
- X Added a lot of comments to the source so that the curious
- X user can understand why and how things are done.
- X
- X
- X Bug Fixes:
- X
- X The hang-up-on-last-close flag (HUPCL) was ignored. DTR
- X was asserted regardless of this flag.
- X
- X Made the detection of CTS and DCD more bullet-proof.
- X Especially because between a close and the next open of
- X a line, where interrupts are ignored, the software copys of
- X CTS and DCD must be set up propperly in the asyopen function
- X or the tty line would be blocked under certain circum-
- X stances. For similar reasons, there is also a setup in the
- X asyparam function.
- X
- X Rewrote the input character processing function to work
- X according to the TERMIO(7) man page.
- X
- X Changed the behavior of BREAK generation to let the
- X transmitter drain before TX is set to low.
- X
- X Changed line hangup procedure so that the closing
- X process returns immediately and doesn't sleep during
- X the hangup delay/time. Instead, if an other process tries
- X to open the line while hangup is still in progress, this
- X process will sleep until hangup is competed.
- X
- X With DOS Merge, on MicroPort V/386 3.0e the linker was
- X missing the function `init8250'. Reengineered this from
- X a disassembler listing of MicroPort's original driver and
- X modified it to work with the NS16550A 16-byte FIFO. This
- X funktion was added simply to be able to link the kernel.
- X DOS Merge's virtual COM ports are still unusable with this
- X release, though. To include this function, add a `-DMERGE'
- X to the CFLAGS line in your makefile.
- X
- X Made a lot of other corrections and enhancements in both
- X speed and functionallity. As a result of all my effords
- X I think this driver is slightly faster, more versatile
- X and much more stable than the original release.
- X
- X ------------------------------------------------------------
- X
- X release 1.1b Sat Nov 25, 1989
- X
- X New Features:
- X
- X Changed the minor device number scheme again.
- X There are now two main groups: The unblocked open
- X and the blocked open. Every group has four sub-modes
- X and an additional hardware handshake flag. All this
- X is coded in the higher four bits of the minor device
- X number. Because of this, the maximum of 32 ports was
- X reduced to 16 ports so that the port number fits into
- X the remaining lower four bits of the minor device number.
- X 32 dumb ports in a single machine would have been overkill
- X anyway. For more details refer to the description in the
- X README file.
- X
- X ------------------------------------------------------------
- X
- X release 2.00 Mon Nov 27, 1989
- X
- X As this release differs so much from the original version I got,
- X I now declare this as independant from the original author
- X Jim Murray. This allows me to introduce new release levels
- X without wondering whether they will collide with Jim's releases.
- X Of course many credits to Jim for writing this software in the
- X first place. Without his driver as a base I never would have
- X been able to do such kernel driver development.
- X
- X Bug Fixes:
- X
- X If there were glitches on the hardware handshake lines
- X and the DCD line a getty on this port would sometimes
- X hang and become an immortal process. I think this was
- X because the output buffer wasn't flushed properly
- X on carrier loss. I hope I fixed this now. We'll see.
- X
- X ------------------------------------------------------------
- X
- X release 2.01 Tue Nov 28, 1989
- X
- X Did some cleanup in the source code.
- X
- X I splitted the driver into two parts: The driver itself and
- X the file `space.c'.
- X `space.c' contains all data structures necessary to configure
- X the driver and is compiled at kernel link time. Therefore if you
- X change your serial card configuration you simply change `space.c'
- X directly in the link kit directory and relink the kernel. No
- X driver recompilation or installation is necessary for this.
- X But note that whenever you use `make install' your setup in
- X the link kit directory is overwritten by the original `space.c'
- X file. Therefore you should copy your new `space.c' back to
- X the source directory when you are finished with the configuration.
- X
- X Renamed the package to `FAS Final Async Solution'. The following
- X files have been renamed:
- X asy.c -> fas.c
- X asy.h -> fas.h
- X asy_conf-xxxxx -> space-xxxxx
- X
- X ISC 386/ix is supported now. There are separate makefiles
- X for uPort and ISC to cope with the differences in link kit
- X installation.
- X
- X Bug Fixes:
- X
- X `getty' still hung sometimes on a line with hardware
- X handshake. Tried to fix it this time.
- X
- X ------------------------------------------------------------
- X
- X release 2.02 Thu Nov 30, 1989
- X
- X Abandoned the distinction between space-xxxxx files with
- X and without hardware flow control because this is selected
- X by the minor device number now.
- X
- X Bug Fixes:
- X
- X Set the high and low water marks for hardware input flow
- X control to higher values than software flow control. This
- X gives precedence to software flow control if both methods
- X are used. These marks are self-adjusting and don't need to
- X be changed if some flavor of UNIX has a different buffer
- X size than the standard 256 characters. Before this change
- X concurrent use of both flow controls could cause trouble
- X with some high-speed modems. This is fixed now.
- X
- X A flush read or write buffer request now also clears the
- X receiver or transmitter FIFO, respectively. An ioctl
- X call with a TCSETA* command clears the FIFOs, too.
- X
- X ------------------------------------------------------------
- X
- X release 2.03 Fri Dec 01, 1989
- X
- X Wrote an installation guide. The driver should be quite
- X easy to install now.
- X
- X Added tty node configuration files for ISC.
- X
- X Hardware input flow control is bound now to the level of the
- X receiver ring buffer instead of the UNIX input buffer. This
- X has the advantage that buffer size and trigger levels are
- X defined in the driver and therefore can be varied as needed.
- X
- X New Features:
- X
- X Added a boot time status message that shows the init
- X state of each port. This tells you immediately what
- X ports are found and initted by the driver. Useful to
- X determine hardware configuration problems. Look at
- X the description in the README file. Thanks to
- X Kritt Gierlewsen (kritt@einoed.UUCP) for this proposal.
- X
- X ------------------------------------------------------------
- X
- X release 2.04 Thu Dec 07, 1989
- X
- X Did some cleanup in the source.
- X
- X Removed the FIFO clear from the ioctl function. We don't want
- X to do things there that aren't in the book.
- X
- X An ioctl call that switches off the CLOCAL flag will create
- X a SIGHUP signal if the carrier is actually missing at this
- X time.
- X
- X Every device is tested now quite thoroughly during initialization.
- X If the test fails the corresponding device keeps unconfigured.
- X
- X ------------------------------------------------------------
- X
- X release 2.05 Sat Jan 13, 1990
- X
- X This is the first public release of the FAS driver.
- X
- X Special thanks to the sysops of my test sites, Axel Fischer
- X (fischer@utower.UUCP) and Kritt Gierlewsen (kritt@einoed.UUCP).
- X
- X FAS is now an independant driver with its own driver name (`fas'),
- X major device number, link kit directory and other things necessary
- X for a driver. The original asy driver may or may not be linked
- X with the kernel. You only need it if you want to access some
- X serial devices via the virtual COM ports of the DOS emulator
- X (DosMerge or VP/ix) because the FAS driver doesn't have this
- X (really vendor dependant) feature.
- X
- X The default prefix for tty device node names is `ttyF' now.
- X This prevents mix-ups with the device names of the original
- X asy driver.
- X
- X Dropped the SYSV/AT support. I couldn't test the driver
- X for several release generations on uPort SYSV/AT, and because
- X there are not very much systems left with that flavor of UNIX
- X it doesn't make sense to try to maintain compatibility with it.
- X If someone really wants to use this driver on a 286 he has
- X to port it himself.
- X
- X Improved the transmitter FIFO fill procedure. Now it will try
- X harder to fill the FIFO as much as possible to cut down on
- X transmitter interrupts.
- X
- X Software input flow control (XON/XOFF) is controlled by the driver now.
- X It is bound to the level of the receiver ring buffer (as is hardware
- X flow control). As usual, it can be switched on and off by the
- X IXOFF flag in the termio(7) structure.
- X
- X Changed and speeded up the ring buffer -> unix buffer processing.
- X
- X For ISC, the getty lines for the inittab file are installed
- X by the makefile now.
- X
- X The conditional compilation of the function `init8250' (for
- X DosMerge) is now controlled by a define in `fas.h'. The compiler
- X switch `-DMERGE' is not used any more.
- X
- X Improved the documentation.
- X
- X The signals used for modem control and hardware flow control are
- X fully configurable in the `space.c' file now. Look at `fas.h' for
- X possible macros and combinations.
- X
- X There are some new modes for hardware flow control, for instance
- X HO_CTS_ON_DSR. This means that CTS is only looked at if DSR is on.
- X If DSR is off output is possible regardless of CTS. The underlying
- X assumption here is that we can expect proper handshake handling
- X only from devices that are in the ready state (indicated by DSR).
- X As a spin-off the problem with the hanging getty on lines with
- X turned-off terminals (mentioned in earlier releases) should be
- X gone if you use this new mode.
- X
- X If the XCLUDE-Flag is availabe (SYSV 3.2 because of Xenix
- X compatibility) exclusive open of a device is possible.
- X
- X The default size of the input ring buffer is now 5000 bytes.
- X This makes streaming input more likely even on loaded systems.
- X
- X Bug Fixes:
- X
- X The task state busy flag wasn't reset in some rare cases.
- X This could cause processes to become immortal while waiting
- X for the busy flag.
- X
- X Under some special conditions an ioctl call with a TCSETA?
- X command could corrupt the last character in the transmitter
- X shift register. This is fixed now.
- X
- X More fixing of the busy flag handling was necessary.
- X Co-ordinating several delayed tasks controlling this flag
- X is kind of tricky.
- X
- X After a TCSETA* ioctl command we disable the transmitter
- X for 2 sec (measured from the last transmitted character)
- X if the character format and/or speed has changed. This
- X gives the receiving side some time to do the same changes.
- X This is kind of experimental. There may be applications that
- X suffer from this delay. You may change the #define ADAPT_TIME
- X in `fas.h' to a smaller value.
- X
- X ------------------------------------------------------------
- X
- X release 2.06 Fri Mar 16, 1990
- X
- X This should have been patch #3 for release 2.05, but there are
- X so many changes now that I decided to make it a new release.
- X Therefor some of the changes are described in the 2.05 release
- X notes above but were never released to the public.
- X
- X New Features:
- X
- X There is a transmitter ring buffer now to make the output
- X less system load dependent. This really speeds things up
- X because the transmitter FIFO gets filled with more characters
- X at once. The buffer size depends on the actual baud rate to
- X prevent long output buffer drains at low speeds.
- X
- X There are also bigger input buffers to make FAS more competitive
- X against "intelligent" cards.
- X
- X Lots of speed improvements and many small changes.
- X
- X Bug Fixes:
- X
- X Fixed input/output buffer flush on carrier loss while close
- X is waiting for the output to drain.
- X
- X ------------------------------------------------------------
- X
- X release 2.07 Tue Sep 18, 1990
- X
- X This is a major redesign of the previous release. I put most of the
- X time consuming tasks in one function that is invoked asynchronously
- X by timeout calls. Inside this function most of the code runs at
- X a lower system priority level (spl5) than the interrupts. That
- X means that during character processing tty interrupts are allowed.
- X This is the main key to operation at 38400 bps on multiple ports
- X at the same time which is possible now with this release.
- X
- X New Features:
- X
- X FAS supports the VP/ix DOS emulator!
- X Now you can throw out the vendor's original driver even
- X if you like to have a serial mouse or modem access in DOS.
- X Read the paragraph about VP/ix in the README file.
- X
- X The Intel i82510 port chip is supported. It has separate
- X 4-character FIFOs for input and output. Although the
- X NS16550A is much better this chip is your second choice
- X if you can't get your hands on the National chips.
- X Thanks to Christian Seyb (cs@gold.UUCP) for sending me
- X patches and the necessary documentation for the Intel
- X chips.
- X
- X There is an init sequence in `space.c'. You can put any
- X number of address-data pairs in a null terminated array
- X to program your serial card or other hardware before
- X FAS makes the first access to the ports. AST 4-port cards,
- X for instance, have an additional port that needs to be
- X written to with a certain bit pattern to allow shared
- X interrupts. If you need to read a port to achieve the
- X setting or resetting of flags as a side effect, this
- X is possible, too.
- X
- X ESIX is officially supported now.
- X
- X SCO UNIX is officially supported, too. FAS needs to be
- X compiled with the command line flag `-DSCO'. The makefile
- X for SCO takes care of that. Thanks to Walter Mecky
- X (walter@mecky.systemware.de) and Frank Simon
- X (terra@sol.north.de) for helping me in making the necessary
- X changes for SCO UNIX.
- X
- X SCO Xenix 386 is also officially supported. FAS needs to be
- X compiled with the command line flag `-DXENIX'. The makefile
- X for SCO Xenix takes care of that. Thanks to Andreas
- X Steinmetzler (andreas@oil.UUCP) for doing the port.
- X
- X If you have the RTSFLOW and CTSFLOW termio(7) flags,
- X hardware handshake can be controlled by them.
- X Note that enabling handware flow control via the
- X minor device number overrides these flags. If you
- X like to use them you need to create tty device nodes
- X with minor device numbers in which the bit for hardware
- X handshake is set to 0. Look at the description in the
- X README file for more details.
- X Note also that if you choose to use RTSFLOW and CTSFLOW
- X all your programs that do initial access to tty devices
- X (getty, uucico, cu, SLIP dialup program etc.) need to know
- X about these flags or hardware handshake will not be used.
- X
- X The `O_EXCL' flag for the open(2) call is honored now.
- X This allowes exclusive access to an FAS device without
- X suffering from race conditions which could occure with
- X the termio(7) XCLUDE flag method.
- X
- X The `fas_test_device' function returns a digit now that
- X indicates at which phase the test exited due to an error.
- X This error digit is displayed in the boot message. Thanks
- X to Brian Beattie (beattie@visenix.UUCP) for sending me
- X the necessary patches.
- X
- X Bug Fixes:
- X
- X Automatic input FIFO flush after unblocking the getty
- X open by the carrier or the unblock signal. This makes sure
- X that there is no chance that there are characters in the
- X FIFO that were received before the open got unblocked.
- X
- X The sdevice entry for the AST 4-port card had a wrong
- X I/O address range (`s_fas-mux4'). This didn't affect FAS
- X but is checked by the kernel config program.
- X
- X The gcc (GNU cc) support was removed because gcc's object
- X file wants to link in some "helpful" functions that aren't
- X contained in the kernel. But anyway, FAS is tuned so carefully
- X and depends on the optimization behaviour of the AT&T
- X standard C compiler that gcc won't have any advantages.
- X
- X I changed the method with which the `fas_test_device' function
- X waits for certain events. The `delay' function was used
- X for that purpose but it turned out that with some flavors
- X of UNIX it is prohibited to use this function during the
- X xxinit phase of the boot process. Now a simple timeout loop
- X is used instead.
- X
- X Removed the ADAPT_TIME mechanismn introduced in release 2.05.
- X
- X The open() call now returns an `EBUSY' error number if the
- X device is already open and can't be opened in the desired
- X mode at this time.
- X
- X The handling of the RING signal needed fixing. Unlike the other
- X three modem status lines RING generates an interrupt only at
- X the trailing edge.
- X
- X No SIGHUP signal is sent any more if an ioctl call clears
- X the CLOCAL termio(7) flag while there is no carrier present.
- X SIGHUP is only sent if the actual DCD modem line drops.
- X
- X The files *-mux4 were renamed to *-ast4 because this type of
- X card was originally developed by AST (AST 4-port card).
- X
- X ------------------------------------------------------------
- X
- X release 2.08 Sun Jan 13, 1991
- X
- X New Features:
- X
- X Bell Tech/Intel UNIX 3.2 is supported.
- X
- X SCO Xenix 286 is also supported now. Thanks to Nickolay Saukh
- X (nms@saukh.rd.jvd.su) for providing the patches.
- X
- X The Bell Tech HUB-6 card can be used with FAS. Thanks to
- X Keith Walker (kew@cims2.UUCP) for the patches.
- X
- X For AT&T derived flavors of UNIX there is a line automatically
- X added to the kernel description file that makes the adding
- X and removing of FAS possible via the `kconfig' program. Thanks
- X to John Adams (johna@grumpy.boston.ma.us) for this idea.
- X
- X There is a mechanismn now that prevents excessive modem status
- X interrupts caused by crosstalking between wires or by a loose
- X cable.
- X
- X You can disable the FIFOs in a UART by "oring" the macro
- X `NO_FIFO' to the base port address of this device. This is
- X useful for mouse devices where you need immediate response
- X to the mouse movement.
- X
- X The meaning of the bit mapped part of the minor device
- X numbers has changed. Some rather useless functions were
- X removed in favor of more control over the hardware handshake
- X modes. Even systems where the SCO RTSFLOW/CTSFLOW termio(7)
- X flags are not available can now use half duplex hardware
- X flow control (selected via the minor device number).
- X
- X The assignment of RS232C lines to certain FAS functions
- X is even more flexible now. This allows to connect two
- X UNIX systems (with FAS) via a null modem cable, running
- X a getty at both ends. For more details, read the paragraph
- X about CABLING in the README file.
- X
- X A special handling of the NS16550A input FIFO was introduced.
- X This causes multiple receiver interrupts (on the same IRQ
- X line) to be synchronized so that only one interrupt is
- X necessary to process all receiving ports. This reduces the
- X interrupt handling overhead and therefor results in lower
- X CPU load for concurrent serial input at high speeds.
- X
- X The `fas_event' function processes all scheduled events
- X for all units with one single call. Previously, every unit
- X launched its own timeout() call if there was work to
- X do. This could lead to up to 16 timeouts at the same time,
- X resulting in some timeout handling overhead. This overhead
- X is minimized now.
- X
- X Bug Fixes:
- X
- X There were two bugs that could cause a port to lock up,
- X resulting in an immortal process.
- X
- X Almost any kernel sleep is killable now (at least with one or
- X two `kill -9'). Therefor, there should be no more immortal
- X processes. Even killing a process that is hanging in a
- X close-on-exit call is possible.
- X
- X The meaning of the RTSFLOW/CTSFLOW termio(7) flags was converted
- X to what SCO had in mind (half duplex flow control). This is for
- X compatibility reasons. Full duplex RTS/CTS hardware flow control
- X is still possible via the minor device number method. Thanks to
- X Dmitry V. Volodin (dvv@hq.demos.su) for providing me with the
- X necessary knowledge.
- X
- X If a process is already sleeping in a getty open it will only
- X unblock on DCD low->high. In particular, if in the meantime
- X the device was open for dialout and DCD is still present if
- X the getty open takes over again this won't unblock the getty
- X open any more.
- X
- X And there were, as usual, a number of other small bug fixes.
- SHAR_EOF
- $TOUCH -am 0709233291 'fasi/RELEASENOTES' &&
- chmod 0644 fasi/RELEASENOTES ||
- echo 'restore of fasi/RELEASENOTES failed'
- Wc_c="`wc -c < 'fasi/RELEASENOTES'`"
- test 23494 -eq "$Wc_c" ||
- echo 'fasi/RELEASENOTES: original size 23494, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= fasi/Space.c ==============
- if test -f 'fasi/Space.c' -a X"$1" != X"-c"; then
- echo 'x - skipping fasi/Space.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting fasi/Space.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'fasi/Space.c' &&
- X/* Async device configuration file for the FAS async driver. */
- X
- X/*
- X * COM1(STD) + COM2(DIGIBOARD PC-8)
- X */
- X/*+:EDITS:*/
- X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
- X/*:01-20-1991-16:17-wht@n4hgf-add fas_names */
- X/*:01-20-1991-05:01-wht@n4hgf-changed buffer sizes */
- X/*:01-16-1991-22:13-wht@n4hgf-creation */
- X
- X/* FAS was developed by ( ==> BUT DO NOT CONTACT HIM ABOUT THIS HACK )
- XUwe Doering INET : gemini@geminix.in-berlin.de
- XBillstedter Pfad 17 b UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
- X1000 Berlin 20
- XGermany
- X*/
- X
- X/* Alas, SCO idinstall has no -z (Define) option like ISC does */
- X#if !defined(FASI)
- X#define FASI
- X#endif
- X#if !defined(SCO)
- X#define SCO
- X#endif
- X
- X#if defined(FASI)
- X/* {quan,irq,addr1-addr2,type} */
- Xchar *fasi_space_ident =
- X"FAS/i 2.08:{1,4,03f8-03ff,COM1},{8,3,0210-024f,DIGI-PC8}";
- X#endif /* FASI */
- X
- X#if !defined (M_I286) && !defined(__STDC__) && !defined(__GNUC__)
- X#ident "@(#)space.c 2.08.0 COM1(STD) + COM2(DIGIBOARD PC-8)";
- X#endif
- X
- X#include <sys/param.h>
- X#include <sys/types.h>
- X#include <sys/signal.h>
- X#include <sys/buf.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) && !defined(CBAUD)
- X#include <sys/termio.h>
- X#endif
- X#include <sys/ioctl.h>
- X#if !defined(FASI)
- X#include <macros.h>
- X#endif
- 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#if defined (XENIX)
- X#include "fas.h"
- X#include "digi-pc8.h"
- X#else
- X#include <local/fas.h>
- X#include <local/digi-pc8.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 9
- 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
- X If you deliberately want to force off the FIFOs of a UART you have
- X to "or" the NO_FIFO macro to its base port address. This is useful
- X for mouse devices where you need immediate response to the mouse
- X movement.
- X*/
- Xulong fas_port [NUM_PHYSICAL_UNITS] =
- X{
- X 0x3f8,
- X COM21, COM22, COM23, COM24,COM25, COM26, COM27, COM28
- X};
- X
- X/*
- X * array of port names
- X * Note this is a kludge to enable kmem seeking programs to
- X * determine which tty is associated with which tty struct
- X * and is <yetch> duplication of information appearing in
- X * the Node (/etc/node.d/fas) file
- X */
- X#if defined(FASI)
- Xstruct fas_name fas_names[NUM_PHYSICAL_UNITS * 2] =
- X{
- X {"1a"},
- X {"2a"}, {"2b"},{"2c"},{"2d"},{"2e"},{"2f"},{"2g"},{"2h"},
- X {"1A"},
- X {"2A"}, {"2B"},{"2C"},{"2D"},{"2E"},{"2F"},{"2G"},{"2H"}
- X};
- X#endif
- X
- X/* array of interrupt vectors */
- Xuint fas_vec [NUM_PHYSICAL_UNITS] =
- X{
- X 4,
- X 3,3,3,3,3,3,3,3
- 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*/
- 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 shared interrupts card. One of these cards is the AST 4-port card. When
- X this card is used in shared interrupts mode out2 must _not_ be set.
- X
- X Note: This is one of the major trouble-spots with shared interrupts
- X cards. Check your manual.
- X*/
- Xuint fas_mcb [NUM_PHYSICAL_UNITS] =
- X{
- X MC_SET_OUT2,
- X MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2,
- X MC_SET_OUT2, 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*/
- Xulong fas_modem [NUM_PHYSICAL_UNITS] =
- X{
- X EO_DTR | EI_DTR | CA_DCD,
- X EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD,
- X EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD,
- X EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD,
- X EO_DTR | EI_DTR | CA_DCD, EO_DTR | EI_DTR | CA_DCD
- 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 and by the
- X RTSFLOW/CTSFLOW termio(7) flags.
- X*/
- Xulong fas_flow [NUM_PHYSICAL_UNITS] =
- X{
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
- X HI_RTS | HO_CTS_ON_DSR | HX_RTS
- X};
- X
- X/* array of control register addresses
- X There are serial boards available that have all serial ports
- X multiplexed to one address location in order to save I/O address
- X space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
- X by a special register that needs to be written to before the actual
- X port registers can be accessed. This array contains the addresses
- X of these special registers.
- X Enter the addresses on a per unit base. An address of zero
- X disables this feature.
- X*/
- Xuint fas_ctl_port [NUM_PHYSICAL_UNITS] =
- X{
- X 0,
- X 0, 0, 0, 0, 0, 0, 0, 0
- X};
- X
- X/* array of control register values
- X These values are written to the corresponding control register
- X before the first access to the actual port registers. If not only
- X entire UART chips (blocks of 8 contiguous addresses) but even the
- X single registers of the UART chips need to be multiplexed to one
- X address you have to "or" a bit mask (shifted 8 times to the left)
- X to the control register value. This mask determines at which bit
- X locations the UART chip register number is "xored" into the control
- X register value at runtime. This implies that you can also use
- X negative logic by setting the bits in the control register value
- X to 1 at the locations corresponding to the bit mask.
- X*/
- Xuint fas_ctl_val [NUM_PHYSICAL_UNITS] =
- X{
- X 0,
- X 0, 0, 0, 0, 0, 0, 0, 0
- X};
- X
- X/* additional configurations for shared interrupts boards
- X If you have a shared interrupts board, you may have to acknowledge
- X interrupts by writing to a special register. The following arrays
- X contain the special register addresses and the corresponding values
- X that are written to them in response 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 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*/
- Xuint fas_int_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 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 values
- X These values are written to the corresponding int ack register
- X in response to an interrupt.
- X*/
- Xuint fas_int_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 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
- $TOUCH -am 0725125791 'fasi/Space.c' &&
- chmod 0644 fasi/Space.c ||
- echo 'restore of fasi/Space.c failed'
- Wc_c="`wc -c < 'fasi/Space.c'`"
- test 8680 -eq "$Wc_c" ||
- echo 'fasi/Space.c: original size 8680, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= fasi/System ==============
- if test -f 'fasi/System' -a X"$1" != X"-c"; then
- echo 'x - skipping fasi/System (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting fasi/System (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'fasi/System' &&
- Xfas Y 1 7 1 4 3f8 3ff 0 0
- Xfas Y 1 7 1 3 210 250 0 0
- SHAR_EOF
- $TOUCH -am 0604201191 'fasi/System' &&
- chmod 0644 fasi/System ||
- echo 'restore of fasi/System failed'
- Wc_c="`wc -c < 'fasi/System'`"
- test 52 -eq "$Wc_c" ||
- echo 'fasi/System: original size 52, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= fasi/digi-pc8.h ==============
- if test -f 'fasi/digi-pc8.h' -a X"$1" != X"-c"; then
- echo 'x - skipping fasi/digi-pc8.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting fasi/digi-pc8.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'fasi/digi-pc8.h' &&
- X/*+-------------------------------------------------------------------------
- X digi-pc8.h - Digiboard PC-8 with SCO COM2 addressing conventions
- X wht@n4hgf.Mt-Park.GA.US
- X--------------------------------------------------------------------------*/
- X/*+:EDITS:*/
- X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
- X/*:12-24-1991-03:23-wht@n4hgf-creation */
- X
- X#define COM21 0x210 /* digi board */
- X#define COM22 0x218
- X#define COM23 0x220
- X#define COM24 0x228
- X#define COM25 0x230
- X#define COM26 0x238
- X#define COM27 0x240
- X#define COM28 0x248
- X#define COM2S 0x250
- X
- X/* vi: set tabstop=4 shiftwidth=4: */
- X/* end of digi-pc8.h */
- SHAR_EOF
- $TOUCH -am 0725125791 'fasi/digi-pc8.h' &&
- chmod 0644 fasi/digi-pc8.h ||
- echo 'restore of fasi/digi-pc8.h failed'
- Wc_c="`wc -c < 'fasi/digi-pc8.h'`"
- test 612 -eq "$Wc_c" ||
- echo 'fasi/digi-pc8.h: original size 612, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= fasi/fas.c ==============
- if test -f 'fasi/fas.c' -a X"$1" != X"-c"; then
- echo 'x - skipping fasi/fas.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting fasi/fas.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'fasi/fas.c' &&
- X/* FAS Final Async Solution driver for 286/386 versions of system V UNIX */
- X
- X/* FAS was developed by
- XUwe Doering INET : gemini@geminix.in-berlin.de
- XBillstedter Pfad 17 b UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
- X1000 Berlin 20
- XGermany
- X*/
- X/*+:EDITS:*/
- X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
- X/*:06-04-1991-19:41-wht@n4hgf-add FASIC_SIP_CHANGE */
- X/*:02-05-1991-12:13-wht@n4hgf-apply 2.08b2->2.08.0 diffs */
- X/*:01-20-1991-05:01-wht@n4hgf-changed buffer sizes */
- X
- X#if defined(FASI)
- Xchar *fasi_driver_ident = "FAS/i 2.08.01";
- X#endif /* FASI */
- X
- X#if !defined (M_I286) && !defined(__STDC__)
- X#ident "@(#)fas.c 2.08"
- X#endif
- X
- X/* Note: This source code was quite heavily optimized for speed. You
- X may wonder that register variables aren't used everywhere.
- X This is because there is an overhead in memory accesses
- X when using register variables. As you may know data accesses
- X usually need much more wait states on the memory bus than
- X code accesses (because of page or cache misses). Therefor,
- X saving some data accesses has higher priority than saving
- X code accesses.
- X
- X You may also note some not very elegant constructions that
- X may be intentional because they are faster. If you want to
- X make style improvements you should check the assembler output
- X whether this wouldn't slow things down.
- X
- X Decisions for speed optimization were based on assembler
- X listings produced by the standard UNIX V 3.X/386 C compiler.
- X*/
- X
- X#include <sys/param.h>
- X#include <sys/types.h>
- X#include <sys/signal.h>
- X#include <sys/buf.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) && !defined(CBAUD)
- X#include <sys/termio.h>
- X#endif
- X#include <sys/ioctl.h>
- X#if !defined(FASI)
- X#include <macros.h>
- X#endif
- 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#if defined (XENIX)
- X#include "fas.h"
- X#else
- X#include <local/fas.h>
- X#if !defined (NO_ASM)
- X#include <sys/inline.h>
- X#endif
- X#endif
- X
- X#if defined (SCO) || defined (XENIX)
- X#define asyputchar sioputchar
- X#define asygetchar siogetchar
- X#endif
- X
- X#if defined (XENIX) || defined (NO_ASM)
- X#define intr_disable() old_level = SPLINT ()
- X#define intr_restore() (void) splx (old_level)
- X#define REGVAR
- X#else
- X/* This is a terrible ugly kludge to speed up the `inb' and `outb'
- X functions. I.e., originally, the `outb' inline function had an
- X overhead of four data memory accesses for parameter passing. This
- X parameter passing actually consumed more clock cycles than the
- X assembler `outb' command itself. Although this solution can't
- X prevent unnessessary register moves it limits them at least to
- X register to register moves that are much faster. You need a
- X line like the following in the declaration part of every
- X function that uses `inb' or `outb' calls:
- X
- X REGVAR;
- X
- X This hack should work with every compiler that knows about the
- X UNIX V 3.X/386 standard compiler's inline assembler directives.
- X*/
- X
- Xasm void loadal (val)
- X{
- X%reg val;
- X movl val,%eax
- X%mem val;
- X movb val,%al
- X}
- X
- Xasm void loaddx (val)
- X{
- X%reg val;
- X movl val,%edx
- X%mem val;
- X movw val,%dx
- X}
- X
- Xasm int outbyte ()
- X{
- X outb (%dx)
- X}
- X
- Xasm int inbyte ()
- X{
- X xorl %eax,%eax
- X inb (%dx)
- X}
- X
- X/* The port parameter of the `outb' macro must be one of the predefined
- X port macros from `fas.h' or a simple uint variable (no indirection
- X is allowed). Additionally, `fip' must be a register variable in the
- X functions where `outb' is used. This prevents the destruction of the
- X `eax' CPU register while loading the `edx' register with the port
- X address. This is highly compiler implementation specific.
- X*/
- X#define outb(port,val) (regvar = (val), loadal (regvar), regvar = (port), loaddx (regvar), outbyte ())
- X
- X#define inb(port) (regvar = (port), loaddx (regvar), inbyte ())
- X
- X#define REGVAR register uint regvar
- X
- X/* This function inserts the address optimization assembler pseudo-op
- X wherever called.
- X*/
- X
- Xasm void optim ()
- X{
- X .optim
- X}
- X
- X/* This dummy function has nothing to do but to call optim so that
- X the `.optim' assembler pseudo-op will be included in the assembler
- X file. This must be the first of all functions.
- X*/
- X
- X#if defined (OPTIM) /* Define for uPort, ISC doesn't know about */
- Xstatic void /* `.optim', but has turned on optimization by */
- Xdummy () /* default, so we don't need it there anyway. */
- X{
- X optim ();
- X}
- X#endif
- X#endif /* XENIX || NO_ASM */
- X
- X/* functions provided by this driver */
- Xint fasinit ();
- Xint fasopen ();
- Xint fasclose ();
- Xint fasread ();
- Xint faswrite ();
- Xint fasioctl ();
- Xint fasintr ();
- X#if defined (NEED_PUT_GETCHAR)
- Xint asyputchar ();
- Xint asygetchar ();
- X#endif
- X#if defined (NEED_INIT8250)
- Xint init8250 ();
- X#endif
- Xstatic int fas_proc ();
- Xstatic void fas_param ();
- Xstatic void fas_fproc ();
- Xstatic void fas_mproc ();
- Xstatic uint fas_rproc ();
- Xstatic void fas_xproc ();
- Xstatic void fas_event ();
- X#if defined (HAVE_VPIX)
- Xstatic int fas_vpix_sr ();
- X#endif
- Xstatic void fas_rxfer ();
- Xstatic void fas_xxfer ();
- Xstatic void fas_ihlw_check ();
- Xstatic void fas_hdx_check ();
- Xstatic void fas_hangup ();
- Xstatic void fas_timeout ();
- Xstatic void fas_cmd ();
- Xstatic void fas_open_device ();
- Xstatic void fas_close_device ();
- Xstatic uint fas_make_ctl_val ();
- Xstatic int fas_test_device ();
- X
- X/* external functions used by this driver */
- Xextern int ttinit ();
- Xextern int ttiocom ();
- Xextern int ttyflush ();
- Xextern int SPLINT ();
- Xextern int SPLWRK ();
- Xextern int splx ();
- Xextern int sleep ();
- Xextern int wakeup ();
- Xextern void longjmp ();
- Xextern int signal ();
- Xextern int timeout ();
- Xextern int untimeout ();
- Xextern int printf ();
- X#if defined (SCO) || defined (XENIX)
- Xextern int printcfg ();
- X#endif
- X#if defined (HAVE_VPIX)
- Xextern int fubyte ();
- Xextern int subyte ();
- Xextern int v86setint ();
- X#endif
- X#if defined (XENIX)
- Xextern int inb ();
- Xextern int outb ();
- X#endif
- X
- X/* external data objects used by this driver */
- Xextern int tthiwat [];
- X
- X/* the following stuff is defined in space.c */
- Xextern uint fas_physical_units;
- Xextern ulong fas_port [];
- Xextern uint fas_vec [];
- Xextern uint fas_init_seq [];
- Xextern uint fas_mcb [];
- Xextern ulong fas_modem [];
- Xextern ulong fas_flow [];
- Xextern uint fas_ctl_port [];
- Xextern uint fas_ctl_val [];
- Xextern uint fas_int_ack_port [];
- Xextern uint fas_int_ack [];
- Xextern struct fas_info fas_info [];
- Xextern struct tty fas_tty [];
- Xextern struct fas_info *fas_info_ptr [];
- Xextern struct tty *fas_tty_ptr [];
- X/* end of space.c references */
- X
- X#if defined(FASI)
- Xint fasiintr_entries = 0;
- Xextern char *fasi_space_ident;
- X#endif /* FASI */
- X
- X/* fas_is_initted
- X Flag to indicate that we have been thru init.
- X This is realy only necessary for systems that use asyputchar
- X and asygetchar but it doesn't hurt to have it anyway.
- X*/
- Xstatic int fas_is_initted = FALSE;
- X
- X/* event_scheduled
- X Flag to indicate that the event handler has been scheduled
- X via the timeout() function.
- X*/
- Xstatic int event_scheduled = FALSE;
- X
- X/* array of pointers to the first fas_info structure for each
- X interrupt vector
- X*/
- Xstatic struct fas_info *fas_first_int_user [NUM_INT_VECTORS];
- X
- X/* the values for the various baud rates */
- Xstatic uint fas_speeds [CBAUD + 1] =
- X{ 1, BAUD_BASE/50,
- X BAUD_BASE/75, BAUD_BASE/110,
- X (2*BAUD_BASE+134)/269, BAUD_BASE/150,
- X BAUD_BASE/200, BAUD_BASE/300,
- X BAUD_BASE/600, BAUD_BASE/1200,
- X BAUD_BASE/1800, BAUD_BASE/2400,
- X BAUD_BASE/4800, BAUD_BASE/9600,
- X BAUD_BASE/19200, BAUD_BASE/38400
- X};
- X
- X/* time for one character to completely leave the transmitter shift register */
- Xstatic uint fas_ctimes [CBAUD + 1] =
- X{ 1, HZ*15/50+2,
- X HZ*15/75+2, HZ*15/110+2,
- X HZ*30/269+2, HZ*15/150+2,
- X HZ*15/200+2, HZ*15/300+2,
- X HZ*15/600+2, HZ*15/1200+2,
- X HZ*15/1800+2, HZ*15/2400+2,
- X HZ*15/4800+2, HZ*15/9600+2,
- X HZ*15/19200+2, HZ*15/38400+2
- X};
- X
- X/* dynamically adapt xmit buffer size to baud rate to prevent long buffer
- X drains at low speeds
- X These values are checked against boundaries and will be modified if
- X necessary before use. Checking is done in fas_param (). Drain time
- X is about 5 seconds with continuous character flow.
- X*/
- Xstatic uint fas_xbuf_size [CBAUD + 1] =
- X{ 1, 50/2,
- X 75/2, 110/2,
- X 269/4, 150/2,
- X 200/2, 300/2,
- X 600/2, 1200/2,
- X 1800/2, 2400/2,
- X 4800/2, 9600/2,
- X 19200/2, 38400/2
- X};
- X
- X/* lookup table for minor device number -> open mode flags translation */
- Xstatic uint fas_open_modes [16] =
- X{
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL | OS_HWO_HANDSHAKE
- X | OS_HWI_HANDSHAKE,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL | OS_HWO_HANDSHAKE,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_CLOCAL | OS_HWO_HANDSHAKE
- X | OS_HDX_HANDSHAKE,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_HWO_HANDSHAKE
- X | OS_HWI_HANDSHAKE,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_HWO_HANDSHAKE,
- X OS_OPEN_FOR_DIALOUT | OS_FAKE_CARR_ON | OS_HWO_HANDSHAKE
- X | OS_HDX_HANDSHAKE,
- X OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT,
- X OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT | OS_HWO_HANDSHAKE
- X | OS_HWI_HANDSHAKE,
- X OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT | OS_HWO_HANDSHAKE,
- X OS_OPEN_FOR_GETTY | OS_WAIT_OPEN | OS_NO_DIALOUT | OS_HWO_HANDSHAKE
- X | OS_HDX_HANDSHAKE,
- X OS_OPEN_FOR_GETTY | OS_WAIT_OPEN,
- SHAR_EOF
- true || echo 'restore of fasi/fas.c failed'
- fi
- echo 'End of ecu310 part 29'
- echo 'File fasi/fas.c is continued in part 30'
- echo 30 > _shar_seq_.tmp
- exit 0
- --------------------------------------------------------------------
- Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
- Hacker Extraordinaire d' async PADs, pods, proteins and protocols
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-