aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/i4l
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-04-02 07:53:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-09 14:16:55 -0400
commitba43294d51ac6491e60c2fc33a974a9a1002dfed (patch)
tree9bf10d228e138018a7c076e9c3bd7a5336141c21 /drivers/isdn/i4l
parent1b05f030a90569d9617d0fe42910f9e5c8cc59ec (diff)
TTY: isdn, use tty from tty_port
No recounting this time, just a plain switch. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/isdn/i4l')
-rw-r--r--drivers/isdn/i4l/isdn_tty.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index c81a725fde74..869885620c94 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -68,7 +68,7 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb)
68 if (!info->online) 68 if (!info->online)
69 return 0; 69 return 0;
70 70
71 tty = info->tty; 71 tty = info->port.tty;
72 if (!tty) 72 if (!tty)
73 return 0; 73 return 0;
74 74
@@ -144,7 +144,7 @@ isdn_tty_readmodem(void)
144 if ((info->vonline & 1) && (info->emu.vpar[1])) 144 if ((info->vonline & 1) && (info->emu.vpar[1]))
145 isdn_audio_eval_silence(info); 145 isdn_audio_eval_silence(info);
146#endif 146#endif
147 tty = info->tty; 147 tty = info->port.tty;
148 if (tty) { 148 if (tty) {
149 if (info->mcr & UART_MCR_RTS) { 149 if (info->mcr & UART_MCR_RTS) {
150 /* CISCO AsyncPPP Hack */ 150 /* CISCO AsyncPPP Hack */
@@ -300,7 +300,7 @@ isdn_tty_tint(modem_info *info)
300 len = skb->len; 300 len = skb->len;
301 if ((slen = isdn_writebuf_skb_stub(info->isdn_driver, 301 if ((slen = isdn_writebuf_skb_stub(info->isdn_driver,
302 info->isdn_channel, 1, skb)) == len) { 302 info->isdn_channel, 1, skb)) == len) {
303 struct tty_struct *tty = info->tty; 303 struct tty_struct *tty = info->port.tty;
304 info->send_outstanding++; 304 info->send_outstanding++;
305 info->msr &= ~UART_MSR_CTS; 305 info->msr &= ~UART_MSR_CTS;
306 info->lsr &= ~UART_LSR_TEMT; 306 info->lsr &= ~UART_LSR_TEMT;
@@ -705,7 +705,7 @@ isdn_tty_modem_hup(modem_info *info, int local)
705 printk(KERN_DEBUG "Mhup ttyI%d\n", info->line); 705 printk(KERN_DEBUG "Mhup ttyI%d\n", info->line);
706#endif 706#endif
707 info->rcvsched = 0; 707 info->rcvsched = 0;
708 isdn_tty_flush_buffer(info->tty); 708 isdn_tty_flush_buffer(info->port.tty);
709 if (info->online) { 709 if (info->online) {
710 info->last_lhup = local; 710 info->last_lhup = local;
711 info->online = 0; 711 info->online = 0;
@@ -1008,15 +1008,15 @@ isdn_tty_change_speed(modem_info *info)
1008 quot; 1008 quot;
1009 int i; 1009 int i;
1010 1010
1011 if (!info->tty || !info->tty->termios) 1011 if (!info->port.tty || !info->port.tty->termios)
1012 return; 1012 return;
1013 cflag = info->tty->termios->c_cflag; 1013 cflag = info->port.tty->termios->c_cflag;
1014 1014
1015 quot = i = cflag & CBAUD; 1015 quot = i = cflag & CBAUD;
1016 if (i & CBAUDEX) { 1016 if (i & CBAUDEX) {
1017 i &= ~CBAUDEX; 1017 i &= ~CBAUDEX;
1018 if (i < 1 || i > 2) 1018 if (i < 1 || i > 2)
1019 info->tty->termios->c_cflag &= ~CBAUDEX; 1019 info->port.tty->termios->c_cflag &= ~CBAUDEX;
1020 else 1020 else
1021 i += 15; 1021 i += 15;
1022 } 1022 }
@@ -1069,8 +1069,8 @@ isdn_tty_startup(modem_info *info)
1069 * Now, initialize the UART 1069 * Now, initialize the UART
1070 */ 1070 */
1071 info->mcr = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2; 1071 info->mcr = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2;
1072 if (info->tty) 1072 if (info->port.tty)
1073 clear_bit(TTY_IO_ERROR, &info->tty->flags); 1073 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
1074 /* 1074 /*
1075 * and set the speed of the serial port 1075 * and set the speed of the serial port
1076 */ 1076 */
@@ -1096,7 +1096,7 @@ isdn_tty_shutdown(modem_info *info)
1096#endif 1096#endif
1097 isdn_unlock_drivers(); 1097 isdn_unlock_drivers();
1098 info->msr &= ~UART_MSR_RI; 1098 info->msr &= ~UART_MSR_RI;
1099 if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) { 1099 if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) {
1100 info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); 1100 info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS);
1101 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { 1101 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) {
1102 isdn_tty_modem_reset_regs(info, 0); 1102 isdn_tty_modem_reset_regs(info, 0);
@@ -1106,8 +1106,8 @@ isdn_tty_shutdown(modem_info *info)
1106 isdn_tty_modem_hup(info, 1); 1106 isdn_tty_modem_hup(info, 1);
1107 } 1107 }
1108 } 1108 }
1109 if (info->tty) 1109 if (info->port.tty)
1110 set_bit(TTY_IO_ERROR, &info->tty->flags); 1110 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
1111 1111
1112 info->port.flags &= ~ASYNC_INITIALIZED; 1112 info->port.flags &= ~ASYNC_INITIALIZED;
1113} 1113}
@@ -1599,7 +1599,7 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp)
1599#endif 1599#endif
1600 info->port.count++; 1600 info->port.count++;
1601 tty->driver_data = info; 1601 tty->driver_data = info;
1602 info->tty = tty; 1602 info->port.tty = tty;
1603 tty->port = &info->port; 1603 tty->port = &info->port;
1604 /* 1604 /*
1605 * Start up serial port 1605 * Start up serial port
@@ -1692,7 +1692,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
1692 isdn_tty_shutdown(info); 1692 isdn_tty_shutdown(info);
1693 isdn_tty_flush_buffer(tty); 1693 isdn_tty_flush_buffer(tty);
1694 tty_ldisc_flush(tty); 1694 tty_ldisc_flush(tty);
1695 info->tty = NULL; 1695 info->port.tty = NULL;
1696 info->ncarrier = 0; 1696 info->ncarrier = 0;
1697 tty->closing = 0; 1697 tty->closing = 0;
1698 if (info->port.blocked_open) { 1698 if (info->port.blocked_open) {
@@ -1719,7 +1719,7 @@ isdn_tty_hangup(struct tty_struct *tty)
1719 isdn_tty_shutdown(info); 1719 isdn_tty_shutdown(info);
1720 info->port.count = 0; 1720 info->port.count = 0;
1721 info->port.flags &= ~ASYNC_NORMAL_ACTIVE; 1721 info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
1722 info->tty = NULL; 1722 info->port.tty = NULL;
1723 wake_up_interruptible(&info->port.open_wait); 1723 wake_up_interruptible(&info->port.open_wait);
1724} 1724}
1725 1725
@@ -1894,7 +1894,6 @@ isdn_tty_modem_init(void)
1894 isdn_tty_modem_reset_regs(info, 1); 1894 isdn_tty_modem_reset_regs(info, 1);
1895 info->magic = ISDN_ASYNC_MAGIC; 1895 info->magic = ISDN_ASYNC_MAGIC;
1896 info->line = i; 1896 info->line = i;
1897 info->tty = NULL;
1898 info->x_char = 0; 1897 info->x_char = 0;
1899 info->isdn_driver = -1; 1898 info->isdn_driver = -1;
1900 info->isdn_channel = -1; 1899 info->isdn_channel = -1;
@@ -2316,7 +2315,7 @@ isdn_tty_at_cout(char *msg, modem_info *info)
2316 l = strlen(msg); 2315 l = strlen(msg);
2317 2316
2318 spin_lock_irqsave(&info->readlock, flags); 2317 spin_lock_irqsave(&info->readlock, flags);
2319 tty = info->tty; 2318 tty = info->port.tty;
2320 if ((info->port.flags & ASYNC_CLOSING) || (!tty)) { 2319 if ((info->port.flags & ASYNC_CLOSING) || (!tty)) {
2321 spin_unlock_irqrestore(&info->readlock, flags); 2320 spin_unlock_irqrestore(&info->readlock, flags);
2322 return; 2321 return;
@@ -2468,12 +2467,12 @@ isdn_tty_modem_result(int code, modem_info *info)
2468#ifdef ISDN_DEBUG_MODEM_HUP 2467#ifdef ISDN_DEBUG_MODEM_HUP
2469 printk(KERN_DEBUG "modem_result: NO CARRIER %d %d\n", 2468 printk(KERN_DEBUG "modem_result: NO CARRIER %d %d\n",
2470 (info->port.flags & ASYNC_CLOSING), 2469 (info->port.flags & ASYNC_CLOSING),
2471 (!info->tty)); 2470 (!info->port.tty));
2472#endif 2471#endif
2473 m->mdmreg[REG_RINGCNT] = 0; 2472 m->mdmreg[REG_RINGCNT] = 0;
2474 del_timer(&info->nc_timer); 2473 del_timer(&info->nc_timer);
2475 info->ncarrier = 0; 2474 info->ncarrier = 0;
2476 if ((info->port.flags & ASYNC_CLOSING) || (!info->tty)) 2475 if ((info->port.flags & ASYNC_CLOSING) || (!info->port.tty))
2477 return; 2476 return;
2478 2477
2479#ifdef CONFIG_ISDN_AUDIO 2478#ifdef CONFIG_ISDN_AUDIO
@@ -2606,11 +2605,11 @@ isdn_tty_modem_result(int code, modem_info *info)
2606 } 2605 }
2607 } 2606 }
2608 if (code == RESULT_NO_CARRIER) { 2607 if (code == RESULT_NO_CARRIER) {
2609 if ((info->port.flags & ASYNC_CLOSING) || (!info->tty)) 2608 if ((info->port.flags & ASYNC_CLOSING) || (!info->port.tty))
2610 return; 2609 return;
2611 2610
2612 if (info->port.flags & ASYNC_CHECK_CD) 2611 if (info->port.flags & ASYNC_CHECK_CD)
2613 tty_hangup(info->tty); 2612 tty_hangup(info->port.tty);
2614 } 2613 }
2615} 2614}
2616 2615