aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/riscom8.c27
2 files changed, 10 insertions, 19 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index d3f8f0e7a5a6..224bc0a22908 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -275,7 +275,7 @@ config N_HDLC
275 275
276config RISCOM8 276config RISCOM8
277 tristate "SDL RISCom/8 card support" 277 tristate "SDL RISCom/8 card support"
278 depends on SERIAL_NONSTANDARD && BROKEN 278 depends on SERIAL_NONSTANDARD
279 help 279 help
280 This is a driver for the SDL Communications RISCom/8 multiport card, 280 This is a driver for the SDL Communications RISCom/8 multiport card,
281 which gives you many serial ports. You would need something like 281 which gives you many serial ports. You would need something like
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 724b2b20f4b2..2c6c8f33d6b4 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1250,11 +1250,15 @@ static int rc_tiocmset(struct tty_struct *tty, struct file *file,
1250 return 0; 1250 return 0;
1251} 1251}
1252 1252
1253static void rc_send_break(struct riscom_port *port, unsigned long length) 1253static int rc_send_break(struct tty_struct *tty, int length)
1254{ 1254{
1255 struct riscom_port *port = (struct riscom_port *)tty->driver_data;
1255 struct riscom_board *bp = port_Board(port); 1256 struct riscom_board *bp = port_Board(port);
1256 unsigned long flags; 1257 unsigned long flags;
1257 1258
1259 if (length == 0 || length == -1)
1260 return -EOPNOTSUPP;
1261
1258 spin_lock_irqsave(&riscom_lock, flags); 1262 spin_lock_irqsave(&riscom_lock, flags);
1259 1263
1260 port->break_length = RISCOM_TPS / HZ * length; 1264 port->break_length = RISCOM_TPS / HZ * length;
@@ -1268,6 +1272,7 @@ static void rc_send_break(struct riscom_port *port, unsigned long length)
1268 rc_wait_CCR(bp); 1272 rc_wait_CCR(bp);
1269 1273
1270 spin_unlock_irqrestore(&riscom_lock, flags); 1274 spin_unlock_irqrestore(&riscom_lock, flags);
1275 return 0;
1271} 1276}
1272 1277
1273static int rc_set_serial_info(struct riscom_port *port, 1278static int rc_set_serial_info(struct riscom_port *port,
@@ -1342,27 +1347,12 @@ static int rc_ioctl(struct tty_struct *tty, struct file *filp,
1342{ 1347{
1343 struct riscom_port *port = (struct riscom_port *)tty->driver_data; 1348 struct riscom_port *port = (struct riscom_port *)tty->driver_data;
1344 void __user *argp = (void __user *)arg; 1349 void __user *argp = (void __user *)arg;
1345 int retval = 0; 1350 int retval;
1346 1351
1347 if (rc_paranoia_check(port, tty->name, "rc_ioctl")) 1352 if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
1348 return -ENODEV; 1353 return -ENODEV;
1349 1354
1350 switch (cmd) { 1355 switch (cmd) {
1351 case TCSBRK: /* SVID version: non-zero arg --> no break */
1352 retval = tty_check_change(tty);
1353 if (retval)
1354 return retval;
1355 tty_wait_until_sent(tty, 0);
1356 if (!arg)
1357 rc_send_break(port, HZ/4); /* 1/4 second */
1358 break;
1359 case TCSBRKP: /* support for POSIX tcsendbreak() */
1360 retval = tty_check_change(tty);
1361 if (retval)
1362 return retval;
1363 tty_wait_until_sent(tty, 0);
1364 rc_send_break(port, arg ? arg*(HZ/10) : HZ/4);
1365 break;
1366 case TIOCGSERIAL: 1356 case TIOCGSERIAL:
1367 lock_kernel(); 1357 lock_kernel();
1368 retval = rc_get_serial_info(port, argp); 1358 retval = rc_get_serial_info(port, argp);
@@ -1517,6 +1507,7 @@ static const struct tty_operations riscom_ops = {
1517 .hangup = rc_hangup, 1507 .hangup = rc_hangup,
1518 .tiocmget = rc_tiocmget, 1508 .tiocmget = rc_tiocmget,
1519 .tiocmset = rc_tiocmset, 1509 .tiocmset = rc_tiocmset,
1510 .break_ctl = rc_send_break,
1520}; 1511};
1521 1512
1522static int __init rc_init_drivers(void) 1513static int __init rc_init_drivers(void)
@@ -1538,7 +1529,7 @@ static int __init rc_init_drivers(void)
1538 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 1529 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
1539 riscom_driver->init_termios.c_ispeed = 9600; 1530 riscom_driver->init_termios.c_ispeed = 9600;
1540 riscom_driver->init_termios.c_ospeed = 9600; 1531 riscom_driver->init_termios.c_ospeed = 9600;
1541 riscom_driver->flags = TTY_DRIVER_REAL_RAW; 1532 riscom_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_HARDWARE_BREAK;
1542 tty_set_operations(riscom_driver, &riscom_ops); 1533 tty_set_operations(riscom_driver, &riscom_ops);
1543 error = tty_register_driver(riscom_driver); 1534 error = tty_register_driver(riscom_driver);
1544 if (error != 0) { 1535 if (error != 0) {