Commit 781cff5cb2bc8d714270accf88db23a855de9816

Authored by Alan Cox
Committed by Linus Torvalds
1 parent 6d88972433

riscom8: Restore driver using new break functionality

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 10 additions and 19 deletions Side-by-side Diff

drivers/char/Kconfig
... ... @@ -275,7 +275,7 @@
275 275  
276 276 config RISCOM8
277 277 tristate "SDL RISCom/8 card support"
278   - depends on SERIAL_NONSTANDARD && BROKEN
  278 + depends on SERIAL_NONSTANDARD
279 279 help
280 280 This is a driver for the SDL Communications RISCom/8 multiport card,
281 281 which gives you many serial ports. You would need something like
drivers/char/riscom8.c
... ... @@ -1250,11 +1250,15 @@
1250 1250 return 0;
1251 1251 }
1252 1252  
1253   -static void rc_send_break(struct riscom_port *port, unsigned long length)
  1253 +static int rc_send_break(struct tty_struct *tty, int length)
1254 1254 {
  1255 + struct riscom_port *port = (struct riscom_port *)tty->driver_data;
1255 1256 struct riscom_board *bp = port_Board(port);
1256 1257 unsigned long flags;
1257 1258  
  1259 + if (length == 0 || length == -1)
  1260 + return -EOPNOTSUPP;
  1261 +
1258 1262 spin_lock_irqsave(&riscom_lock, flags);
1259 1263  
1260 1264 port->break_length = RISCOM_TPS / HZ * length;
... ... @@ -1268,6 +1272,7 @@
1268 1272 rc_wait_CCR(bp);
1269 1273  
1270 1274 spin_unlock_irqrestore(&riscom_lock, flags);
  1275 + return 0;
1271 1276 }
1272 1277  
1273 1278 static int rc_set_serial_info(struct riscom_port *port,
1274 1279  
... ... @@ -1342,27 +1347,12 @@
1342 1347 {
1343 1348 struct riscom_port *port = (struct riscom_port *)tty->driver_data;
1344 1349 void __user *argp = (void __user *)arg;
1345   - int retval = 0;
  1350 + int retval;
1346 1351  
1347 1352 if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
1348 1353 return -ENODEV;
1349 1354  
1350 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 1356 case TIOCGSERIAL:
1367 1357 lock_kernel();
1368 1358 retval = rc_get_serial_info(port, argp);
... ... @@ -1517,6 +1507,7 @@
1517 1507 .hangup = rc_hangup,
1518 1508 .tiocmget = rc_tiocmget,
1519 1509 .tiocmset = rc_tiocmset,
  1510 + .break_ctl = rc_send_break,
1520 1511 };
1521 1512  
1522 1513 static int __init rc_init_drivers(void)
... ... @@ -1538,7 +1529,7 @@
1538 1529 B9600 | CS8 | CREAD | HUPCL | CLOCAL;
1539 1530 riscom_driver->init_termios.c_ispeed = 9600;
1540 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 1533 tty_set_operations(riscom_driver, &riscom_ops);
1543 1534 error = tty_register_driver(riscom_driver);
1544 1535 if (error != 0) {