From: william E Davidsen (davidsen@ariel.crd.GE.COM)
Date: 08/24/92


From: davidsen@ariel.crd.GE.COM (william E Davidsen)
Subject: Re: conflicting serial ports
Date: 24 Aug 1992 13:41:03 GMT

In article <1992Aug21.012221.27164@super.org>, becker@super.org (Donald J. Becker) writes:
| < ... about device busy message when trying to open both serial devices 0
| and 2 or both 1 and 3, i.e. use COM1 and COM3 at the same time>
|
| This shouldn't be too hard to fix. In 'tty.c' add two new interrupt
| handlers along the model of the four that are already there: one that
| checks both COM1 and COM3, and a second that checks both COM2 and
| COM4. (It's fine to check a serial port if no character is waiting.)
| Then instead of returning EBUSY when opening the second tty of the
| pair, install the appropriate dual handler. On tty close check for a
| dual handler and, if you have one, drop back to the correct single
| line interrupt handler.
|
| The simpler approach of always installing a dual handler means you
| will respond to spurious interrupt, and put characters into a queue
| noone is reading -- it's not worth trying.

  I think a look at FAS, the serial driver for UNIX, will give some
insight into this. It looks as if all devices are polled when an int
comes in on any vector, and the polling is done in order of speed. I put
the new version in over the weekend, and with one 9600 baud line going
saw about 250 int/sec (I have FIFO set at 4), but with two going it only
went to about 270 int/sec. I briefly looked at the code, and I think
that's what's happening.

  I don't have a bus spec handy, but I believe the int lines are active
low, so you could set all four serial ports to a single vector and poll
avaryone when you got the int. As I recall the AST 4-port serial does
this, at least as an option, and I believe the usenet serial board does,
too.

-- 
bill davidsen, GE Corp. R&D Center; Box 8; Schenectady NY 12345
    I admit that when I was in school I wrote COBOL. But I didn't compile.