diff options
Diffstat (limited to 'drivers/tty/mxser.c')
-rw-r--r-- | drivers/tty/mxser.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 71d6eb2c93b1..4c4a23674569 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c | |||
@@ -1618,8 +1618,12 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) | |||
1618 | if (ip->type == PORT_16550A) | 1618 | if (ip->type == PORT_16550A) |
1619 | me->fifo[p] = 1; | 1619 | me->fifo[p] = 1; |
1620 | 1620 | ||
1621 | opmode = inb(ip->opmode_ioaddr)>>((p % 4) * 2); | 1621 | if (ip->board->chip_flag == MOXA_MUST_MU860_HWID) { |
1622 | opmode &= OP_MODE_MASK; | 1622 | opmode = inb(ip->opmode_ioaddr)>>((p % 4) * 2); |
1623 | opmode &= OP_MODE_MASK; | ||
1624 | } else { | ||
1625 | opmode = RS232_MODE; | ||
1626 | } | ||
1623 | me->iftype[p] = opmode; | 1627 | me->iftype[p] = opmode; |
1624 | mutex_unlock(&port->mutex); | 1628 | mutex_unlock(&port->mutex); |
1625 | } | 1629 | } |
@@ -1676,6 +1680,9 @@ static int mxser_ioctl(struct tty_struct *tty, | |||
1676 | int shiftbit; | 1680 | int shiftbit; |
1677 | unsigned char val, mask; | 1681 | unsigned char val, mask; |
1678 | 1682 | ||
1683 | if (info->board->chip_flag != MOXA_MUST_MU860_HWID) | ||
1684 | return -EFAULT; | ||
1685 | |||
1679 | p = tty->index % 4; | 1686 | p = tty->index % 4; |
1680 | if (cmd == MOXA_SET_OP_MODE) { | 1687 | if (cmd == MOXA_SET_OP_MODE) { |
1681 | if (get_user(opmode, (int __user *) argp)) | 1688 | if (get_user(opmode, (int __user *) argp)) |