From 92a5d0fc8002fd805fd0072f8ebf36d1ded7b7d0 Mon Sep 17 00:00:00 2001 From: "Matwey V. Kornilov" Date: Tue, 21 May 2013 13:57:37 +0400 Subject: [PATCH] --- yaml --- r: 376070 b: refs/heads/master c: dfc7b837c7f9f01f76511aa3eeea35232903e58f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/tty/mxser.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 68e56b453922..76c4507f79da 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d83e1807e6462ac5c4edb7eae96c69594e8c8ef +refs/heads/master: dfc7b837c7f9f01f76511aa3eeea35232903e58f diff --git a/trunk/drivers/tty/mxser.c b/trunk/drivers/tty/mxser.c index 71d6eb2c93b1..f97b196693c6 100644 --- a/trunk/drivers/tty/mxser.c +++ b/trunk/drivers/tty/mxser.c @@ -1618,8 +1618,12 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) if (ip->type == PORT_16550A) me->fifo[p] = 1; - opmode = inb(ip->opmode_ioaddr)>>((p % 4) * 2); - opmode &= OP_MODE_MASK; + if (ip->board->chip_flag == MOXA_MUST_MU860_HWID) { + opmode = inb(ip->opmode_ioaddr)>>((p % 4) * 2); + opmode &= OP_MODE_MASK; + } else { + opmode = RS232_MODE; + } me->iftype[p] = opmode; mutex_unlock(&port->mutex); } @@ -1670,6 +1674,9 @@ static int mxser_ioctl(struct tty_struct *tty, return mxser_ioctl_special(cmd, argp); if (cmd == MOXA_SET_OP_MODE || cmd == MOXA_GET_OP_MODE) { + if (info->board->chip_flag != MOXA_MUST_MU860_HWID) + return -EFAULT; + int p; unsigned long opmode; static unsigned char ModeMask[] = { 0xfc, 0xf3, 0xcf, 0x3f };