From: Folkert van Heusden <folkert@vanheusden.com>
To: linux-kernel@vger.kernel.org
Cc: udovdh@xs4all.nl
Subject: Re: [RS232] setting trigger-level of fifo
Date: Wed, 9 Jan 2008 16:54:12 +0100 [thread overview]
Message-ID: <20080109155412.GX8331@vanheusden.com> (raw)
In-Reply-To: <20080109153242.GU8331@vanheusden.com>
> 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
next prev parent reply other threads:[~2008-01-09 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 15:32 [RS232] setting trigger-level of fifo Folkert van Heusden
2008-01-09 15:54 ` Folkert van Heusden [this message]
2008-01-09 17:09 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080109155412.GX8331@vanheusden.com \
--to=folkert@vanheusden.com \
--cc=linux-kernel@vger.kernel.org \
--cc=udovdh@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox