Subject: Re: is TIOCMGET supposed to reflect reality?
To: Tom Yu <email@example.com>
From: Bill Studenmund <firstname.lastname@example.org>
Date: 09/29/2004 15:10:05
Content-Type: text/plain; charset=us-ascii
On Mon, Sep 27, 2004 at 09:50:18AM -0400, Tom Yu wrote:
> >>>>> "David" =3D=3D David Laight <email@example.com> writes:
> >> Is there any reason not to always enable DCD and CTS interrupts? I
> >> gather that there might be performance reasons for disabling DCD and
> >> CTS interrupts, but if the interrupts are disabled, TIOCMGET would
> >> have to explicitly read RR0 to get the correct state of the modem
> >> status lines.
I think it'd be simpler to just read the current value of the flags.=20
TIOCMGET is an uncommon call.
> Also, at some point in the past (around rev 1.39), z8530tty.c did have
> DCD_IE and CTS_IE unconditionally enabled, but there was a change in
> rev 1.53 to only enable them if the tty layer expects to track the
> status lines. It looks like this change was in response to some
> problems on mac68k machines.
The "problem" on mac68k machines is also present on macppc (which doesn't
use the MI driver as I recall), and it is that the software (the driver)
shouldn't assume that enabling interrupts is sane.
The mac68k and macppc serial ports are wired up so that an external input,=
on either DCD or CTS, can be used to drive the bit rate generators. See=20
the external clock input code in sys/arch/mac68k/dev/zs.c. Since these=20
clocks need to be on the order of 16x the bit rate, you can see that they=
would generate an interrupt storm if they were let in. Specifically, MIDI=
interfaces use the external clock source to feed in a clock to generate=20
the MIDI bit rate.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
-----END PGP SIGNATURE-----