[lkml]   [1998]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Polling ? :-( wrote:
> Theodore Y. Ts'o wrote:
> > sameer <> 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,

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to

 \ /
  Last update: 2005-03-22 13:43    [W:0.045 / U:0.856 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site