Subject: Re: usleep() accuracy?
To: Jukka Marin <jmarin@pyy.jmp.fi>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 11/30/1999 11:45:22
On Tue, 30 Nov 1999, Jukka Marin wrote:

> Probably so, but that would affect all serial ports (I have six of them
> at the moment).  In addition, I'm only using NetBSD for testing the
> software of the external device - in the final application, the hardware
> will be driven by an embedded system (which does not exist yet).

Since it's custom, how about an ioctl which sets sc_fifolen.

Or better yet, add a new variable: sc_transsize. It gets initialized to
sc_fifolen say just before the tty setup in com_attach_subr (so it gets
set to the right value irregardles of which device matches). 

Then have comstart() and comintr() look at it rather than sc_fifolen.

Then add an ioctl which will set sc_transsize to a given value. Actually
min(desired value, sc_fifolen) is better, and desired value == 0 is
invalid. An _IO('u', 10) or some such ioctl value should be fine. (note
that even with "void" ioctl's you can pass in an integer)

This way you can tune serial performance on a per-port basis.

It might also be desirable to have the first-open code explicitly
re-initialize sc_transsize to sc_fifolen.

Take care,

Bill