Re: Polling ? :-(

Matthias Welwarsky (matze@stud.fbi.fh-darmstadt.de)
Tue, 16 Jun 1998 12:02:55 +0200


Theodore Y. Ts'o wrote:
>
> Date: Tue, 16 Jun 1998 10:23:22 +0530
> From: sameer <sameer@multitech.co.in>
>
> Currently I 'm writing a driver for a multi port serial
> interface card on 2.0.0 as a module. The card interrupts only when data
> is to be received or on detection of any changes in modem signals but
> not when data needs to be transmitted :-( This would make it necessary
> for a polling routine to be written which would tx data to the ports
> which have data pending in their trasmit buffers....
>
> What would be the best way to hook up such a polling routine?
>
> The easist way is to simply use the add_timer/del_timer interface. See
> the second half of /usr/src/include/linux/timer.h for more details.
>

Ouch, quite a strange hardware design. However, with the add/del_timer
the transmit performance would largely depend on the size of the
buffers. Say you have 1/10th of a second timer resolution, if the
buffers are smaller than ( bitrate / 80 ) bytes you won't ever be able
to fill the channel.

Plus, you must be able to detect how much data is left in the buffers
when the timer fires. You can try to compute it, but flow control will
make a mess of all your computing.

Not that this could help you in a way, just my 2pence,
Good luck :-)

Gruss,
Matthias

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu