Commit bb3c190e authored by V. Ananda Krishnan's avatar V. Ananda Krishnan Committed by Linus Torvalds

[PATCH] jsm: fix for high baud rates problem

      Scott Kilau <Scott_Kilau@digi.com>

Digi serial port console doesn't work when baud rates are set higher than
38400.  So the lookup table and code in jsm_neo.c has been modified and
tested.  Please let me have the feed-back.
Signed-off-by: default avatarV.Ananda Krishnan <mansarov@us.ibm.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bfaa1dee
...@@ -965,56 +965,47 @@ static void neo_param(struct jsm_channel *ch) ...@@ -965,56 +965,47 @@ static void neo_param(struct jsm_channel *ch)
baud = ch->ch_custom_speed; baud = ch->ch_custom_speed;
if (ch->ch_flags & CH_BAUD0) if (ch->ch_flags & CH_BAUD0)
ch->ch_flags &= ~(CH_BAUD0); ch->ch_flags &= ~(CH_BAUD0);
} else { } else {
int iindex = 0; int i;
int jindex = 0; unsigned int cflag;
static struct {
const u64 bauds[4][16] = { unsigned int rate;
{ unsigned int cflag;
0, 50, 75, 110, } baud_rates[] = {
134, 150, 200, 300, { 921600, B921600 },
600, 1200, 1800, 2400, { 460800, B460800 },
4800, 9600, 19200, 38400 }, { 230400, B230400 },
{ { 115200, B115200 },
0, 57600, 115200, 230400, { 57600, B57600 },
460800, 150, 200, 921600, { 38400, B38400 },
600, 1200, 1800, 2400, { 19200, B19200 },
4800, 9600, 19200, 38400 }, { 9600, B9600 },
{ { 4800, B4800 },
0, 57600, 76800, 115200, { 2400, B2400 },
131657, 153600, 230400, 460800, { 1200, B1200 },
921600, 1200, 1800, 2400, { 600, B600 },
4800, 9600, 19200, 38400 }, { 300, B300 },
{ { 200, B200 },
0, 57600, 115200, 230400, { 150, B150 },
460800, 150, 200, 921600, { 134, B134 },
600, 1200, 1800, 2400, { 110, B110 },
4800, 9600, 19200, 38400 } { 75, B75 },
}; { 50, B50 },
};
baud = C_BAUD(ch->uart_port.info->tty) & 0xff;
cflag = C_BAUD(ch->uart_port.info->tty);
if (ch->ch_c_cflag & CBAUDEX) baud = 9600;
iindex = 1; for (i = 0; i < ARRAY_SIZE(baud_rates); i++) {
if (baud_rates[i].cflag == cflag) {
jindex = baud; baud = baud_rates[i].rate;
break;
if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) && (jindex < 16))
baud = bauds[iindex][jindex];
else {
jsm_printk(IOCTL, DEBUG, &ch->ch_bd->pci_dev,
"baud indices were out of range (%d)(%d)",
iindex, jindex);
baud = 0;
} }
if (baud == 0)
baud = 9600;
if (ch->ch_flags & CH_BAUD0)
ch->ch_flags &= ~(CH_BAUD0);
} }
if (ch->ch_flags & CH_BAUD0)
ch->ch_flags &= ~(CH_BAUD0);
}
if (ch->ch_c_cflag & PARENB) if (ch->ch_c_cflag & PARENB)
lcr |= UART_LCR_PARITY; lcr |= UART_LCR_PARITY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment