diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-02-08 07:18:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:25 -0500 |
commit | 6df3526b6649e57a414ba6b4179655341affcf46 (patch) | |
tree | 96ba0c9b8dec4685675c0ccb590990bb97a1f908 /drivers/char/rocket.c | |
parent | 4edf1827ea19e65ca27ed197384d63f4d1dc8836 (diff) |
rocket: first pass at termios reporting
Also removes a cflag comparison that caused some mode changes to get wrongly
ignored
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 'drivers/char/rocket.c')
-rw-r--r-- | drivers/char/rocket.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 68c289fe2dc2..cbee71bab017 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -715,11 +715,10 @@ static void configure_r_port(struct r_port *info, | |||
715 | unsigned rocketMode; | 715 | unsigned rocketMode; |
716 | int bits, baud, divisor; | 716 | int bits, baud, divisor; |
717 | CHANNEL_t *cp; | 717 | CHANNEL_t *cp; |
718 | struct ktermios *t = info->tty->termios; | ||
718 | 719 | ||
719 | if (!info->tty || !info->tty->termios) | ||
720 | return; | ||
721 | cp = &info->channel; | 720 | cp = &info->channel; |
722 | cflag = info->tty->termios->c_cflag; | 721 | cflag = t->c_cflag; |
723 | 722 | ||
724 | /* Byte size and parity */ | 723 | /* Byte size and parity */ |
725 | if ((cflag & CSIZE) == CS8) { | 724 | if ((cflag & CSIZE) == CS8) { |
@@ -754,10 +753,7 @@ static void configure_r_port(struct r_port *info, | |||
754 | baud = 9600; | 753 | baud = 9600; |
755 | divisor = ((rp_baud_base[info->board] + (baud >> 1)) / baud) - 1; | 754 | divisor = ((rp_baud_base[info->board] + (baud >> 1)) / baud) - 1; |
756 | if ((divisor >= 8192 || divisor < 0) && old_termios) { | 755 | if ((divisor >= 8192 || divisor < 0) && old_termios) { |
757 | info->tty->termios->c_cflag &= ~CBAUD; | 756 | baud = tty_termios_baud_rate(old_termios); |
758 | info->tty->termios->c_cflag |= | ||
759 | (old_termios->c_cflag & CBAUD); | ||
760 | baud = tty_get_baud_rate(info->tty); | ||
761 | if (!baud) | 757 | if (!baud) |
762 | baud = 9600; | 758 | baud = 9600; |
763 | divisor = (rp_baud_base[info->board] / baud) - 1; | 759 | divisor = (rp_baud_base[info->board] / baud) - 1; |
@@ -769,6 +765,9 @@ static void configure_r_port(struct r_port *info, | |||
769 | info->cps = baud / bits; | 765 | info->cps = baud / bits; |
770 | sSetBaud(cp, divisor); | 766 | sSetBaud(cp, divisor); |
771 | 767 | ||
768 | /* FIXME: Should really back compute a baud rate from the divisor */ | ||
769 | tty_encode_baud_rate(info->tty, baud, baud); | ||
770 | |||
772 | if (cflag & CRTSCTS) { | 771 | if (cflag & CRTSCTS) { |
773 | info->intmask |= DELTA_CTS; | 772 | info->intmask |= DELTA_CTS; |
774 | sEnCTSFlowCtl(cp); | 773 | sEnCTSFlowCtl(cp); |
@@ -1202,15 +1201,14 @@ static void rp_set_termios(struct tty_struct *tty, | |||
1202 | 1201 | ||
1203 | cflag = tty->termios->c_cflag; | 1202 | cflag = tty->termios->c_cflag; |
1204 | 1203 | ||
1205 | if (cflag == old_termios->c_cflag) | ||
1206 | return; | ||
1207 | |||
1208 | /* | 1204 | /* |
1209 | * This driver doesn't support CS5 or CS6 | 1205 | * This driver doesn't support CS5 or CS6 |
1210 | */ | 1206 | */ |
1211 | if (((cflag & CSIZE) == CS5) || ((cflag & CSIZE) == CS6)) | 1207 | if (((cflag & CSIZE) == CS5) || ((cflag & CSIZE) == CS6)) |
1212 | tty->termios->c_cflag = | 1208 | tty->termios->c_cflag = |
1213 | ((cflag & ~CSIZE) | (old_termios->c_cflag & CSIZE)); | 1209 | ((cflag & ~CSIZE) | (old_termios->c_cflag & CSIZE)); |
1210 | /* Or CMSPAR */ | ||
1211 | tty->termios->c_cflag &= ~CMSPAR; | ||
1214 | 1212 | ||
1215 | configure_r_port(info, old_termios); | 1213 | configure_r_port(info, old_termios); |
1216 | 1214 | ||