diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-10-16 23:30:07 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 08:42:58 -0700 |
commit | 5f519d728169fa9975bcba001de425f11e18e8e3 (patch) | |
tree | 41631c3b5a7a2fb5273dc758a3f4e1bb0fdcd540 /include/linux | |
parent | ca025282e9f13471cd4bf44d854bbd6dcbcb39c1 (diff) |
tty: expose new methods needed for drivers to get termios right
This adds three new functions (or in one case to be more exact makes it
always available)
tty_termios_copy_hw
Copies all the hardware settings from one termios structure to the other.
This is intended for drivers that support little or no hardware setting
tty_termios_encode_baud_rate
Allows you to set the input and output baud rate in a termios structure. A
driver is supposed to set the resulting baud rate from a request so most
will want to use this function to set the resulting input and output rates
to match the hardware values. Internally it knows about keeping Bxxx
encoding when possible to maximise compatibility.
tty_encode_baud_rate
As above but for the tty's own current termios structure
I suspect this will initially need some tweaking as it gets enabled by
driver patches over the next few mm cycles so consider this lot -mm only
for the moment so it can stabilize and end up neat before it goes to base.
I've tried not to break any obscure architectures - if you get a speed you
can't represent the code will print warnings on non updated termios systems
but not break.
Once this is merged and seems sane I've got a growing pile of driver
updates to use it - notably for USB serial drivers.
[akpm@linux-foundation.org: cleanups]
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/tty.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 274b40ff0cd8..56164d7ba0ad 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -316,6 +316,9 @@ extern void tty_flip_buffer_push(struct tty_struct *tty); extern speed_t tty_get_baud_rate(struct tty_struct *tty); extern speed_t tty_termios_baud_rate(struct ktermios *termios); extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); +extern void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud); +extern void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud); +extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); extern void tty_ldisc_deref(struct tty_ldisc *); |