[lkml]   [2003]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [SERIAL] change_speed -> settermios change
On Sun, Jan 05, 2003 at 11:02:18PM -0800, David S. Miller wrote:
> Hmmm, maybe it's a better idea to store the min/max in the UART port
> structure and have the upper layer do the limiting before we call
> down into the driver?

I like that idea. However, I'd rather not put these in the uart port
structure because:

1. the max/min would be dependent on the uart clock rate for ports which
use a clock divisor.

2. the max/min rate may require driver specific knowledge (eg, when the
port supports *2 and *4 high speed modes)

3. the max/min might be constant for certain ports (eg, sunsab, nb85e)

I'm currently considering whether to pass the max / min into
uart_get_baud_rate(), along with the old termios:

a) move the loop out of uart_get_divisor() into uart_get_baud_rate()
b) uart_get_divisor() would be responsible for providing
uart_get_baud_rate() with the appropriate min/max for case (1).
c) for case (2), the driver itself would pass these parameters itself.
Whether or not the min/max depend on the uart clock rate is something
which only the driver itself can know.

There is a fourth case which I didn't list above:

4. ports that use the raw baud rate may not support all baud rates that
we are able to pass between a maximum and minimum.

This is outside our current scope at the moment (the usb serial drivers),
and from reading the usb code, it is unclear whether this is an issue for
any of these drivers.

Russell King ( The developer of ARM Linux

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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