aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/mxser_new.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-02-07 00:16:41 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 08:42:34 -0800
commitf29e37c076cd08004e31297d205d54ac38cf7a20 (patch)
tree896c74c058c443507a1cf99241449eb87099e96f /drivers/char/mxser_new.c
parentb98e70de7836cf0ea49b6714b2455381865b1260 (diff)
mxser/mxser_new: first pass over termios reporting for the mxser cards
Signed-off-by: Alan Cox <alan@redhat.com> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mxser_new.c')
-rw-r--r--drivers/char/mxser_new.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index a4358acb1b2..f74734b3407 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -452,18 +452,17 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
static int mxser_set_baud(struct mxser_port *info, long newspd)
{
unsigned int i;
- int quot = 0;
+ int quot = 0, baud;
unsigned char cval;
- int ret = 0;
if (!info->tty || !info->tty->termios)
- return ret;
+ return -1;
if (!(info->ioaddr))
- return ret;
+ return -1;
if (newspd > info->max_baud)
- return 0;
+ return -1;
info->realbaud = newspd;
for (i = 0; i < BAUD_TABLE_NO; i++)
@@ -476,10 +475,13 @@ static int mxser_set_baud(struct mxser_port *info, long newspd)
} else {
if (newspd == 134) {
quot = (2 * info->baud_base / 269);
+ tty_encode_baud_rate(info->tty, 134, 134);
} else if (newspd) {
quot = info->baud_base / newspd;
if (quot == 0)
quot = 1;
+ baud = info->baud_base/quot;
+ tty_encode_baud_rate(info->tty, baud, baud);
} else {
quot = 0;
}
@@ -494,7 +496,7 @@ static int mxser_set_baud(struct mxser_port *info, long newspd)
} else {
info->MCR &= ~UART_MCR_DTR;
outb(info->MCR, info->ioaddr + UART_MCR);
- return ret;
+ return 0;
}
cval = inb(info->ioaddr + UART_LCR);
@@ -518,7 +520,7 @@ static int mxser_set_baud(struct mxser_port *info, long newspd)
} else
SET_MOXA_MUST_ENUM_VALUE(info->ioaddr, 0);
- return ret;
+ return 0;
}
/*