diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:53:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:40 -0400 |
commit | 6e4d376c664ded7cb9cc1c7d0cae67c9672e46b1 (patch) | |
tree | 671afcc8603e9df2f48d916ed815368761f6911f /drivers/isdn/i4l | |
parent | 9cc3c22bf017f33612748aeb466fdc3695fb1e1d (diff) |
isdn_tty: Prepare for BKL push down
Three things here
- Remove softcar handler
- Correct termios change detection logic
- Wrap break/ioctl in lock_kernel ready to drop it in the caller
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/i4l')
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 8af0df1d5b8c..a033f53209d5 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -1352,12 +1352,14 @@ isdn_tty_tiocmget(struct tty_struct *tty, struct file *file) | |||
1352 | if (tty->flags & (1 << TTY_IO_ERROR)) | 1352 | if (tty->flags & (1 << TTY_IO_ERROR)) |
1353 | return -EIO; | 1353 | return -EIO; |
1354 | 1354 | ||
1355 | lock_kernel(); | ||
1355 | #ifdef ISDN_DEBUG_MODEM_IOCTL | 1356 | #ifdef ISDN_DEBUG_MODEM_IOCTL |
1356 | printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line); | 1357 | printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line); |
1357 | #endif | 1358 | #endif |
1358 | 1359 | ||
1359 | control = info->mcr; | 1360 | control = info->mcr; |
1360 | status = info->msr; | 1361 | status = info->msr; |
1362 | unlock_kernel(); | ||
1361 | return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) | 1363 | return ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) |
1362 | | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) | 1364 | | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) |
1363 | | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) | 1365 | | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) |
@@ -1381,6 +1383,7 @@ isdn_tty_tiocmset(struct tty_struct *tty, struct file *file, | |||
1381 | printk(KERN_DEBUG "ttyI%d ioctl TIOCMxxx: %x %x\n", info->line, set, clear); | 1383 | printk(KERN_DEBUG "ttyI%d ioctl TIOCMxxx: %x %x\n", info->line, set, clear); |
1382 | #endif | 1384 | #endif |
1383 | 1385 | ||
1386 | lock_kernel(); | ||
1384 | if (set & TIOCM_RTS) | 1387 | if (set & TIOCM_RTS) |
1385 | info->mcr |= UART_MCR_RTS; | 1388 | info->mcr |= UART_MCR_RTS; |
1386 | if (set & TIOCM_DTR) { | 1389 | if (set & TIOCM_DTR) { |
@@ -1402,6 +1405,7 @@ isdn_tty_tiocmset(struct tty_struct *tty, struct file *file, | |||
1402 | isdn_tty_modem_hup(info, 1); | 1405 | isdn_tty_modem_hup(info, 1); |
1403 | } | 1406 | } |
1404 | } | 1407 | } |
1408 | unlock_kernel(); | ||
1405 | return 0; | 1409 | return 0; |
1406 | } | 1410 | } |
1407 | 1411 | ||
@@ -1435,21 +1439,6 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file, | |||
1435 | return retval; | 1439 | return retval; |
1436 | tty_wait_until_sent(tty, 0); | 1440 | tty_wait_until_sent(tty, 0); |
1437 | return 0; | 1441 | return 0; |
1438 | case TIOCGSOFTCAR: | ||
1439 | #ifdef ISDN_DEBUG_MODEM_IOCTL | ||
1440 | printk(KERN_DEBUG "ttyI%d ioctl TIOCGSOFTCAR\n", info->line); | ||
1441 | #endif | ||
1442 | return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong __user *) arg); | ||
1443 | case TIOCSSOFTCAR: | ||
1444 | #ifdef ISDN_DEBUG_MODEM_IOCTL | ||
1445 | printk(KERN_DEBUG "ttyI%d ioctl TIOCSSOFTCAR\n", info->line); | ||
1446 | #endif | ||
1447 | if (get_user(arg, (ulong __user *) arg)) | ||
1448 | return -EFAULT; | ||
1449 | tty->termios->c_cflag = | ||
1450 | ((tty->termios->c_cflag & ~CLOCAL) | | ||
1451 | (arg ? CLOCAL : 0)); | ||
1452 | return 0; | ||
1453 | case TIOCSERGETLSR: /* Get line status register */ | 1442 | case TIOCSERGETLSR: /* Get line status register */ |
1454 | #ifdef ISDN_DEBUG_MODEM_IOCTL | 1443 | #ifdef ISDN_DEBUG_MODEM_IOCTL |
1455 | printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); | 1444 | printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); |
@@ -1472,13 +1461,14 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
1472 | if (!old_termios) | 1461 | if (!old_termios) |
1473 | isdn_tty_change_speed(info); | 1462 | isdn_tty_change_speed(info); |
1474 | else { | 1463 | else { |
1475 | if (tty->termios->c_cflag == old_termios->c_cflag) | 1464 | if (tty->termios->c_cflag == old_termios->c_cflag && |
1465 | tty->termios->c_ispeed == old_termios->c_ispeed && | ||
1466 | tty->termios->c_ospeed == old_termios->c_ospeed) | ||
1476 | return; | 1467 | return; |
1477 | isdn_tty_change_speed(info); | 1468 | isdn_tty_change_speed(info); |
1478 | if ((old_termios->c_cflag & CRTSCTS) && | 1469 | if ((old_termios->c_cflag & CRTSCTS) && |
1479 | !(tty->termios->c_cflag & CRTSCTS)) { | 1470 | !(tty->termios->c_cflag & CRTSCTS)) |
1480 | tty->hw_stopped = 0; | 1471 | tty->hw_stopped = 0; |
1481 | } | ||
1482 | } | 1472 | } |
1483 | } | 1473 | } |
1484 | 1474 | ||