lkml.org 
[lkml]   [1998]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Polling ? :-(
dg2fef@afthd.tu-darmstadt.de wrote:
> Theodore Y. Ts'o wrote:
> > sameer <sameer@multitech.co.in> wrote:
> > 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.
>
> 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.

If you have quite big Tx buffers and you really plan full duplex,
you can add a flag saying "Tx has been stoped by flow control",
reseting it at each fill of the Tx buffer.

Then, you know that when processing Rx interrupt with N char
received, you can put at least (N-1) char in Tx buffer if the flag
is reset (Rx and Tx are at same baudrate by hardware, isn't it ?).

With current processor, the number of IRQ should be reduced to a
minimum, even if the driver is more complex...

Less than Euro 0.02,
Etienne.

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

\
 
 \ /
  Last update: 2005-03-22 13:43    [from the cache]
©2003-2011 Jasper Spaans