diff options
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 32 | ||||
-rw-r--r-- | include/linux/isdn.h | 3 |
2 files changed, 6 insertions, 29 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 1d701cd6031b..27f70923c224 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -1504,18 +1504,11 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info * | |||
1504 | */ | 1504 | */ |
1505 | if ((filp->f_flags & O_NONBLOCK) || | 1505 | if ((filp->f_flags & O_NONBLOCK) || |
1506 | (tty->flags & (1 << TTY_IO_ERROR))) { | 1506 | (tty->flags & (1 << TTY_IO_ERROR))) { |
1507 | if (info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) | ||
1508 | return -EBUSY; | ||
1509 | info->flags |= ISDN_ASYNC_NORMAL_ACTIVE; | 1507 | info->flags |= ISDN_ASYNC_NORMAL_ACTIVE; |
1510 | return 0; | 1508 | return 0; |
1511 | } | 1509 | } |
1512 | if (info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) { | 1510 | if (tty->termios->c_cflag & CLOCAL) |
1513 | if (info->normal_termios.c_cflag & CLOCAL) | 1511 | do_clocal = 1; |
1514 | do_clocal = 1; | ||
1515 | } else { | ||
1516 | if (tty->termios->c_cflag & CLOCAL) | ||
1517 | do_clocal = 1; | ||
1518 | } | ||
1519 | /* | 1512 | /* |
1520 | * Block waiting for the carrier detect and the line to become | 1513 | * Block waiting for the carrier detect and the line to become |
1521 | * free (i.e., not in use by the callout). While we are in | 1514 | * free (i.e., not in use by the callout). While we are in |
@@ -1546,8 +1539,7 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info * | |||
1546 | #endif | 1539 | #endif |
1547 | break; | 1540 | break; |
1548 | } | 1541 | } |
1549 | if (!(info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) && | 1542 | if (!(info->flags & ISDN_ASYNC_CLOSING) && |
1550 | !(info->flags & ISDN_ASYNC_CLOSING) && | ||
1551 | (do_clocal || (info->msr & UART_MSR_DCD))) { | 1543 | (do_clocal || (info->msr & UART_MSR_DCD))) { |
1552 | break; | 1544 | break; |
1553 | } | 1545 | } |
@@ -1670,14 +1662,6 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) | |||
1670 | return; | 1662 | return; |
1671 | } | 1663 | } |
1672 | info->flags |= ISDN_ASYNC_CLOSING; | 1664 | info->flags |= ISDN_ASYNC_CLOSING; |
1673 | /* | ||
1674 | * Save the termios structure, since this port may have | ||
1675 | * separate termios for callout and dialin. | ||
1676 | */ | ||
1677 | if (info->flags & ISDN_ASYNC_NORMAL_ACTIVE) | ||
1678 | info->normal_termios = *tty->termios; | ||
1679 | if (info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) | ||
1680 | info->callout_termios = *tty->termios; | ||
1681 | 1665 | ||
1682 | tty->closing = 1; | 1666 | tty->closing = 1; |
1683 | /* | 1667 | /* |
@@ -1731,7 +1715,7 @@ isdn_tty_hangup(struct tty_struct *tty) | |||
1731 | return; | 1715 | return; |
1732 | isdn_tty_shutdown(info); | 1716 | isdn_tty_shutdown(info); |
1733 | info->count = 0; | 1717 | info->count = 0; |
1734 | info->flags &= ~(ISDN_ASYNC_NORMAL_ACTIVE | ISDN_ASYNC_CALLOUT_ACTIVE); | 1718 | info->flags &= ~ISDN_ASYNC_NORMAL_ACTIVE; |
1735 | info->tty = NULL; | 1719 | info->tty = NULL; |
1736 | wake_up_interruptible(&info->open_wait); | 1720 | wake_up_interruptible(&info->open_wait); |
1737 | } | 1721 | } |
@@ -2116,8 +2100,7 @@ isdn_tty_find_icall(int di, int ch, setup_parm *setup) | |||
2116 | return (wret == 2) ? 3 : 0; | 2100 | return (wret == 2) ? 3 : 0; |
2117 | } | 2101 | } |
2118 | 2102 | ||
2119 | #define TTY_IS_ACTIVE(info) \ | 2103 | #define TTY_IS_ACTIVE(info) (info->flags & ISDN_ASYNC_NORMAL_ACTIVE) |
2120 | (info->flags & (ISDN_ASYNC_NORMAL_ACTIVE | ISDN_ASYNC_CALLOUT_ACTIVE)) | ||
2121 | 2104 | ||
2122 | int | 2105 | int |
2123 | isdn_tty_stat_callback(int i, isdn_ctrl *c) | 2106 | isdn_tty_stat_callback(int i, isdn_ctrl *c) |
@@ -2628,11 +2611,8 @@ isdn_tty_modem_result(int code, modem_info *info) | |||
2628 | if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) { | 2611 | if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) { |
2629 | return; | 2612 | return; |
2630 | } | 2613 | } |
2631 | if ((info->flags & ISDN_ASYNC_CHECK_CD) && | 2614 | if (info->flags & ISDN_ASYNC_CHECK_CD) |
2632 | (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) && | ||
2633 | (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) { | ||
2634 | tty_hangup(info->tty); | 2615 | tty_hangup(info->tty); |
2635 | } | ||
2636 | } | 2616 | } |
2637 | } | 2617 | } |
2638 | 2618 | ||
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 292f27a793d4..d13b76df34b3 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -393,7 +393,6 @@ typedef struct isdn_net_dev_s { | |||
393 | 393 | ||
394 | #define ISDN_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking */ | 394 | #define ISDN_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking */ |
395 | #define ISDN_ASYNC_INITIALIZED 0x80000000 /* port was initialized */ | 395 | #define ISDN_ASYNC_INITIALIZED 0x80000000 /* port was initialized */ |
396 | #define ISDN_ASYNC_CALLOUT_ACTIVE 0x40000000 /* Call out device active */ | ||
397 | #define ISDN_ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device active */ | 396 | #define ISDN_ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device active */ |
398 | #define ISDN_ASYNC_CLOSING 0x08000000 /* Serial port is closing */ | 397 | #define ISDN_ASYNC_CLOSING 0x08000000 /* Serial port is closing */ |
399 | #define ISDN_ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */ | 398 | #define ISDN_ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */ |
@@ -498,8 +497,6 @@ typedef struct modem_info { | |||
498 | #endif | 497 | #endif |
499 | struct tty_struct *tty; /* Pointer to corresponding tty */ | 498 | struct tty_struct *tty; /* Pointer to corresponding tty */ |
500 | atemu emu; /* AT-emulator data */ | 499 | atemu emu; /* AT-emulator data */ |
501 | struct ktermios normal_termios; /* For saving termios structs */ | ||
502 | struct ktermios callout_termios; | ||
503 | wait_queue_head_t open_wait, close_wait; | 500 | wait_queue_head_t open_wait, close_wait; |
504 | spinlock_t readlock; | 501 | spinlock_t readlock; |
505 | } modem_info; | 502 | } modem_info; |