linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug+Bugfix: Serialdriver 2.6.0-test8(setting custum speed)
@ 2003-10-24 21:19 Heinz-Georg Sawicki
  0 siblings, 0 replies; only message in thread
From: Heinz-Georg Sawicki @ 2003-10-24 21:19 UTC (permalink / raw)
  To: linux-kernel

Hi!

First excuse me for my bad english.
In case of custom speed the routine   uart_get_divisor  in  serial_core.c  
must calcuate the custom baudrate and return it to the caller. It may look
somewhat like this:

unsigned int
uart_get_divisor(struct uart_port *port, unsigned int* pBaud)
{
	unsigned int quot;

	/*
	 * Old custom speed handling.
	 */
	if (*pBaud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
    {
		quot = port->custom_divisor;
        *pBaud = port->uartclk / (16 * quot);
    }
	else
		quot = port->uartclk / (16 * (*pBaud));

	return quot;
}

This is necessary because  serial8250_set_termios  in   8250.c   uses the 
baudrate for setting the fifotriggerlevel

		if (baud < 2400)
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
#ifdef CONFIG_SERIAL_8250_RSA
		else if (up->port.type == PORT_RSA)
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_14;
#endif
		else
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_8;

In my case i setup a customdivisor of 11520 to get a baudrate of 10 baud, to 
receive the dcf77-signal(UART 16550A, PC-Hardware). Instead of one byte per 
second i received 8 bytes at once because of the wrong triggerlevel. By 
setting the triggerlevel always to one 
		:
		else
			fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;

i checked that this was the cause for the problem.

By the way, the comment

	/*
	 * Old custom speed handling.
	 */
 
says, that this is the old way for setting up a custom speed. Can you please 
tell me the new way for doing this. Thanks.

Have a nice day,

	Heinz-Georg Sawicki


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-24 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-24 21:19 Bug+Bugfix: Serialdriver 2.6.0-test8(setting custum speed) Heinz-Georg Sawicki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).