Lines Matching refs:info
62 isdn_tty_try_read(modem_info *info, struct sk_buff *skb) in isdn_tty_try_read() argument
64 struct tty_port *port = &info->port; in isdn_tty_try_read()
69 if (!info->online) in isdn_tty_try_read()
72 if (!(info->mcr & UART_MCR_RTS)) in isdn_tty_try_read()
105 if (info->emu.mdmreg[REG_CPPP] & BIT_CPPP) in isdn_tty_try_read()
126 modem_info *info; in isdn_tty_readmodem() local
133 info = &dev->mdm.info[midx]; in isdn_tty_readmodem()
134 if (!info->online) in isdn_tty_readmodem()
139 isdn_audio_eval_dtmf(info); in isdn_tty_readmodem()
140 if ((info->vonline & 1) && (info->emu.vpar[1])) in isdn_tty_readmodem()
141 isdn_audio_eval_silence(info); in isdn_tty_readmodem()
143 if (info->mcr & UART_MCR_RTS) { in isdn_tty_readmodem()
145 if (!(info->emu.mdmreg[REG_CPPP] & BIT_CPPP)) in isdn_tty_readmodem()
146 r = isdn_readbchan_tty(info->isdn_driver, in isdn_tty_readmodem()
147 info->isdn_channel, in isdn_tty_readmodem()
148 &info->port, 0); in isdn_tty_readmodem()
150 r = isdn_readbchan_tty(info->isdn_driver, in isdn_tty_readmodem()
151 info->isdn_channel, in isdn_tty_readmodem()
152 &info->port, 1); in isdn_tty_readmodem()
154 tty_flip_buffer_push(&info->port); in isdn_tty_readmodem()
159 info->rcvsched = 0; in isdn_tty_readmodem()
162 info->rcvsched = 1; in isdn_tty_readmodem()
176 modem_info *info; in isdn_tty_rcv_skb() local
182 info = &dev->mdm.info[midx]; in isdn_tty_rcv_skb()
186 if ((info->vonline) && (!info->emu.vpar[4])) in isdn_tty_rcv_skb()
187 isdn_audio_calc_dtmf(info, skb->data, skb->len, ifmt); in isdn_tty_rcv_skb()
188 if ((info->vonline & 1) && (info->emu.vpar[1])) in isdn_tty_rcv_skb()
189 isdn_audio_calc_silence(info, skb->data, skb->len, ifmt); in isdn_tty_rcv_skb()
191 if ((info->online < 2) in isdn_tty_rcv_skb()
193 && (!(info->vonline & 1)) in isdn_tty_rcv_skb()
200 if (info->emu.mdmreg[REG_T70] & BIT_T70) { in isdn_tty_rcv_skb()
201 if (info->emu.mdmreg[REG_T70] & BIT_T70_EXT) { in isdn_tty_rcv_skb()
216 if (info->vonline & 1) { in isdn_tty_rcv_skb()
218 switch (info->emu.vpar[3]) { in isdn_tty_rcv_skb()
226 skb_trim(skb, isdn_audio_xlaw2adpcm(info->adpcmr, in isdn_tty_rcv_skb()
248 if (info->faxonline & 2) { in isdn_tty_rcv_skb()
249 isdn_tty_fax_bitorder(info, skb); in isdn_tty_rcv_skb()
257 spin_lock_irqsave(&info->readlock, flags); in isdn_tty_rcv_skb()
259 if (isdn_tty_try_read(info, skb)) { in isdn_tty_rcv_skb()
260 spin_unlock_irqrestore(&info->readlock, flags); in isdn_tty_rcv_skb()
273 spin_unlock_irqrestore(&info->readlock, flags); in isdn_tty_rcv_skb()
275 if ((dev->modempoll) && (info->rcvsched)) in isdn_tty_rcv_skb()
281 isdn_tty_cleanup_xmit(modem_info *info) in isdn_tty_cleanup_xmit() argument
283 skb_queue_purge(&info->xmit_queue); in isdn_tty_cleanup_xmit()
285 skb_queue_purge(&info->dtmf_queue); in isdn_tty_cleanup_xmit()
290 isdn_tty_tint(modem_info *info) in isdn_tty_tint() argument
292 struct sk_buff *skb = skb_dequeue(&info->xmit_queue); in isdn_tty_tint()
298 if ((slen = isdn_writebuf_skb_stub(info->isdn_driver, in isdn_tty_tint()
299 info->isdn_channel, 1, skb)) == len) { in isdn_tty_tint()
300 struct tty_struct *tty = info->port.tty; in isdn_tty_tint()
301 info->send_outstanding++; in isdn_tty_tint()
302 info->msr &= ~UART_MSR_CTS; in isdn_tty_tint()
303 info->lsr &= ~UART_LSR_TEMT; in isdn_tty_tint()
312 skb_queue_head(&info->xmit_queue, skb); in isdn_tty_tint()
331 isdn_tty_handleDLEdown(modem_info *info, atemu *m, int len) in isdn_tty_handleDLEdown() argument
333 unsigned char *p = &info->port.xmit_buf[info->xmit_count]; in isdn_tty_handleDLEdown()
349 info->vonline |= 4; in isdn_tty_handleDLEdown()
353 info->vonline &= ~1; in isdn_tty_handleDLEdown()
357 info->line); in isdn_tty_handleDLEdown()
359 isdn_tty_at_cout("\020\003", info); in isdn_tty_handleDLEdown()
360 if (!info->vonline) { in isdn_tty_handleDLEdown()
364 info->line); in isdn_tty_handleDLEdown()
366 isdn_tty_at_cout("\r\nVCON\r\n", info); in isdn_tty_handleDLEdown()
422 isdn_tty_senddown(modem_info *info) in isdn_tty_senddown() argument
432 if (info->vonline & 4) { in isdn_tty_senddown()
433 info->vonline &= ~6; in isdn_tty_senddown()
434 if (!info->vonline) { in isdn_tty_senddown()
438 info->line); in isdn_tty_senddown()
440 isdn_tty_at_cout("\r\nVCON\r\n", info); in isdn_tty_senddown()
444 if (!(buflen = info->xmit_count)) in isdn_tty_senddown()
446 if ((info->emu.mdmreg[REG_CTS] & BIT_CTS) != 0) in isdn_tty_senddown()
447 info->msr &= ~UART_MSR_CTS; in isdn_tty_senddown()
448 info->lsr &= ~UART_LSR_TEMT; in isdn_tty_senddown()
453 atomic_inc(&info->xmit_lock); in isdn_tty_senddown()
454 if (!(atomic_dec_and_test(&info->xmit_lock))) in isdn_tty_senddown()
456 if (info->isdn_driver < 0) { in isdn_tty_senddown()
457 info->xmit_count = 0; in isdn_tty_senddown()
460 skb_res = dev->drv[info->isdn_driver]->interface->hl_hdrlen + 4; in isdn_tty_senddown()
462 if (info->vonline & 2) in isdn_tty_senddown()
463 audio_len = buflen * voice_cf[info->emu.vpar[3]]; in isdn_tty_senddown()
473 info->line); in isdn_tty_senddown()
477 skb_put_data(skb, info->port.xmit_buf, buflen); in isdn_tty_senddown()
478 info->xmit_count = 0; in isdn_tty_senddown()
480 if (info->vonline & 2) { in isdn_tty_senddown()
490 switch (info->emu.vpar[3]) { in isdn_tty_senddown()
497 audio_len = isdn_audio_adpcm2xlaw(info->adpcms, in isdn_tty_senddown()
520 if (info->emu.mdmreg[REG_T70] & BIT_T70) { in isdn_tty_senddown()
522 if (info->emu.mdmreg[REG_T70] & BIT_T70_EXT) in isdn_tty_senddown()
527 skb_queue_tail(&info->xmit_queue, skb); in isdn_tty_senddown()
546 modem_info *info = from_timer(info, t, nc_timer); in isdn_tty_modem_do_ncarrier() local
547 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_modem_do_ncarrier()
556 isdn_tty_modem_ncarrier(modem_info *info) in isdn_tty_modem_ncarrier() argument
558 if (info->ncarrier) { in isdn_tty_modem_ncarrier()
559 info->nc_timer.expires = jiffies + HZ; in isdn_tty_modem_ncarrier()
560 add_timer(&info->nc_timer); in isdn_tty_modem_ncarrier()
597 isdn_tty_dial(char *n, modem_info *info, atemu *m) in isdn_tty_dial() argument
629 isdn_tty_modem_result(RESULT_NO_DIALTONE, info); in isdn_tty_dial()
631 info->isdn_driver = dev->drvmap[i]; in isdn_tty_dial()
632 info->isdn_channel = dev->chanmap[i]; in isdn_tty_dial()
633 info->drv_index = i; in isdn_tty_dial()
634 dev->m_idx[i] = info->line; in isdn_tty_dial()
636 info->last_dir = 1; in isdn_tty_dial()
637 strcpy(info->last_num, n); in isdn_tty_dial()
640 cmd.driver = info->isdn_driver; in isdn_tty_dial()
641 cmd.arg = info->isdn_channel; in isdn_tty_dial()
644 strcpy(cmd.parm.num, isdn_map_eaz2msn(m->msn, info->isdn_driver)); in isdn_tty_dial()
645 cmd.driver = info->isdn_driver; in isdn_tty_dial()
648 cmd.driver = info->isdn_driver; in isdn_tty_dial()
650 info->last_l2 = l2; in isdn_tty_dial()
651 cmd.arg = info->isdn_channel + (l2 << 8); in isdn_tty_dial()
653 cmd.driver = info->isdn_driver; in isdn_tty_dial()
655 cmd.arg = info->isdn_channel + (m->mdmreg[REG_L3PROT] << 8); in isdn_tty_dial()
658 cmd.parm.fax = info->fax; in isdn_tty_dial()
659 info->fax->direction = ISDN_TTY_FAX_CONN_OUT; in isdn_tty_dial()
663 cmd.driver = info->isdn_driver; in isdn_tty_dial()
664 cmd.arg = info->isdn_channel; in isdn_tty_dial()
667 isdn_map_eaz2msn(m->msn, info->isdn_driver)); in isdn_tty_dial()
671 info->dialing = 1; in isdn_tty_dial()
672 info->emu.carrierwait = 0; in isdn_tty_dial()
685 isdn_tty_modem_hup(modem_info *info, int local) in isdn_tty_modem_hup() argument
690 if (!info) in isdn_tty_modem_hup()
693 di = info->isdn_driver; in isdn_tty_modem_hup()
694 ch = info->isdn_channel; in isdn_tty_modem_hup()
698 info->isdn_driver = -1; in isdn_tty_modem_hup()
699 info->isdn_channel = -1; in isdn_tty_modem_hup()
702 printk(KERN_DEBUG "Mhup ttyI%d\n", info->line); in isdn_tty_modem_hup()
704 info->rcvsched = 0; in isdn_tty_modem_hup()
705 isdn_tty_flush_buffer(info->port.tty); in isdn_tty_modem_hup()
706 if (info->online) { in isdn_tty_modem_hup()
707 info->last_lhup = local; in isdn_tty_modem_hup()
708 info->online = 0; in isdn_tty_modem_hup()
709 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_modem_hup()
712 info->vonline = 0; in isdn_tty_modem_hup()
714 info->faxonline = 0; in isdn_tty_modem_hup()
715 info->fax->phase = ISDN_FAX_PHASE_IDLE; in isdn_tty_modem_hup()
717 info->emu.vpar[4] = 0; in isdn_tty_modem_hup()
718 info->emu.vpar[5] = 8; in isdn_tty_modem_hup()
719 kfree(info->dtmf_state); in isdn_tty_modem_hup()
720 info->dtmf_state = NULL; in isdn_tty_modem_hup()
721 kfree(info->silence_state); in isdn_tty_modem_hup()
722 info->silence_state = NULL; in isdn_tty_modem_hup()
723 kfree(info->adpcms); in isdn_tty_modem_hup()
724 info->adpcms = NULL; in isdn_tty_modem_hup()
725 kfree(info->adpcmr); in isdn_tty_modem_hup()
726 info->adpcmr = NULL; in isdn_tty_modem_hup()
728 if ((info->msr & UART_MSR_RI) && in isdn_tty_modem_hup()
729 (info->emu.mdmreg[REG_RUNG] & BIT_RUNG)) in isdn_tty_modem_hup()
730 isdn_tty_modem_result(RESULT_RUNG, info); in isdn_tty_modem_hup()
731 info->msr &= ~(UART_MSR_DCD | UART_MSR_RI); in isdn_tty_modem_hup()
732 info->lsr |= UART_LSR_TEMT; in isdn_tty_modem_hup()
742 info->emu.mdmreg[REG_RINGCNT] = 0; in isdn_tty_modem_hup()
745 if (info->drv_index >= 0) { in isdn_tty_modem_hup()
746 dev->m_idx[info->drv_index] = -1; in isdn_tty_modem_hup()
747 info->drv_index = -1; in isdn_tty_modem_hup()
766 isdn_tty_suspend(char *id, modem_info *info, atemu *m) in isdn_tty_suspend() argument
772 if (!info) in isdn_tty_suspend()
776 printk(KERN_DEBUG "Msusp ttyI%d\n", info->line); in isdn_tty_suspend()
779 if ((info->isdn_driver >= 0)) { in isdn_tty_suspend()
783 cmd.parm.cmsg.adr.Controller = info->isdn_driver + 1; in isdn_tty_suspend()
792 cmd.driver = info->isdn_driver; in isdn_tty_suspend()
793 cmd.arg = info->isdn_channel; in isdn_tty_suspend()
806 isdn_tty_resume(char *id, modem_info *info, atemu *m) in isdn_tty_resume() argument
840 isdn_tty_modem_result(RESULT_NO_DIALTONE, info); in isdn_tty_resume()
842 info->isdn_driver = dev->drvmap[i]; in isdn_tty_resume()
843 info->isdn_channel = dev->chanmap[i]; in isdn_tty_resume()
844 info->drv_index = i; in isdn_tty_resume()
845 dev->m_idx[i] = info->line; in isdn_tty_resume()
847 info->last_dir = 1; in isdn_tty_resume()
851 cmd.driver = info->isdn_driver; in isdn_tty_resume()
852 cmd.arg = info->isdn_channel; in isdn_tty_resume()
855 strcpy(cmd.parm.num, isdn_map_eaz2msn(m->msn, info->isdn_driver)); in isdn_tty_resume()
856 cmd.driver = info->isdn_driver; in isdn_tty_resume()
859 cmd.driver = info->isdn_driver; in isdn_tty_resume()
861 info->last_l2 = l2; in isdn_tty_resume()
862 cmd.arg = info->isdn_channel + (l2 << 8); in isdn_tty_resume()
864 cmd.driver = info->isdn_driver; in isdn_tty_resume()
866 cmd.arg = info->isdn_channel + (m->mdmreg[REG_L3PROT] << 8); in isdn_tty_resume()
868 cmd.driver = info->isdn_driver; in isdn_tty_resume()
869 cmd.arg = info->isdn_channel; in isdn_tty_resume()
873 cmd.parm.cmsg.adr.Controller = info->isdn_driver + 1; in isdn_tty_resume()
882 info->dialing = 1; in isdn_tty_resume()
895 isdn_tty_send_msg(modem_info *info, atemu *m, char *msg) in isdn_tty_send_msg() argument
910 isdn_tty_modem_result(RESULT_ERROR, info); in isdn_tty_send_msg()
935 isdn_tty_modem_result(RESULT_NO_DIALTONE, info); in isdn_tty_send_msg()
937 info->isdn_driver = dev->drvmap[i]; in isdn_tty_send_msg()
938 info->isdn_channel = dev->chanmap[i]; in isdn_tty_send_msg()
939 info->drv_index = i; in isdn_tty_send_msg()
940 dev->m_idx[i] = info->line; in isdn_tty_send_msg()
942 info->last_dir = 1; in isdn_tty_send_msg()
945 cmd.driver = info->isdn_driver; in isdn_tty_send_msg()
946 cmd.arg = info->isdn_channel; in isdn_tty_send_msg()
949 strcpy(cmd.parm.num, isdn_map_eaz2msn(m->msn, info->isdn_driver)); in isdn_tty_send_msg()
950 cmd.driver = info->isdn_driver; in isdn_tty_send_msg()
953 cmd.driver = info->isdn_driver; in isdn_tty_send_msg()
955 info->last_l2 = l2; in isdn_tty_send_msg()
956 cmd.arg = info->isdn_channel + (l2 << 8); in isdn_tty_send_msg()
958 cmd.driver = info->isdn_driver; in isdn_tty_send_msg()
960 cmd.arg = info->isdn_channel + (m->mdmreg[REG_L3PROT] << 8); in isdn_tty_send_msg()
962 cmd.driver = info->isdn_driver; in isdn_tty_send_msg()
963 cmd.arg = info->isdn_channel; in isdn_tty_send_msg()
967 cmd.parm.cmsg.adr.Controller = info->isdn_driver + 1; in isdn_tty_send_msg()
981 isdn_tty_paranoia_check(modem_info *info, char *name, const char *routine) in isdn_tty_paranoia_check() argument
984 if (!info) { in isdn_tty_paranoia_check()
989 if (info->magic != ISDN_ASYNC_MAGIC) { in isdn_tty_paranoia_check()
1003 isdn_tty_change_speed(modem_info *info) in isdn_tty_change_speed() argument
1005 struct tty_port *port = &info->port; in isdn_tty_change_speed()
1024 info->mcr |= UART_MCR_DTR; in isdn_tty_change_speed()
1025 isdn_tty_modem_ncarrier(info); in isdn_tty_change_speed()
1027 info->mcr &= ~UART_MCR_DTR; in isdn_tty_change_speed()
1028 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { in isdn_tty_change_speed()
1032 if (info->online) in isdn_tty_change_speed()
1033 info->ncarrier = 1; in isdn_tty_change_speed()
1034 isdn_tty_modem_reset_regs(info, 0); in isdn_tty_change_speed()
1035 isdn_tty_modem_hup(info, 1); in isdn_tty_change_speed()
1051 isdn_tty_startup(modem_info *info) in isdn_tty_startup() argument
1053 if (tty_port_initialized(&info->port)) in isdn_tty_startup()
1057 printk(KERN_DEBUG "starting up ttyi%d ...\n", info->line); in isdn_tty_startup()
1062 info->mcr = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2; in isdn_tty_startup()
1063 if (info->port.tty) in isdn_tty_startup()
1064 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in isdn_tty_startup()
1068 isdn_tty_change_speed(info); in isdn_tty_startup()
1070 tty_port_set_initialized(&info->port, 1); in isdn_tty_startup()
1071 info->msr |= (UART_MSR_DSR | UART_MSR_CTS); in isdn_tty_startup()
1072 info->send_outstanding = 0; in isdn_tty_startup()
1081 isdn_tty_shutdown(modem_info *info) in isdn_tty_shutdown() argument
1083 if (!tty_port_initialized(&info->port)) in isdn_tty_shutdown()
1086 printk(KERN_DEBUG "Shutting down isdnmodem port %d ....\n", info->line); in isdn_tty_shutdown()
1089 info->msr &= ~UART_MSR_RI; in isdn_tty_shutdown()
1090 if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) { in isdn_tty_shutdown()
1091 info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); in isdn_tty_shutdown()
1092 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { in isdn_tty_shutdown()
1093 isdn_tty_modem_reset_regs(info, 0); in isdn_tty_shutdown()
1097 isdn_tty_modem_hup(info, 1); in isdn_tty_shutdown()
1100 if (info->port.tty) in isdn_tty_shutdown()
1101 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in isdn_tty_shutdown()
1103 tty_port_set_initialized(&info->port, 0); in isdn_tty_shutdown()
1120 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_write() local
1121 atemu *m = &info->emu; in isdn_tty_write()
1123 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_write")) in isdn_tty_write()
1126 atomic_inc(&info->xmit_lock); in isdn_tty_write()
1129 if (c > info->xmit_size - info->xmit_count) in isdn_tty_write()
1130 c = info->xmit_size - info->xmit_count; in isdn_tty_write()
1131 if (info->isdn_driver >= 0 && c > dev->drv[info->isdn_driver]->maxbufsize) in isdn_tty_write()
1132 c = dev->drv[info->isdn_driver]->maxbufsize; in isdn_tty_write()
1135 if ((info->online > 1) in isdn_tty_write()
1137 || (info->vonline & 3) in isdn_tty_write()
1141 if (!info->vonline) in isdn_tty_write()
1146 memcpy(&info->port.xmit_buf[info->xmit_count], buf, c); in isdn_tty_write()
1148 if (info->vonline) { in isdn_tty_write()
1149 int cc = isdn_tty_handleDLEdown(info, m, c); in isdn_tty_write()
1150 if (info->vonline & 2) { in isdn_tty_write()
1156 info->msr |= UART_MSR_CTS; in isdn_tty_write()
1157 info->lsr |= UART_LSR_TEMT; in isdn_tty_write()
1159 info->xmit_count += cc; in isdn_tty_write()
1161 if ((info->vonline & 3) == 1) { in isdn_tty_write()
1166 info->vonline &= ~1; in isdn_tty_write()
1170 info->line); in isdn_tty_write()
1172 isdn_tty_at_cout("\020\003\r\nVCON\r\n", info); in isdn_tty_write()
1176 if (TTY_IS_FCLASS1(info)) { in isdn_tty_write()
1177 int cc = isdn_tty_handleDLEdown(info, m, c); in isdn_tty_write()
1179 if (info->vonline & 4) { /* ETX seen */ in isdn_tty_write()
1183 c.driver = info->isdn_driver; in isdn_tty_write()
1184 c.arg = info->isdn_channel; in isdn_tty_write()
1189 info->vonline = 0; in isdn_tty_write()
1193 info->xmit_count += cc; in isdn_tty_write()
1196 info->xmit_count += c; in isdn_tty_write()
1198 info->msr |= UART_MSR_CTS; in isdn_tty_write()
1199 info->lsr |= UART_LSR_TEMT; in isdn_tty_write()
1200 if (info->dialing) { in isdn_tty_write()
1201 info->dialing = 0; in isdn_tty_write()
1205 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_write()
1206 isdn_tty_modem_hup(info, 1); in isdn_tty_write()
1208 c = isdn_tty_edit_at(buf, c, info); in isdn_tty_write()
1214 atomic_dec(&info->xmit_lock); in isdn_tty_write()
1215 if ((info->xmit_count) || !skb_queue_empty(&info->xmit_queue)) { in isdn_tty_write()
1217 isdn_tty_senddown(info); in isdn_tty_write()
1218 isdn_tty_tint(info); in isdn_tty_write()
1228 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_write_room() local
1231 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_write_room")) in isdn_tty_write_room()
1233 if (!info->online) in isdn_tty_write_room()
1234 return info->xmit_size; in isdn_tty_write_room()
1235 ret = info->xmit_size - info->xmit_count; in isdn_tty_write_room()
1242 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_chars_in_buffer() local
1244 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_chars_in_buffer")) in isdn_tty_chars_in_buffer()
1246 if (!info->online) in isdn_tty_chars_in_buffer()
1248 return (info->xmit_count); in isdn_tty_chars_in_buffer()
1254 modem_info *info; in isdn_tty_flush_buffer() local
1259 info = (modem_info *) tty->driver_data; in isdn_tty_flush_buffer()
1260 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_buffer")) { in isdn_tty_flush_buffer()
1263 isdn_tty_cleanup_xmit(info); in isdn_tty_flush_buffer()
1264 info->xmit_count = 0; in isdn_tty_flush_buffer()
1271 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_flush_chars() local
1273 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_flush_chars")) in isdn_tty_flush_chars()
1275 if ((info->xmit_count) || !skb_queue_empty(&info->xmit_queue)) in isdn_tty_flush_chars()
1290 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_throttle() local
1292 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_throttle")) in isdn_tty_throttle()
1295 info->x_char = STOP_CHAR(tty); in isdn_tty_throttle()
1296 info->mcr &= ~UART_MCR_RTS; in isdn_tty_throttle()
1302 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_unthrottle() local
1304 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_unthrottle")) in isdn_tty_unthrottle()
1307 if (info->x_char) in isdn_tty_unthrottle()
1308 info->x_char = 0; in isdn_tty_unthrottle()
1310 info->x_char = START_CHAR(tty); in isdn_tty_unthrottle()
1312 info->mcr |= UART_MCR_RTS; in isdn_tty_unthrottle()
1332 isdn_tty_get_lsr_info(modem_info *info, uint __user *value) in isdn_tty_get_lsr_info() argument
1337 status = info->lsr; in isdn_tty_get_lsr_info()
1346 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_tiocmget() local
1349 if (isdn_tty_paranoia_check(info, tty->name, __func__)) in isdn_tty_tiocmget()
1356 printk(KERN_DEBUG "ttyI%d ioctl TIOCMGET\n", info->line); in isdn_tty_tiocmget()
1359 control = info->mcr; in isdn_tty_tiocmget()
1360 status = info->msr; in isdn_tty_tiocmget()
1374 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_tiocmset() local
1376 if (isdn_tty_paranoia_check(info, tty->name, __func__)) in isdn_tty_tiocmset()
1382 printk(KERN_DEBUG "ttyI%d ioctl TIOCMxxx: %x %x\n", info->line, set, clear); in isdn_tty_tiocmset()
1387 info->mcr |= UART_MCR_RTS; in isdn_tty_tiocmset()
1389 info->mcr |= UART_MCR_DTR; in isdn_tty_tiocmset()
1390 isdn_tty_modem_ncarrier(info); in isdn_tty_tiocmset()
1394 info->mcr &= ~UART_MCR_RTS; in isdn_tty_tiocmset()
1396 info->mcr &= ~UART_MCR_DTR; in isdn_tty_tiocmset()
1397 if (info->emu.mdmreg[REG_DTRHUP] & BIT_DTRHUP) { in isdn_tty_tiocmset()
1398 isdn_tty_modem_reset_regs(info, 0); in isdn_tty_tiocmset()
1402 if (info->online) in isdn_tty_tiocmset()
1403 info->ncarrier = 1; in isdn_tty_tiocmset()
1404 isdn_tty_modem_hup(info, 1); in isdn_tty_tiocmset()
1414 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_ioctl() local
1417 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_ioctl")) in isdn_tty_ioctl()
1424 printk(KERN_DEBUG "ttyI%d ioctl TCSBRK\n", info->line); in isdn_tty_ioctl()
1433 printk(KERN_DEBUG "ttyI%d ioctl TCSBRKP\n", info->line); in isdn_tty_ioctl()
1442 printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); in isdn_tty_ioctl()
1444 return isdn_tty_get_lsr_info(info, (uint __user *) arg); in isdn_tty_ioctl()
1447 printk(KERN_DEBUG "UNKNOWN ioctl 0x%08x on ttyi%d\n", cmd, info->line); in isdn_tty_ioctl()
1457 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_set_termios() local
1461 isdn_tty_change_speed(info); in isdn_tty_set_termios()
1469 isdn_tty_change_speed(info); in isdn_tty_set_termios()
1482 modem_info *info = &dev->mdm.info[tty->index]; in isdn_tty_install() local
1484 if (isdn_tty_paranoia_check(info, tty->name, __func__)) in isdn_tty_install()
1487 tty->driver_data = info; in isdn_tty_install()
1489 return tty_port_install(&info->port, driver, tty); in isdn_tty_install()
1501 modem_info *info = tty->driver_data; in isdn_tty_open() local
1502 struct tty_port *port = &info->port; in isdn_tty_open()
1514 retval = isdn_tty_startup(info); in isdn_tty_open()
1529 printk(KERN_DEBUG "isdn_tty_open ttyi%d successful...\n", info->line); in isdn_tty_open()
1541 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_close() local
1542 struct tty_port *port = &info->port; in isdn_tty_close()
1545 if (!info || isdn_tty_paranoia_check(info, tty->name, "isdn_tty_close")) in isdn_tty_close()
1567 info->line, port->count); in isdn_tty_close()
1576 info->closing = 1; in isdn_tty_close()
1593 while (!(info->lsr & UART_LSR_TEMT)) { in isdn_tty_close()
1600 isdn_tty_shutdown(info); in isdn_tty_close()
1604 info->ncarrier = 0; in isdn_tty_close()
1607 info->closing = 0; in isdn_tty_close()
1619 modem_info *info = (modem_info *) tty->driver_data; in isdn_tty_hangup() local
1620 struct tty_port *port = &info->port; in isdn_tty_hangup()
1622 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_hangup")) in isdn_tty_hangup()
1624 isdn_tty_shutdown(info); in isdn_tty_hangup()
1677 isdn_tty_modem_reset_faxpar(modem_info *info) in isdn_tty_modem_reset_faxpar() argument
1679 T30_s *f = info->fax; in isdn_tty_modem_reset_faxpar()
1710 isdn_tty_modem_reset_regs(modem_info *info, int force) in isdn_tty_modem_reset_regs() argument
1712 atemu *m = &info->emu; in isdn_tty_modem_reset_regs()
1717 info->xmit_size = m->mdmreg[REG_PSIZE] * 16; in isdn_tty_modem_reset_regs()
1723 isdn_tty_modem_reset_faxpar(info); in isdn_tty_modem_reset_regs()
1758 modem_info *info = container_of(port, modem_info, port); in isdn_tty_carrier_raised() local
1759 return info->msr & UART_MSR_DCD; in isdn_tty_carrier_raised()
1771 modem_info *info; in isdn_tty_modem_init() local
1793 info = &m->info[i]; in isdn_tty_modem_init()
1795 if (!(info->fax = kmalloc(sizeof(T30_s), GFP_KERNEL))) { in isdn_tty_modem_init()
1801 tty_port_init(&info->port); in isdn_tty_modem_init()
1802 info->port.ops = &isdn_tty_port_ops; in isdn_tty_modem_init()
1803 spin_lock_init(&info->readlock); in isdn_tty_modem_init()
1804 sprintf(info->last_cause, "0000"); in isdn_tty_modem_init()
1805 sprintf(info->last_num, "none"); in isdn_tty_modem_init()
1806 info->last_dir = 0; in isdn_tty_modem_init()
1807 info->last_lhup = 1; in isdn_tty_modem_init()
1808 info->last_l2 = -1; in isdn_tty_modem_init()
1809 info->last_si = 0; in isdn_tty_modem_init()
1810 isdn_tty_reset_profile(&info->emu); in isdn_tty_modem_init()
1811 isdn_tty_modem_reset_regs(info, 1); in isdn_tty_modem_init()
1812 info->magic = ISDN_ASYNC_MAGIC; in isdn_tty_modem_init()
1813 info->line = i; in isdn_tty_modem_init()
1814 info->x_char = 0; in isdn_tty_modem_init()
1815 info->isdn_driver = -1; in isdn_tty_modem_init()
1816 info->isdn_channel = -1; in isdn_tty_modem_init()
1817 info->drv_index = -1; in isdn_tty_modem_init()
1818 info->xmit_size = ISDN_SERIAL_XMIT_SIZE; in isdn_tty_modem_init()
1819 timer_setup(&info->nc_timer, isdn_tty_modem_do_ncarrier, 0); in isdn_tty_modem_init()
1820 skb_queue_head_init(&info->xmit_queue); in isdn_tty_modem_init()
1822 skb_queue_head_init(&info->dtmf_queue); in isdn_tty_modem_init()
1824 info->port.xmit_buf = kmalloc(ISDN_SERIAL_XMIT_MAX + 5, in isdn_tty_modem_init()
1826 if (!info->port.xmit_buf) { in isdn_tty_modem_init()
1832 info->port.xmit_buf += 4; in isdn_tty_modem_init()
1837 info = &m->info[i]; in isdn_tty_modem_init()
1839 kfree(info->fax); in isdn_tty_modem_init()
1841 kfree(info->port.xmit_buf - 4); in isdn_tty_modem_init()
1842 info->port.xmit_buf = NULL; in isdn_tty_modem_init()
1843 tty_port_destroy(&info->port); in isdn_tty_modem_init()
1855 modem_info *info; in isdn_tty_exit() local
1859 info = &dev->mdm.info[i]; in isdn_tty_exit()
1860 isdn_tty_cleanup_xmit(info); in isdn_tty_exit()
1862 kfree(info->fax); in isdn_tty_exit()
1864 kfree(info->port.xmit_buf - 4); in isdn_tty_exit()
1865 info->port.xmit_buf = NULL; in isdn_tty_exit()
1866 tty_port_destroy(&info->port); in isdn_tty_exit()
1966 modem_info *info = &dev->mdm.info[i]; in isdn_tty_find_icall() local
1968 if (info->port.count == 0) in isdn_tty_find_icall()
1970 if ((info->emu.mdmreg[REG_SI1] & si2bit[si1]) && /* SI1 is matching */ in isdn_tty_find_icall()
1971 (info->emu.mdmreg[REG_SI2] == si2)) { /* SI2 is matching */ in isdn_tty_find_icall()
1976 info->port.flags, info->isdn_driver, in isdn_tty_find_icall()
1977 info->isdn_channel, dev->usage[idx]); in isdn_tty_find_icall()
1981 tty_port_active(&info->port) && in isdn_tty_find_icall()
1983 (info->isdn_driver == -1) && in isdn_tty_find_icall()
1984 (info->isdn_channel == -1) && in isdn_tty_find_icall()
1988 if ((matchret = isdn_tty_match_icall(eaz, &info->emu, di)) > wret) in isdn_tty_find_icall()
1991 info->isdn_driver = di; in isdn_tty_find_icall()
1992 info->isdn_channel = ch; in isdn_tty_find_icall()
1993 info->drv_index = idx; in isdn_tty_find_icall()
1994 dev->m_idx[idx] = info->line; in isdn_tty_find_icall()
1996 dev->usage[idx] |= isdn_calc_usage(si1, info->emu.mdmreg[REG_L2PROT]); in isdn_tty_find_icall()
1998 strcpy(info->emu.cpn, eaz); in isdn_tty_find_icall()
1999 info->emu.mdmreg[REG_SI1I] = si2bit[si1]; in isdn_tty_find_icall()
2000 info->emu.mdmreg[REG_PLAN] = setup->plan; in isdn_tty_find_icall()
2001 info->emu.mdmreg[REG_SCREEN] = setup->screen; in isdn_tty_find_icall()
2005 info->line); in isdn_tty_find_icall()
2006 info->msr |= UART_MSR_RI; in isdn_tty_find_icall()
2007 isdn_tty_modem_result(RESULT_RING, info); in isdn_tty_find_icall()
2024 modem_info *info; in isdn_tty_stat_callback() local
2030 info = &dev->mdm.info[mi]; in isdn_tty_stat_callback()
2033 printk(KERN_DEBUG "CHARGEINFO on ttyI%d: %ld %s\n", info->line, c->arg, c->parm.num); in isdn_tty_stat_callback()
2034 info->emu.charge = (unsigned) simple_strtoul(c->parm.num, &e, 10); in isdn_tty_stat_callback()
2036 info->emu.charge = 0; in isdn_tty_stat_callback()
2041 printk(KERN_DEBUG "tty_STAT_BSENT ttyI%d\n", info->line); in isdn_tty_stat_callback()
2043 if ((info->isdn_driver == c->driver) && in isdn_tty_stat_callback()
2044 (info->isdn_channel == c->arg)) { in isdn_tty_stat_callback()
2045 info->msr |= UART_MSR_CTS; in isdn_tty_stat_callback()
2046 if (info->send_outstanding) in isdn_tty_stat_callback()
2047 if (!(--info->send_outstanding)) in isdn_tty_stat_callback()
2048 info->lsr |= UART_LSR_TEMT; in isdn_tty_stat_callback()
2049 isdn_tty_tint(info); in isdn_tty_stat_callback()
2055 printk(KERN_DEBUG "tty_STAT_CAUSE ttyI%d\n", info->line); in isdn_tty_stat_callback()
2058 strncpy(info->last_cause, c->parm.num, 5); in isdn_tty_stat_callback()
2062 printk(KERN_DEBUG "tty_STAT_DISPLAY ttyI%d\n", info->line); in isdn_tty_stat_callback()
2065 if ((info->emu.mdmreg[REG_DISPLAY] & BIT_DISPLAY) && in isdn_tty_stat_callback()
2066 !(info->emu.mdmreg[REG_RESPNUM] & BIT_RESPNUM)) { in isdn_tty_stat_callback()
2067 isdn_tty_at_cout("\r\n", info); in isdn_tty_stat_callback()
2068 isdn_tty_at_cout("DISPLAY: ", info); in isdn_tty_stat_callback()
2069 isdn_tty_at_cout(c->parm.display, info); in isdn_tty_stat_callback()
2070 isdn_tty_at_cout("\r\n", info); in isdn_tty_stat_callback()
2075 printk(KERN_DEBUG "tty_STAT_DCONN ttyI%d\n", info->line); in isdn_tty_stat_callback()
2077 if (tty_port_active(&info->port)) { in isdn_tty_stat_callback()
2078 if (info->dialing == 1) { in isdn_tty_stat_callback()
2079 info->dialing = 2; in isdn_tty_stat_callback()
2086 printk(KERN_DEBUG "tty_STAT_DHUP ttyI%d\n", info->line); in isdn_tty_stat_callback()
2088 if (tty_port_active(&info->port)) { in isdn_tty_stat_callback()
2089 if (info->dialing == 1) in isdn_tty_stat_callback()
2090 isdn_tty_modem_result(RESULT_BUSY, info); in isdn_tty_stat_callback()
2091 if (info->dialing > 1) in isdn_tty_stat_callback()
2092 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_stat_callback()
2093 info->dialing = 0; in isdn_tty_stat_callback()
2097 isdn_tty_modem_hup(info, 0); in isdn_tty_stat_callback()
2103 printk(KERN_DEBUG "tty_STAT_BCONN ttyI%d\n", info->line); in isdn_tty_stat_callback()
2109 if (info->port.blocked_open && in isdn_tty_stat_callback()
2110 (info->emu.mdmreg[REG_DCD] & BIT_DCD)) { in isdn_tty_stat_callback()
2111 wake_up_interruptible(&info->port.open_wait); in isdn_tty_stat_callback()
2118 if (tty_port_active(&info->port) || in isdn_tty_stat_callback()
2119 (info->port.blocked_open && in isdn_tty_stat_callback()
2120 (info->emu.mdmreg[REG_DCD] & BIT_DCD))) { in isdn_tty_stat_callback()
2121 info->msr |= UART_MSR_DCD; in isdn_tty_stat_callback()
2122 info->emu.charge = 0; in isdn_tty_stat_callback()
2123 if (info->dialing & 0xf) in isdn_tty_stat_callback()
2124 info->last_dir = 1; in isdn_tty_stat_callback()
2126 info->last_dir = 0; in isdn_tty_stat_callback()
2127 info->dialing = 0; in isdn_tty_stat_callback()
2128 info->rcvsched = 1; in isdn_tty_stat_callback()
2130 if (info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_MODEM) { in isdn_tty_stat_callback()
2131 strcpy(info->emu.connmsg, c->parm.num); in isdn_tty_stat_callback()
2132 isdn_tty_modem_result(RESULT_CONNECT, info); in isdn_tty_stat_callback()
2134 isdn_tty_modem_result(RESULT_CONNECT64000, info); in isdn_tty_stat_callback()
2137 isdn_tty_modem_result(RESULT_VCON, info); in isdn_tty_stat_callback()
2143 printk(KERN_DEBUG "tty_STAT_BHUP ttyI%d\n", info->line); in isdn_tty_stat_callback()
2145 if (tty_port_active(&info->port)) { in isdn_tty_stat_callback()
2149 isdn_tty_modem_hup(info, 0); in isdn_tty_stat_callback()
2155 printk(KERN_DEBUG "tty_STAT_NODCH ttyI%d\n", info->line); in isdn_tty_stat_callback()
2157 if (tty_port_active(&info->port)) { in isdn_tty_stat_callback()
2158 if (info->dialing) { in isdn_tty_stat_callback()
2159 info->dialing = 0; in isdn_tty_stat_callback()
2160 info->last_l2 = -1; in isdn_tty_stat_callback()
2161 info->last_si = 0; in isdn_tty_stat_callback()
2162 sprintf(info->last_cause, "0000"); in isdn_tty_stat_callback()
2163 isdn_tty_modem_result(RESULT_NO_DIALTONE, info); in isdn_tty_stat_callback()
2165 isdn_tty_modem_hup(info, 0); in isdn_tty_stat_callback()
2171 printk(KERN_DEBUG "tty_STAT_UNLOAD ttyI%d\n", info->line); in isdn_tty_stat_callback()
2174 info = &dev->mdm.info[i]; in isdn_tty_stat_callback()
2175 if (info->isdn_driver == c->driver) { in isdn_tty_stat_callback()
2176 if (info->online) in isdn_tty_stat_callback()
2177 isdn_tty_modem_hup(info, 1); in isdn_tty_stat_callback()
2183 if (tty_port_active(&info->port)) { in isdn_tty_stat_callback()
2184 isdn_tty_fax_command(info, c); in isdn_tty_stat_callback()
2190 if (tty_port_active(&info->port)) { in isdn_tty_stat_callback()
2193 if (info->vonline) { in isdn_tty_stat_callback()
2194 isdn_audio_put_dle_code(info, in isdn_tty_stat_callback()
2218 isdn_tty_at_cout(char *msg, modem_info *info) in isdn_tty_at_cout() argument
2220 struct tty_port *port = &info->port; in isdn_tty_at_cout()
2221 atemu *m = &info->emu; in isdn_tty_at_cout()
2236 spin_lock_irqsave(&info->readlock, flags); in isdn_tty_at_cout()
2237 if (info->closing) { in isdn_tty_at_cout()
2238 spin_unlock_irqrestore(&info->readlock, flags); in isdn_tty_at_cout()
2244 if (info->online && ((tty_buffer_request_room(port, l) < l) || in isdn_tty_at_cout()
2245 !skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) { in isdn_tty_at_cout()
2248 spin_unlock_irqrestore(&info->readlock, flags); in isdn_tty_at_cout()
2280 __skb_queue_tail(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel], skb); in isdn_tty_at_cout()
2281 dev->drv[info->isdn_driver]->rcvcount[info->isdn_channel] += skb->len; in isdn_tty_at_cout()
2282 spin_unlock_irqrestore(&info->readlock, flags); in isdn_tty_at_cout()
2284 if (dev->modempoll && info->rcvsched) in isdn_tty_at_cout()
2288 spin_unlock_irqrestore(&info->readlock, flags); in isdn_tty_at_cout()
2297 isdn_tty_on_hook(modem_info *info) in isdn_tty_on_hook() argument
2299 if (info->isdn_channel >= 0) { in isdn_tty_on_hook()
2303 isdn_tty_modem_hup(info, 1); in isdn_tty_on_hook()
2368 isdn_tty_modem_result(int code, modem_info *info) in isdn_tty_modem_result() argument
2370 atemu *m = &info->emu; in isdn_tty_modem_result()
2382 isdn_tty_cmd_ATA(info); in isdn_tty_modem_result()
2387 info->closing, !info->port.tty); in isdn_tty_modem_result()
2390 del_timer(&info->nc_timer); in isdn_tty_modem_result()
2391 info->ncarrier = 0; in isdn_tty_modem_result()
2392 if (info->closing || !info->port.tty) in isdn_tty_modem_result()
2396 if (info->vonline & 1) { in isdn_tty_modem_result()
2399 info->line); in isdn_tty_modem_result()
2402 isdn_tty_at_cout("\020\003", info); in isdn_tty_modem_result()
2404 if (info->vonline & 2) { in isdn_tty_modem_result()
2407 info->line); in isdn_tty_modem_result()
2410 isdn_tty_at_cout("\020\024", info); in isdn_tty_modem_result()
2416 sprintf(info->last_cause, "0000"); in isdn_tty_modem_result()
2417 if (!info->online) in isdn_tty_modem_result()
2418 info->online = 2; in isdn_tty_modem_result()
2423 info->line); in isdn_tty_modem_result()
2425 sprintf(info->last_cause, "0000"); in isdn_tty_modem_result()
2426 if (!info->online) in isdn_tty_modem_result()
2427 info->online = 1; in isdn_tty_modem_result()
2436 isdn_tty_at_cout(s, info); in isdn_tty_modem_result()
2445 isdn_tty_at_cout("\r\nCALLER NUMBER: ", info); in isdn_tty_modem_result()
2446 isdn_tty_at_cout(dev->num[info->drv_index], info); in isdn_tty_modem_result()
2448 isdn_tty_at_cout("\r\nCALLED NUMBER: ", info); in isdn_tty_modem_result()
2449 isdn_tty_at_cout(info->emu.cpn, info); in isdn_tty_modem_result()
2453 isdn_tty_at_cout("\r\n", info); in isdn_tty_modem_result()
2454 isdn_tty_at_cout(msg[code], info); in isdn_tty_modem_result()
2459 isdn_tty_at_cout(" ", info); in isdn_tty_modem_result()
2460 isdn_tty_at_cout(m->connmsg, info); in isdn_tty_modem_result()
2468 isdn_tty_at_cout(s, info); in isdn_tty_modem_result()
2473 isdn_tty_at_cout("\r\n", info); in isdn_tty_modem_result()
2474 isdn_tty_at_cout("CALLER NUMBER: ", info); in isdn_tty_modem_result()
2475 isdn_tty_at_cout(dev->num[info->drv_index], info); in isdn_tty_modem_result()
2477 isdn_tty_at_cout("\r\nCALLED NUMBER: ", info); in isdn_tty_modem_result()
2478 isdn_tty_at_cout(info->emu.cpn, info); in isdn_tty_modem_result()
2489 sprintf(s, "/%s", info->last_cause); in isdn_tty_modem_result()
2490 isdn_tty_at_cout(s, info); in isdn_tty_modem_result()
2499 isdn_tty_at_cout("/X.75", info); in isdn_tty_modem_result()
2502 isdn_tty_at_cout("/HDLC", info); in isdn_tty_modem_result()
2505 isdn_tty_at_cout("/V110/9600", info); in isdn_tty_modem_result()
2508 isdn_tty_at_cout("/V110/19200", info); in isdn_tty_modem_result()
2511 isdn_tty_at_cout("/V110/38400", info); in isdn_tty_modem_result()
2515 isdn_tty_at_cout("/T.70", info); in isdn_tty_modem_result()
2517 isdn_tty_at_cout("+", info); in isdn_tty_modem_result()
2521 isdn_tty_at_cout("\r\n", info); in isdn_tty_modem_result()
2525 if (info->closing || (!info->port.tty)) in isdn_tty_modem_result()
2528 if (tty_port_check_carrier(&info->port)) in isdn_tty_modem_result()
2529 tty_hangup(info->port.tty); in isdn_tty_modem_result()
2538 isdn_tty_show_profile(int ridx, modem_info *info) in isdn_tty_show_profile() argument
2542 sprintf(v, "\r\n%d", info->emu.mdmreg[ridx]); in isdn_tty_show_profile()
2543 isdn_tty_at_cout(v, info); in isdn_tty_show_profile()
2587 #define PARSE_ERROR { isdn_tty_modem_result(RESULT_ERROR, info); return; }
2588 #define PARSE_ERROR1 { isdn_tty_modem_result(RESULT_ERROR, info); return 1; }
2591 isdn_tty_report(modem_info *info) in isdn_tty_report() argument
2593 atemu *m = &info->emu; in isdn_tty_report()
2596 isdn_tty_at_cout("\r\nStatistics of last connection:\r\n\r\n", info); in isdn_tty_report()
2597 sprintf(s, " Remote Number: %s\r\n", info->last_num); in isdn_tty_report()
2598 isdn_tty_at_cout(s, info); in isdn_tty_report()
2599 sprintf(s, " Direction: %s\r\n", info->last_dir ? "outgoing" : "incoming"); in isdn_tty_report()
2600 isdn_tty_at_cout(s, info); in isdn_tty_report()
2601 isdn_tty_at_cout(" Layer-2 Protocol: ", info); in isdn_tty_report()
2602 switch (info->last_l2) { in isdn_tty_report()
2604 isdn_tty_at_cout("X.75i", info); in isdn_tty_report()
2607 isdn_tty_at_cout("X.75ui", info); in isdn_tty_report()
2610 isdn_tty_at_cout("X.75bui", info); in isdn_tty_report()
2613 isdn_tty_at_cout("HDLC", info); in isdn_tty_report()
2616 isdn_tty_at_cout("V.110 9600 Baud", info); in isdn_tty_report()
2619 isdn_tty_at_cout("V.110 19200 Baud", info); in isdn_tty_report()
2622 isdn_tty_at_cout("V.110 38400 Baud", info); in isdn_tty_report()
2625 isdn_tty_at_cout("transparent", info); in isdn_tty_report()
2628 isdn_tty_at_cout("modem", info); in isdn_tty_report()
2631 isdn_tty_at_cout("fax", info); in isdn_tty_report()
2634 isdn_tty_at_cout("unknown", info); in isdn_tty_report()
2638 isdn_tty_at_cout("/T.70", info); in isdn_tty_report()
2640 isdn_tty_at_cout("+", info); in isdn_tty_report()
2642 isdn_tty_at_cout("\r\n", info); in isdn_tty_report()
2643 isdn_tty_at_cout(" Service: ", info); in isdn_tty_report()
2644 switch (info->last_si) { in isdn_tty_report()
2646 isdn_tty_at_cout("audio\r\n", info); in isdn_tty_report()
2649 isdn_tty_at_cout("btx\r\n", info); in isdn_tty_report()
2652 isdn_tty_at_cout("data\r\n", info); in isdn_tty_report()
2655 sprintf(s, "%d\r\n", info->last_si); in isdn_tty_report()
2656 isdn_tty_at_cout(s, info); in isdn_tty_report()
2659 sprintf(s, " Hangup location: %s\r\n", info->last_lhup ? "local" : "remote"); in isdn_tty_report()
2660 isdn_tty_at_cout(s, info); in isdn_tty_report()
2661 sprintf(s, " Last cause: %s\r\n", info->last_cause); in isdn_tty_report()
2662 isdn_tty_at_cout(s, info); in isdn_tty_report()
2669 isdn_tty_cmd_ATand(char **p, modem_info *info) in isdn_tty_cmd_ATand() argument
2671 atemu *m = &info->emu; in isdn_tty_cmd_ATand()
2689 info->xmit_size = m->mdmreg[REG_PSIZE] * 16; in isdn_tty_cmd_ATand()
2694 info->xmit_size /= 10; in isdn_tty_cmd_ATand()
2739 if (info->msr & UART_MSR_DCD) in isdn_tty_cmd_ATand()
2742 isdn_tty_modem_reset_regs(info, 1); in isdn_tty_cmd_ATand()
2770 info->xmit_size = m->mdmreg[REG_PSIZE] * 16; in isdn_tty_cmd_ATand()
2775 info->xmit_size = m->mdmreg[REG_PSIZE] * 16 / 10; in isdn_tty_cmd_ATand()
2780 info->xmit_size = m->mdmreg[REG_PSIZE] * 16 / 10; in isdn_tty_cmd_ATand()
2785 info->xmit_size = m->mdmreg[REG_PSIZE] * 16 / 10; in isdn_tty_cmd_ATand()
2807 isdn_tty_at_cout("\r\n", info); in isdn_tty_cmd_ATand()
2811 isdn_tty_at_cout(rb, info); in isdn_tty_cmd_ATand()
2815 isdn_tty_at_cout(rb, info); in isdn_tty_cmd_ATand()
2817 isdn_tty_at_cout("\r\nListen: ", info); in isdn_tty_cmd_ATand()
2818 isdn_tty_at_cout(m->lmsn, info); in isdn_tty_cmd_ATand()
2819 isdn_tty_at_cout("\r\n", info); in isdn_tty_cmd_ATand()
2840 info->xmit_size = m->mdmreg[REG_PSIZE] * 16; in isdn_tty_cmd_ATand()
2846 info->xmit_size = 112; in isdn_tty_cmd_ATand()
2853 info->xmit_size = 112; in isdn_tty_cmd_ATand()
2868 isdn_tty_check_ats(int mreg, int mval, modem_info *info, atemu *m) in isdn_tty_check_ats() argument
2883 info->xmit_size = mval * 16; in isdn_tty_check_ats()
2888 info->xmit_size /= 10; in isdn_tty_check_ats()
2904 isdn_tty_cmd_ATS(char **p, modem_info *info) in isdn_tty_cmd_ATS() argument
2906 atemu *m = &info->emu; in isdn_tty_cmd_ATS()
2921 if (isdn_tty_check_ats(mreg, mval, info, m)) in isdn_tty_cmd_ATS()
2941 if (isdn_tty_check_ats(mreg, mval, info, m)) in isdn_tty_cmd_ATS()
2947 isdn_tty_at_cout("\r\n", info); in isdn_tty_cmd_ATS()
2949 info); in isdn_tty_cmd_ATS()
2957 isdn_tty_show_profile(mreg, info); in isdn_tty_cmd_ATS()
2970 isdn_tty_cmd_ATA(modem_info *info) in isdn_tty_cmd_ATA() argument
2972 atemu *m = &info->emu; in isdn_tty_cmd_ATA()
2976 if (info->msr & UART_MSR_RI) { in isdn_tty_cmd_ATA()
2978 info->last_dir = 0; in isdn_tty_cmd_ATA()
2979 strcpy(info->last_num, dev->num[info->drv_index]); in isdn_tty_cmd_ATA()
2981 info->msr &= ~UART_MSR_RI; in isdn_tty_cmd_ATA()
2993 cmd.driver = info->isdn_driver; in isdn_tty_cmd_ATA()
2995 cmd.arg = info->isdn_channel + (l2 << 8); in isdn_tty_cmd_ATA()
2996 info->last_l2 = l2; in isdn_tty_cmd_ATA()
2998 cmd.driver = info->isdn_driver; in isdn_tty_cmd_ATA()
3000 cmd.arg = info->isdn_channel + (m->mdmreg[REG_L3PROT] << 8); in isdn_tty_cmd_ATA()
3003 cmd.parm.fax = info->fax; in isdn_tty_cmd_ATA()
3004 info->fax->direction = ISDN_TTY_FAX_CONN_IN; in isdn_tty_cmd_ATA()
3008 cmd.driver = info->isdn_driver; in isdn_tty_cmd_ATA()
3009 cmd.arg = info->isdn_channel; in isdn_tty_cmd_ATA()
3011 info->dialing = 16; in isdn_tty_cmd_ATA()
3012 info->emu.carrierwait = 0; in isdn_tty_cmd_ATA()
3016 isdn_tty_modem_result(RESULT_NO_ANSWER, info); in isdn_tty_cmd_ATA()
3024 isdn_tty_cmd_PLUSF(char **p, modem_info *info) in isdn_tty_cmd_PLUSF() argument
3026 atemu *m = &info->emu; in isdn_tty_cmd_PLUSF()
3037 if (TTY_IS_FCLASS2(info)) in isdn_tty_cmd_PLUSF()
3039 else if (TTY_IS_FCLASS1(info)) in isdn_tty_cmd_PLUSF()
3042 isdn_tty_at_cout(rs, info); in isdn_tty_cmd_PLUSF()
3052 info->xmit_size = in isdn_tty_cmd_PLUSF()
3064 info->xmit_size = in isdn_tty_cmd_PLUSF()
3075 info->xmit_size = in isdn_tty_cmd_PLUSF()
3085 info->xmit_size = VBUF; in isdn_tty_cmd_PLUSF()
3099 isdn_tty_at_cout(rs, info); in isdn_tty_cmd_PLUSF()
3111 return (isdn_tty_cmd_PLUSF_FAX(p, info)); in isdn_tty_cmd_PLUSF()
3121 isdn_tty_cmd_PLUSV(char **p, modem_info *info) in isdn_tty_cmd_PLUSV() argument
3123 atemu *m = &info->emu; in isdn_tty_cmd_PLUSV()
3146 isdn_tty_at_cout("\r\n1", info); in isdn_tty_cmd_PLUSV()
3156 isdn_tty_at_cout("\r\n1", info); in isdn_tty_cmd_PLUSV()
3176 isdn_tty_at_cout(rs, info); in isdn_tty_cmd_PLUSV()
3191 isdn_tty_at_cout("\r\n0,2", info); in isdn_tty_cmd_PLUSV()
3205 if (info->online != 1) { in isdn_tty_cmd_PLUSV()
3206 isdn_tty_modem_result(RESULT_NO_ANSWER, info); in isdn_tty_cmd_PLUSV()
3209 info->dtmf_state = isdn_audio_dtmf_init(info->dtmf_state); in isdn_tty_cmd_PLUSV()
3210 if (!info->dtmf_state) { in isdn_tty_cmd_PLUSV()
3214 info->silence_state = isdn_audio_silence_init(info->silence_state); in isdn_tty_cmd_PLUSV()
3215 if (!info->silence_state) { in isdn_tty_cmd_PLUSV()
3220 info->adpcmr = isdn_audio_adpcm_init(info->adpcmr, m->vpar[3]); in isdn_tty_cmd_PLUSV()
3221 if (!info->adpcmr) { in isdn_tty_cmd_PLUSV()
3229 info->vonline |= 1; in isdn_tty_cmd_PLUSV()
3230 isdn_tty_modem_result(RESULT_CONNECT, info); in isdn_tty_cmd_PLUSV()
3241 isdn_tty_at_cout(rs, info); in isdn_tty_cmd_PLUSV()
3262 info); in isdn_tty_cmd_PLUSV()
3279 isdn_tty_at_cout(rs, info); in isdn_tty_cmd_PLUSV()
3297 info); in isdn_tty_cmd_PLUSV()
3299 info); in isdn_tty_cmd_PLUSV()
3301 info); in isdn_tty_cmd_PLUSV()
3303 info); in isdn_tty_cmd_PLUSV()
3305 info); in isdn_tty_cmd_PLUSV()
3319 if (info->online != 1) { in isdn_tty_cmd_PLUSV()
3320 isdn_tty_modem_result(RESULT_NO_ANSWER, info); in isdn_tty_cmd_PLUSV()
3323 info->dtmf_state = isdn_audio_dtmf_init(info->dtmf_state); in isdn_tty_cmd_PLUSV()
3324 if (!info->dtmf_state) { in isdn_tty_cmd_PLUSV()
3329 info->adpcms = isdn_audio_adpcm_init(info->adpcms, m->vpar[3]); in isdn_tty_cmd_PLUSV()
3330 if (!info->adpcms) { in isdn_tty_cmd_PLUSV()
3339 info->vonline |= 2; in isdn_tty_cmd_PLUSV()
3340 isdn_tty_modem_result(RESULT_CONNECT, info); in isdn_tty_cmd_PLUSV()
3351 isdn_tty_at_cout(rs, info); in isdn_tty_cmd_PLUSV()
3356 if (info->online != 1) in isdn_tty_cmd_PLUSV()
3369 cmd.driver = info->isdn_driver; in isdn_tty_cmd_PLUSV()
3371 cmd.arg = info->isdn_channel + (ISDN_AUDIO_SETDD << 8); in isdn_tty_cmd_PLUSV()
3380 info); in isdn_tty_cmd_PLUSV()
3400 isdn_tty_parse_at(modem_info *info) in isdn_tty_parse_at() argument
3402 atemu *m = &info->emu; in isdn_tty_parse_at()
3417 isdn_tty_cmd_ATA(info); in isdn_tty_parse_at()
3421 if (info->msr & UART_MSR_DCD) in isdn_tty_parse_at()
3423 if (info->msr & UART_MSR_RI) { in isdn_tty_parse_at()
3424 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_parse_at()
3430 isdn_tty_modem_result(RESULT_NO_MSN_EAZ, info); in isdn_tty_parse_at()
3432 isdn_tty_dial(ds, info, m); in isdn_tty_parse_at()
3456 isdn_tty_on_hook(info); in isdn_tty_parse_at()
3463 isdn_tty_on_hook(info); in isdn_tty_parse_at()
3470 isdn_tty_at_cout("\r\nLinux ISDN", info); in isdn_tty_parse_at()
3478 isdn_tty_report(info); in isdn_tty_parse_at()
3482 snprintf(ds, sizeof(ds), "\r\n%d", info->emu.charge); in isdn_tty_parse_at()
3483 isdn_tty_at_cout(ds, info); in isdn_tty_parse_at()
3500 if (info->msr & UART_MSR_DCD) in isdn_tty_parse_at()
3502 …esult((m->mdmreg[REG_L2PROT] == ISDN_PROTO_L2_MODEM) ? RESULT_CONNECT : RESULT_CONNECT64000, info); in isdn_tty_parse_at()
3504 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_parse_at()
3523 if (isdn_tty_cmd_ATS(&p, info)) in isdn_tty_parse_at()
3543 if (info->msr & UART_MSR_DCD) { in isdn_tty_parse_at()
3544 info->online = 0; in isdn_tty_parse_at()
3545 isdn_tty_on_hook(info); in isdn_tty_parse_at()
3547 isdn_tty_modem_reset_regs(info, 1); in isdn_tty_parse_at()
3555 if (isdn_tty_cmd_PLUSF(&p, info)) in isdn_tty_parse_at()
3563 if (isdn_tty_cmd_PLUSV(&p, info)) in isdn_tty_parse_at()
3570 isdn_tty_suspend(ds, info, m); in isdn_tty_parse_at()
3575 isdn_tty_resume(ds, info, m); in isdn_tty_parse_at()
3579 isdn_tty_send_msg(info, m, p); in isdn_tty_parse_at()
3587 if (isdn_tty_cmd_ATand(&p, info)) in isdn_tty_parse_at()
3595 if (!info->vonline) in isdn_tty_parse_at()
3597 isdn_tty_modem_result(RESULT_OK, info); in isdn_tty_parse_at()
3614 isdn_tty_edit_at(const char *p, int count, modem_info *info) in isdn_tty_edit_at() argument
3616 atemu *m = &info->emu; in isdn_tty_edit_at()
3631 isdn_tty_at_cout(eb, info); in isdn_tty_edit_at()
3634 isdn_tty_parse_at(info); in isdn_tty_edit_at()
3644 isdn_tty_at_cout("\b", info); in isdn_tty_edit_at()
3652 isdn_tty_at_cout(eb, info); in isdn_tty_edit_at()
3696 modem_info *info = &dev->mdm.info[midx]; in isdn_tty_modem_escape() local
3697 if (info->online) { in isdn_tty_modem_escape()
3699 if ((info->emu.pluscount == 3) && in isdn_tty_modem_escape()
3701 info->emu.lastplus + PLUSWAIT2)) { in isdn_tty_modem_escape()
3702 info->emu.pluscount = 0; in isdn_tty_modem_escape()
3703 info->online = 0; in isdn_tty_modem_escape()
3704 isdn_tty_modem_result(RESULT_OK, info); in isdn_tty_modem_escape()
3723 modem_info *info = &dev->mdm.info[i]; in isdn_tty_modem_ring() local
3724 if (info->msr & UART_MSR_RI) { in isdn_tty_modem_ring()
3726 isdn_tty_modem_result(RESULT_RING, info); in isdn_tty_modem_ring()
3743 modem_info *info = &dev->mdm.info[i]; in isdn_tty_modem_xmit() local
3744 if (info->online) { in isdn_tty_modem_xmit()
3746 isdn_tty_senddown(info); in isdn_tty_modem_xmit()
3747 isdn_tty_tint(info); in isdn_tty_modem_xmit()
3764 modem_info *info = &dev->mdm.info[i]; in isdn_tty_carrier_timeout() local
3765 if (!info->dialing) in isdn_tty_carrier_timeout()
3767 if (info->emu.carrierwait++ > info->emu.mdmreg[REG_WAITC]) { in isdn_tty_carrier_timeout()
3768 info->dialing = 0; in isdn_tty_carrier_timeout()
3769 isdn_tty_modem_result(RESULT_NO_CARRIER, info); in isdn_tty_carrier_timeout()
3770 isdn_tty_modem_hup(info, 1); in isdn_tty_carrier_timeout()