Re: serial.c (half duplex support)

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Wed, 27 Oct 1999 15:18:19 +0200 (MEST)


Theodore Y. Ts'o wrote:
> Date: Tue, 26 Oct 1999 18:25:58 +0100
> From: David Woodhouse <David.Woodhouse@mvhi.com>
>
> Instead of this, Profibus uses an idle time of 33 bits to ensure
> unambiguous detection of frame boundaries. Therefore, I'd like to be
> able to find out from the hardware driver when such an idle period
> happens.
>
> At what baud rates does Profibus run? The problem is that you will need
> to read a high-resolution clock at every interrupt, and this is (a) slow
> or unavailable on some architectures, and (b) non-portable.
>
> Some intelligent serial ports will simply not support this at all.
>
> If Profibus has such a broken architecture, then it may not be possible
> to support it using the generic serial driver. And you may need to
> support in such a way that it will only work on the i386 platform, or
> some such. It's not going to be pretty.....

I've talked to David about Profibus. (Was that a year ago David?)

One of the things I didn't know back then is that Linux allways lets
the tx buffer drain completely, and then refills it to the top. This
means that if the TX buffer empty interrupt isn't serviced within one
character time (The transmitter shift register is shifting out one last
character when the FIFO is empty...), there is a gap. Those gaps may
be interpreted as an "end of packet" indication. That is unacceptable.

Linux often turns off interrrupts for "too long". Especially when
there are IDE disks near the machine....

Ted, I suspect that -=* generating *=- the 33 bit-times of idle time
is much more important than measuring it. You have those 33 bit times
to turn off your transmitter buffer. Better not do that before
transmission has really stopped. Better not do that more than 33 bit
times after the last bit was transmitted. That would mean that two
transmitters would be active at the same time, which is "not good".

So there is a 33bit time window where we should get the "half duplex"
controller to turn the transmit driver off, preferably somewhere
in the middle.

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
 "I didn't say it was your fault. I said I was going to blame it on you."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/