aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/mxser.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index dd1b0ab4b310..68c2e9234691 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * mxser.c -- MOXA Smartio/Industio family multiport serial driver. 2 * mxser.c -- MOXA Smartio/Industio family multiport serial driver.
3 * 3 *
4 * Copyright (C) 1999-2006 Moxa Technologies (support@moxa.com.tw). 4 * Copyright (C) 1999-2006 Moxa Technologies (support@moxa.com).
5 * Copyright (C) 2006-2007 Jiri Slaby <jirislaby@gmail.com> 5 * Copyright (C) 2006-2008 Jiri Slaby <jirislaby@gmail.com>
6 * 6 *
7 * This code is loosely based on the 1.8 moxa driver which is based on 7 * This code is loosely based on the 1.8 moxa driver which is based on
8 * Linux serial driver, written by Linus Torvalds, Theodore T'so and 8 * Linux serial driver, written by Linus Torvalds, Theodore T'so and
@@ -47,7 +47,7 @@
47 47
48#include "mxser.h" 48#include "mxser.h"
49 49
50#define MXSER_VERSION "2.0.2" /* 1.10 */ 50#define MXSER_VERSION "2.0.3" /* 1.11 */
51#define MXSERMAJOR 174 51#define MXSERMAJOR 174
52#define MXSERCUMAJOR 175 52#define MXSERCUMAJOR 175
53 53
@@ -73,6 +73,7 @@
73 73
74#define PCI_DEVICE_ID_CB108 0x1080 74#define PCI_DEVICE_ID_CB108 0x1080
75#define PCI_DEVICE_ID_CB114 0x1142 75#define PCI_DEVICE_ID_CB114 0x1142
76#define PCI_DEVICE_ID_CP114UL 0x1143
76#define PCI_DEVICE_ID_CB134I 0x1341 77#define PCI_DEVICE_ID_CB134I 0x1341
77#define PCI_DEVICE_ID_CP138U 0x1380 78#define PCI_DEVICE_ID_CP138U 0x1380
78#define PCI_DEVICE_ID_POS104UL 0x1044 79#define PCI_DEVICE_ID_POS104UL 0x1044
@@ -140,7 +141,8 @@ static const struct mxser_cardinfo mxser_cards[] = {
140/*25*/ { "CB-114 series", 4, }, 141/*25*/ { "CB-114 series", 4, },
141 { "CB-134I series", 4, }, 142 { "CB-134I series", 4, },
142 { "CP-138U series", 8, }, 143 { "CP-138U series", 8, },
143 { "POS-104UL series", 4, } 144 { "POS-104UL series", 4, },
145 { "CP-114UL series", 4, }
144}; 146};
145 147
146/* driver_data correspond to the lines in the structure above 148/* driver_data correspond to the lines in the structure above
@@ -169,6 +171,7 @@ static struct pci_device_id mxser_pcibrds[] = {
169 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CB134I), .driver_data = 26 }, 171 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CB134I), .driver_data = 26 },
170 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CP138U), .driver_data = 27 }, 172 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CP138U), .driver_data = 27 },
171 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_POS104UL), .driver_data = 28 }, 173 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_POS104UL), .driver_data = 28 },
174 { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CP114UL), .driver_data = 29 },
172 { } 175 { }
173}; 176};
174MODULE_DEVICE_TABLE(pci, mxser_pcibrds); 177MODULE_DEVICE_TABLE(pci, mxser_pcibrds);
@@ -1188,20 +1191,19 @@ static int mxser_set_serial_info(struct mxser_port *info,
1188 struct serial_struct __user *new_info) 1191 struct serial_struct __user *new_info)
1189{ 1192{
1190 struct serial_struct new_serial; 1193 struct serial_struct new_serial;
1194 speed_t baud;
1191 unsigned long sl_flags; 1195 unsigned long sl_flags;
1192 unsigned int flags; 1196 unsigned int flags;
1193 int retval = 0; 1197 int retval = 0;
1194 1198
1195 if (!new_info || !info->ioaddr) 1199 if (!new_info || !info->ioaddr)
1196 return -EFAULT; 1200 return -ENODEV;
1197 if (copy_from_user(&new_serial, new_info, sizeof(new_serial))) 1201 if (copy_from_user(&new_serial, new_info, sizeof(new_serial)))
1198 return -EFAULT; 1202 return -EFAULT;
1199 1203
1200 if ((new_serial.irq != info->board->irq) || 1204 if (new_serial.irq != info->board->irq ||
1201 (new_serial.port != info->ioaddr) || 1205 new_serial.port != info->ioaddr)
1202 (new_serial.custom_divisor != info->custom_divisor) || 1206 return -EINVAL;
1203 (new_serial.baud_base != info->baud_base))
1204 return -EPERM;
1205 1207
1206 flags = info->flags & ASYNC_SPD_MASK; 1208 flags = info->flags & ASYNC_SPD_MASK;
1207 1209
@@ -1224,6 +1226,13 @@ static int mxser_set_serial_info(struct mxser_port *info,
1224 info->tty->low_latency = 1226 info->tty->low_latency =
1225 (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 1227 (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
1226 info->tty->low_latency = 0; 1228 info->tty->low_latency = 0;
1229 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST &&
1230 (new_serial.baud_base != info->baud_base ||
1231 new_serial.custom_divisor !=
1232 info->custom_divisor)) {
1233 baud = new_serial.baud_base / new_serial.custom_divisor;
1234 tty_encode_baud_rate(info->tty, baud, baud);
1235 }
1227 } 1236 }
1228 1237
1229 info->type = new_serial.type; 1238 info->type = new_serial.type;