Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

riscom8: Restore driver using new break functionality

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

authored by

Alan Cox and committed by
Linus Torvalds
781cff5c 6d889724

+10 -19
+1 -1
drivers/char/Kconfig
··· 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
+9 -18
drivers/char/riscom8.c
··· 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; 1258 + 1259 + if (length == 0 || length == -1) 1260 + return -EOPNOTSUPP; 1257 1261 1258 1262 spin_lock_irqsave(&riscom_lock, flags); 1259 1263 ··· 1272 1268 rc_wait_CCR(bp); 1273 1269 1274 1270 spin_unlock_irqrestore(&riscom_lock, flags); 1271 + return 0; 1275 1272 } 1276 1273 1277 1274 static int rc_set_serial_info(struct riscom_port *port, ··· 1347 1342 { 1348 1343 struct riscom_port *port = (struct riscom_port *)tty->driver_data; 1349 1344 void __user *argp = (void __user *)arg; 1350 - int retval = 0; 1345 + int retval; 1351 1346 1352 1347 if (rc_paranoia_check(port, tty->name, "rc_ioctl")) 1353 1348 return -ENODEV; 1354 1349 1355 1350 switch (cmd) { 1356 - case TCSBRK: /* SVID version: non-zero arg --> no break */ 1357 - retval = tty_check_change(tty); 1358 - if (retval) 1359 - return retval; 1360 - tty_wait_until_sent(tty, 0); 1361 - if (!arg) 1362 - rc_send_break(port, HZ/4); /* 1/4 second */ 1363 - break; 1364 - case TCSBRKP: /* support for POSIX tcsendbreak() */ 1365 - retval = tty_check_change(tty); 1366 - if (retval) 1367 - return retval; 1368 - tty_wait_until_sent(tty, 0); 1369 - rc_send_break(port, arg ? arg*(HZ/10) : HZ/4); 1370 - break; 1371 1351 case TIOCGSERIAL: 1372 1352 lock_kernel(); 1373 1353 retval = rc_get_serial_info(port, argp); ··· 1507 1517 .hangup = rc_hangup, 1508 1518 .tiocmget = rc_tiocmget, 1509 1519 .tiocmset = rc_tiocmset, 1520 + .break_ctl = rc_send_break, 1510 1521 }; 1511 1522 1512 1523 static int __init rc_init_drivers(void) ··· 1529 1538 B9600 | CS8 | CREAD | HUPCL | CLOCAL; 1530 1539 riscom_driver->init_termios.c_ispeed = 9600; 1531 1540 riscom_driver->init_termios.c_ospeed = 9600; 1532 - riscom_driver->flags = TTY_DRIVER_REAL_RAW; 1541 + riscom_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_HARDWARE_BREAK; 1533 1542 tty_set_operations(riscom_driver, &riscom_ops); 1534 1543 error = tty_register_driver(riscom_driver); 1535 1544 if (error != 0) {