aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-07-22 06:18:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-22 16:03:28 -0400
commit6d889724332e875ac07b6c88e08d9564c180824d (patch)
tree9b68a964ec43d0d4d78264f8fd7ac1be2ada8272 /drivers
parentdcbf1280796be7c0b74c4231f0ac9dd8aa1e2591 (diff)
isicom: restore using hardware break support
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/isicom.c30
2 files changed, 10 insertions, 22 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 9ead63cd5648..d3f8f0e7a5a6 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -218,7 +218,7 @@ config MOXA_SMARTIO
218 218
219config ISI 219config ISI
220 tristate "Multi-Tech multiport card support (EXPERIMENTAL)" 220 tristate "Multi-Tech multiport card support (EXPERIMENTAL)"
221 depends on SERIAL_NONSTANDARD && PCI && BROKEN 221 depends on SERIAL_NONSTANDARD && PCI
222 select FW_LOADER 222 select FW_LOADER
223 help 223 help
224 This is a driver for the Multi-Tech cards which provide several 224 This is a driver for the Multi-Tech cards which provide several
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index d4281df10c22..8f7cc190b62d 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -1181,14 +1181,17 @@ static int isicom_chars_in_buffer(struct tty_struct *tty)
1181} 1181}
1182 1182
1183/* ioctl et all */ 1183/* ioctl et all */
1184static inline void isicom_send_break(struct isi_port *port, 1184static int isicom_send_break(struct tty_struct *tty, int length)
1185 unsigned long length)
1186{ 1185{
1186 struct isi_port *port = tty->driver_data;
1187 struct isi_board *card = port->card; 1187 struct isi_board *card = port->card;
1188 unsigned long base = card->base; 1188 unsigned long base = card->base;
1189 1189
1190 if (length == -1)
1191 return -EOPNOTSUPP;
1192
1190 if (!lock_card(card)) 1193 if (!lock_card(card))
1191 return; 1194 return -EINVAL;
1192 1195
1193 outw(0x8000 | ((port->channel) << (card->shift_count)) | 0x3, base); 1196 outw(0x8000 | ((port->channel) << (card->shift_count)) | 0x3, base);
1194 outw((length & 0xff) << 8 | 0x00, base); 1197 outw((length & 0xff) << 8 | 0x00, base);
@@ -1196,6 +1199,7 @@ static inline void isicom_send_break(struct isi_port *port,
1196 InterruptTheCard(base); 1199 InterruptTheCard(base);
1197 1200
1198 unlock_card(card); 1201 unlock_card(card);
1202 return 0;
1199} 1203}
1200 1204
1201static int isicom_tiocmget(struct tty_struct *tty, struct file *file) 1205static int isicom_tiocmget(struct tty_struct *tty, struct file *file)
@@ -1305,28 +1309,11 @@ static int isicom_ioctl(struct tty_struct *tty, struct file *filp,
1305{ 1309{
1306 struct isi_port *port = tty->driver_data; 1310 struct isi_port *port = tty->driver_data;
1307 void __user *argp = (void __user *)arg; 1311 void __user *argp = (void __user *)arg;
1308 int retval;
1309 1312
1310 if (isicom_paranoia_check(port, tty->name, "isicom_ioctl")) 1313 if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
1311 return -ENODEV; 1314 return -ENODEV;
1312 1315
1313 switch (cmd) { 1316 switch (cmd) {
1314 case TCSBRK:
1315 retval = tty_check_change(tty);
1316 if (retval)
1317 return retval;
1318 tty_wait_until_sent(tty, 0);
1319 if (!arg)
1320 isicom_send_break(port, HZ/4);
1321 return 0;
1322
1323 case TCSBRKP:
1324 retval = tty_check_change(tty);
1325 if (retval)
1326 return retval;
1327 tty_wait_until_sent(tty, 0);
1328 isicom_send_break(port, arg ? arg * (HZ/10) : HZ/4);
1329 return 0;
1330 case TIOCGSERIAL: 1317 case TIOCGSERIAL:
1331 return isicom_get_serial_info(port, argp); 1318 return isicom_get_serial_info(port, argp);
1332 1319
@@ -1459,6 +1446,7 @@ static const struct tty_operations isicom_ops = {
1459 .flush_buffer = isicom_flush_buffer, 1446 .flush_buffer = isicom_flush_buffer,
1460 .tiocmget = isicom_tiocmget, 1447 .tiocmget = isicom_tiocmget,
1461 .tiocmset = isicom_tiocmset, 1448 .tiocmset = isicom_tiocmset,
1449 .break_ctl = isicom_send_break,
1462}; 1450};
1463 1451
1464static int __devinit reset_card(struct pci_dev *pdev, 1452static int __devinit reset_card(struct pci_dev *pdev,
@@ -1832,7 +1820,7 @@ static int __init isicom_init(void)
1832 isicom_normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | 1820 isicom_normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL |
1833 CLOCAL; 1821 CLOCAL;
1834 isicom_normal->flags = TTY_DRIVER_REAL_RAW | 1822 isicom_normal->flags = TTY_DRIVER_REAL_RAW |
1835 TTY_DRIVER_DYNAMIC_DEV; 1823 TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_HARDWARE_BREAK;
1836 tty_set_operations(isicom_normal, &isicom_ops); 1824 tty_set_operations(isicom_normal, &isicom_ops);
1837 1825
1838 retval = tty_register_driver(isicom_normal); 1826 retval = tty_register_driver(isicom_normal);