public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RS232] setting trigger-level of fifo
@ 2008-01-09 15:32 Folkert van Heusden
  2008-01-09 15:54 ` Folkert van Heusden
  0 siblings, 1 reply; 3+ messages in thread
From: Folkert van Heusden @ 2008-01-09 15:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: udovdh

Hi,

In windows one can configure at what point the uart will trigger an
interrupt. E.g. 1, 4, 8 or 14 bytes received. Setserial doesn't let you
and I saw in the sources of the serial driver no hint that it is
supported in linux at all. Also in MAINTAINERS I saw that sreial is
orphaned. Can someone tell how I can proceed with this? Is it at all
possible to do this setting? 


Folkert van Heusden

-- 
Multi tail barnamaj mowahib li mora9abat attasjilat wa nataij awamir
al 7asoub. damj, talwin, mora9abat attarchi7 wa ila akhirih.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RS232] setting trigger-level of fifo
  2008-01-09 15:32 [RS232] setting trigger-level of fifo Folkert van Heusden
@ 2008-01-09 15:54 ` Folkert van Heusden
  2008-01-09 17:09   ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Folkert van Heusden @ 2008-01-09 15:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: udovdh

> In windows one can configure at what point the uart will trigger an
> interrupt. E.g. 1, 4, 8 or 14 bytes received. Setserial doesn't let you
> and I saw in the sources of the serial driver no hint that it is
> supported in linux at all. Also in MAINTAINERS I saw that sreial is
> orphaned. Can someone tell how I can proceed with this? Is it at all
> possible to do this setting? 

I think it must be something like this:

static void limit_fifo(struct uart_port *port)
{
        struct uart_8250_port *up = (struct uart_8250_port *)port;
        unsigned char cval, fcr = 0;
        unsigned long flags;

	/* hopefully not setting the UART_FCR_ENABLE_FIFO flag will
	 * set it to off. otherwhise the trigger_1 should make the
	 * uart trigger the interrupt immediately after the first
	 * byte comes in
	 */
        fcr = UART_FCR_TRIGGER_1;

        spin_lock_irqsave(&up->port.lock, flags);

        if (up->port.type == PORT_16750)
                serial_outp(up, UART_FCR, fcr);

        serial_outp(up, UART_LCR, cval);                /* reset DLAB */
        up->lcr = cval;                                 /* Save LCR */
        if (up->port.type != PORT_16750) {
                if (fcr & UART_FCR_ENABLE_FIFO) {
                        /* emulated UARTs (Lucent Venus 167x) need two steps */
                        serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
                }
                serial_outp(up, UART_FCR, fcr);         /* set fcr */
        }
        serial8250_set_mctrl(&up->port, up->port.mctrl);
        spin_unlock_irqrestore(&up->port.lock, flags);
}

But I don't know how to interface this to an ioctl or so.

All help is appreciated!


Folkert van Heusden

-- 
Looking for a cheap but fast webhoster with an excellent helpdesk?
http://keetweej.vanheusden.com/redir.php?id=1001
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RS232] setting trigger-level of fifo
  2008-01-09 15:54 ` Folkert van Heusden
@ 2008-01-09 17:09   ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2008-01-09 17:09 UTC (permalink / raw)
  To: Folkert van Heusden; +Cc: linux-kernel, udovdh

>         serial8250_set_mctrl(&up->port, up->port.mctrl);
>         spin_unlock_irqrestore(&up->port.lock, flags);
> }
> 
> But I don't know how to interface this to an ioctl or so.

tty ioctl calls both ldisc and driver ioctls (in your case the
serial_core ioctl). The triggers get recomputed in the 8250 driver so you
may need to think about how you handle speed changes automatically
adjusting trigger levels.

Alan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-09 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09 15:32 [RS232] setting trigger-level of fifo Folkert van Heusden
2008-01-09 15:54 ` Folkert van Heusden
2008-01-09 17:09   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox