11 #undef ISDN_TTY_STAT_DEBUG
13 #include <linux/isdn.h>
14 #include <linux/serial.h>
15 #include <linux/slab.h>
20 #ifdef CONFIG_ISDN_AUDIO
23 #define VBUFX (VBUF/16)
26 #define FIX_FILE_TRANSFER
27 #define DUMMY_HAYES_AT
32 static int isdn_tty_edit_at(
const char *,
int,
modem_info *);
34 static void isdn_tty_modem_reset_regs(
modem_info *,
int);
36 static void isdn_tty_flush_buffer(
struct tty_struct *);
37 static void isdn_tty_modem_result(
int,
modem_info *);
38 #ifdef CONFIG_ISDN_AUDIO
39 static int isdn_tty_countDLE(
unsigned char *,
int);
43 #define MODEM_PARANOIA_CHECK
44 #define MODEM_DO_RESTART
46 static int bit2si[8] =
47 {1, 5, 7, 7, 7, 7, 7, 7};
48 static int si2bit[8] =
49 {4, 1, 4, 4, 4, 4, 4, 4};
79 #ifdef CONFIG_ISDN_AUDIO
80 + ISDN_AUDIO_SKB_DLECOUNT(skb)
88 #ifdef CONFIG_ISDN_AUDIO
89 if (ISDN_AUDIO_SKB_DLECOUNT(skb)) {
91 unsigned char *
dp = skb->
data;
94 tty_insert_flip_char(tty,
DLE, 0);
95 tty_insert_flip_char(tty, *dp++, 0);
98 tty_insert_flip_char(tty,
DLE, 0);
103 tty_insert_flip_string(tty, skb->
data, len - 1);
104 last = skb->
data[len - 1];
105 #ifdef CONFIG_ISDN_AUDIO
109 tty_insert_flip_char(tty, last, 0xFF);
133 midx =
dev->m_idx[
i];
137 info = &
dev->mdm.info[midx];
142 #ifdef CONFIG_ISDN_AUDIO
144 if ((info->vonline & 1) && (info->
emu.vpar[1]))
147 tty = info->
port.tty;
176 #ifdef CONFIG_ISDN_AUDIO
181 if ((midx =
dev->m_idx[i]) < 0) {
185 info = &
dev->mdm.info[midx];
186 #ifdef CONFIG_ISDN_AUDIO
189 if ((info->vonline) && (!info->
emu.vpar[4]))
191 if ((info->vonline & 1) && (info->
emu.vpar[1]))
195 #ifdef CONFIG_ISDN_AUDIO
196 && (!(info->vonline & 1))
206 if (skb->
data[0] == 3)
209 if (skb->
data[0] == 1)
213 if ((skb->
data[0] == 1) && ((skb->
data[1] == 0) || (skb->
data[1] == 1)))
216 #ifdef CONFIG_ISDN_AUDIO
217 ISDN_AUDIO_SKB_DLECOUNT(skb) = 0;
218 ISDN_AUDIO_SKB_LOCK(skb) = 0;
219 if (info->vonline & 1) {
221 switch (info->
emu.vpar[3]) {
246 ISDN_AUDIO_SKB_DLECOUNT(skb) =
247 isdn_tty_countDLE(skb->
data, skb->
len);
249 #ifdef CONFIG_ISDN_TTY_FAX
251 if (info->faxonline & 2) {
253 ISDN_AUDIO_SKB_DLECOUNT(skb) =
254 isdn_tty_countDLE(skb->
data, skb->
len);
261 if (skb_queue_empty(&
dev->drv[di]->rpqueue[channel]))
262 if (isdn_tty_try_read(info, skb)) {
263 spin_unlock_irqrestore(&info->
readlock, flags);
269 __skb_queue_tail(&
dev->drv[di]->rpqueue[channel], skb);
272 #ifdef CONFIG_ISDN_AUDIO
273 + ISDN_AUDIO_SKB_DLECOUNT(skb)
276 spin_unlock_irqrestore(&info->
readlock, flags);
287 #ifdef CONFIG_ISDN_AUDIO
318 #ifdef CONFIG_ISDN_AUDIO
320 isdn_tty_countDLE(
unsigned char *
buf,
int len)
357 #ifdef ISDN_DEBUG_MODEM_VOICE
359 "DLEdown: got DLE-DC4, send DLE-ETX on ttyI%d\n",
363 if (!info->vonline) {
364 #ifdef ISDN_DEBUG_MODEM_VOICE
366 "DLEdown: send VCON on ttyI%d\n",
401 isdn_tty_end_vrx(
const char *buf,
int c)
407 if ((ch != 0x11) && (ch != 0x13))
414 static int voice_cf[7] =
415 {0, 0, 4, 3, 2, 0, 0};
429 #ifdef CONFIG_ISDN_AUDIO
434 #ifdef CONFIG_ISDN_AUDIO
435 if (info->vonline & 4) {
437 if (!info->vonline) {
438 #ifdef ISDN_DEBUG_MODEM_VOICE
440 "senddown: send VCON on ttyI%d\n",
464 #ifdef CONFIG_ISDN_AUDIO
465 if (info->vonline & 2)
466 audio_len = buflen * voice_cf[info->
emu.vpar[3]];
469 skb = dev_alloc_skb(skb_res + buflen + audio_len);
471 skb = dev_alloc_skb(skb_res + buflen);
475 "isdn_tty: Out of memory in ttyI%d senddown\n",
479 skb_reserve(skb, skb_res);
482 #ifdef CONFIG_ISDN_AUDIO
483 if (info->vonline & 2) {
493 switch (info->
emu.vpar[3]) {
547 isdn_tty_modem_do_ncarrier(
unsigned long data)
571 isdn_calc_usage(
int si,
int l2)
575 #ifdef CONFIG_ISDN_AUDIO
581 #ifdef CONFIG_ISDN_TTY_FAX
610 for (j = 7; j >= 0; j--)
615 usg = isdn_calc_usage(si, l2);
616 #ifdef CONFIG_ISDN_AUDIO
619 #ifdef CONFIG_ISDN_TTY_FAX
631 spin_unlock_irqrestore(&
dev->lock, flags);
642 spin_unlock_irqrestore(&
dev->lock, flags);
659 #ifdef CONFIG_ISDN_TTY_FAX
661 cmd.
parm.fax = info->fax;
662 info->fax->direction = ISDN_TTY_FAX_CONN_OUT;
698 if (di < 0 || ch < 0)
704 #ifdef ISDN_DEBUG_MODEM_HUP
708 isdn_tty_flush_buffer(info->
port.tty);
714 #ifdef CONFIG_ISDN_AUDIO
716 #ifdef CONFIG_ISDN_TTY_FAX
718 info->fax->phase = ISDN_FAX_PHASE_IDLE;
720 info->
emu.vpar[4] = 0;
721 info->
emu.vpar[5] = 8;
722 kfree(info->dtmf_state);
723 info->dtmf_state =
NULL;
724 kfree(info->silence_state);
725 info->silence_state =
NULL;
759 #include <linux/module.h>
778 #ifdef ISDN_DEBUG_MODEM_SERVICES
821 for (j = 7; j >= 0; j--)
826 usg = isdn_calc_usage(si, l2);
827 #ifdef CONFIG_ISDN_AUDIO
830 #ifdef CONFIG_ISDN_TTY_FAX
842 spin_unlock_irqrestore(&
dev->lock, flags);
853 spin_unlock_irqrestore(&
dev->lock, flags);
914 for (j = 7; j >= 0; j--)
919 usg = isdn_calc_usage(si, l2);
920 #ifdef CONFIG_ISDN_AUDIO
923 #ifdef CONFIG_ISDN_TTY_FAX
935 spin_unlock_irqrestore(&
dev->lock, flags);
945 spin_unlock_irqrestore(&
dev->lock, flags);
984 #ifdef MODEM_PARANOIA_CHECK
1014 cflag = port->
tty->termios.c_cflag;
1016 quot = i = cflag &
CBAUD;
1020 port->
tty->termios.c_cflag &= ~CBAUDEX;
1026 isdn_tty_modem_ncarrier(info);
1030 #ifdef ISDN_DEBUG_MODEM_HUP
1035 isdn_tty_modem_reset_regs(info, 0);
1066 #ifdef ISDN_DEBUG_MODEM_OPEN
1078 isdn_tty_change_speed(info);
1095 #ifdef ISDN_DEBUG_MODEM_OPEN
1100 if (!info->
port.tty || (info->
port.tty->termios.c_cflag &
HUPCL)) {
1103 isdn_tty_modem_reset_regs(info, 0);
1104 #ifdef ISDN_DEBUG_MODEM_HUP
1133 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_write"))
1146 #ifdef CONFIG_ISDN_AUDIO
1147 || (info->vonline & 3)
1150 #ifdef CONFIG_ISDN_AUDIO
1157 #ifdef CONFIG_ISDN_AUDIO
1158 if (info->vonline) {
1159 int cc = isdn_tty_handleDLEdown(info, m, c);
1160 if (info->vonline & 2) {
1171 if ((info->vonline & 3) == 1) {
1175 if (isdn_tty_end_vrx(buf, c)) {
1176 info->vonline &= ~1;
1177 #ifdef ISDN_DEBUG_MODEM_VOICE
1179 "got !^Q/^S, send DLE-ETX,VCON on ttyI%d\n",
1187 int cc = isdn_tty_handleDLEdown(info, m, c);
1189 if (info->vonline & 4) {
1200 #ifdef ISDN_DEBUG_MODEM_VOICE
1212 #ifdef ISDN_DEBUG_MODEM_HUP
1218 c = isdn_tty_edit_at(buf, c, info);
1227 isdn_tty_senddown(info);
1228 isdn_tty_tint(info);
1241 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_write_room"))
1246 return (
ret < 0) ? 0 :
ret;
1250 isdn_tty_chars_in_buffer(
struct tty_struct *tty)
1254 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_chars_in_buffer"))
1262 isdn_tty_flush_buffer(
struct tty_struct *tty)
1270 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_flush_buffer")) {
1273 isdn_tty_cleanup_xmit(info);
1283 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_flush_chars"))
1302 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_throttle"))
1314 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_unthrottle"))
1359 if (isdn_tty_paranoia_check(info, tty->
name, __func__))
1365 #ifdef ISDN_DEBUG_MODEM_IOCTL
1369 control = info->
mcr;
1382 unsigned int set,
unsigned int clear)
1386 if (isdn_tty_paranoia_check(info, tty->
name, __func__))
1391 #ifdef ISDN_DEBUG_MODEM_IOCTL
1400 isdn_tty_modem_ncarrier(info);
1408 isdn_tty_modem_reset_regs(info, 0);
1409 #ifdef ISDN_DEBUG_MODEM_HUP
1427 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_ioctl"))
1433 #ifdef ISDN_DEBUG_MODEM_IOCTL
1442 #ifdef ISDN_DEBUG_MODEM_IOCTL
1451 #ifdef ISDN_DEBUG_MODEM_IOCTL
1454 return isdn_tty_get_lsr_info(info, (
uint __user *) arg);
1456 #ifdef ISDN_DEBUG_MODEM_IOCTL
1470 isdn_tty_change_speed(info);
1472 if (tty->termios.c_cflag == old_termios->
c_cflag &&
1473 tty->termios.c_ispeed == old_termios->
c_ispeed &&
1474 tty->termios.c_ospeed == old_termios->
c_ospeed)
1476 isdn_tty_change_speed(info);
1477 if ((old_termios->
c_cflag & CRTSCTS) &&
1478 !(tty->termios.c_cflag & CRTSCTS))
1493 if (isdn_tty_paranoia_check(info, tty->
name, __func__))
1514 #ifdef ISDN_DEBUG_MODEM_OPEN
1523 retval = isdn_tty_startup(info);
1525 #ifdef ISDN_DEBUG_MODEM_OPEN
1532 #ifdef ISDN_DEBUG_MODEM_OPEN
1533 printk(
KERN_DEBUG "isdn_tty_open return after isdn_tty_block_til_ready \n");
1537 #ifdef ISDN_DEBUG_MODEM_OPEN
1541 #ifdef ISDN_DEBUG_MODEM_OPEN
1554 if (!info || isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_close"))
1557 #ifdef ISDN_DEBUG_MODEM_OPEN
1562 if ((tty->
count == 1) && (port->
count != 1)) {
1570 printk(
KERN_ERR "isdn_tty_close: bad port count; tty->count is 1, "
1571 "info->count is %d\n", port->
count);
1574 if (--port->
count < 0) {
1575 printk(
KERN_ERR "isdn_tty_close: bad port count for ttyi%d: %d\n",
1580 #ifdef ISDN_DEBUG_MODEM_OPEN
1595 tty_wait_until_sent_from_close(tty, 3000);
1609 isdn_tty_shutdown(info);
1610 isdn_tty_flush_buffer(tty);
1616 #ifdef ISDN_DEBUG_MODEM_OPEN
1630 if (isdn_tty_paranoia_check(info, tty->
name,
"isdn_tty_hangup"))
1632 isdn_tty_shutdown(info);
1642 isdn_tty_reset_profile(
atemu *m)
1670 #ifdef CONFIG_ISDN_AUDIO
1672 isdn_tty_modem_reset_vpar(
atemu *m)
1683 #ifdef CONFIG_ISDN_TTY_FAX
1685 isdn_tty_modem_reset_faxpar(
modem_info *info)
1687 T30_s *
f = info->fax;
1690 f->phase = ISDN_FAX_PHASE_IDLE;
1700 memset(&f->id[0], 32, FAXIDLEN - 1);
1701 f->id[FAXIDLEN - 1] = 0;
1712 memset(&f->pollid[0], 32, FAXIDLEN - 1);
1713 f->pollid[FAXIDLEN - 1] = 0;
1727 #ifdef CONFIG_ISDN_AUDIO
1728 isdn_tty_modem_reset_vpar(m);
1730 #ifdef CONFIG_ISDN_TTY_FAX
1731 isdn_tty_modem_reset_faxpar(info);
1737 modem_write_profile(
atemu *m)
1747 .install = isdn_tty_install,
1748 .open = isdn_tty_open,
1749 .close = isdn_tty_close,
1750 .write = isdn_tty_write,
1751 .flush_chars = isdn_tty_flush_chars,
1752 .write_room = isdn_tty_write_room,
1753 .chars_in_buffer = isdn_tty_chars_in_buffer,
1754 .flush_buffer = isdn_tty_flush_buffer,
1755 .ioctl = isdn_tty_ioctl,
1756 .throttle = isdn_tty_throttle,
1757 .unthrottle = isdn_tty_unthrottle,
1758 .set_termios = isdn_tty_set_termios,
1759 .hangup = isdn_tty_hangup,
1760 .tiocmget = isdn_tty_tiocmget,
1761 .tiocmset = isdn_tty_tiocmset,
1764 static int isdn_tty_carrier_raised(
struct tty_port *port)
1771 .carrier_raised = isdn_tty_carrier_raised,
1802 #ifdef CONFIG_ISDN_TTY_FAX
1806 goto err_unregister;
1810 info->
port.ops = &isdn_tty_port_ops;
1818 isdn_tty_reset_profile(&info->
emu);
1819 isdn_tty_modem_reset_regs(info, 1);
1828 info->
nc_timer.function = isdn_tty_modem_do_ncarrier;
1831 #ifdef CONFIG_ISDN_AUDIO
1832 skb_queue_head_init(&info->dtmf_queue);
1836 if (!info->
port.xmit_buf) {
1839 goto err_unregister;
1842 info->
port.xmit_buf += 4;
1846 for (i--; i >= 0; i--) {
1848 #ifdef CONFIG_ISDN_TTY_FAX
1867 info = &
dev->mdm.info[
i];
1868 isdn_tty_cleanup_xmit(info);
1869 #ifdef CONFIG_ISDN_TTY_FAX
1887 isdn_tty_match_icall(
char *
cid,
atemu *
emu,
int di)
1889 #ifdef ISDN_DEBUG_MODEM_ICALL
1890 printk(
KERN_DEBUG "m_fi: msn=%s lmsn=%s mmsn=%s mreg[SI1]=%d mreg[SI2]=%d\n",
1895 char *p = emu->
lmsn;
1901 if ((q =
strchr(p,
';')))
1905 #ifdef ISDN_DEBUG_MODEM_ICALL
1923 #ifdef ISDN_DEBUG_MODEM_ICALL
1954 if (!setup->
phone[0]) {
1956 printk(
KERN_INFO "isdn_tty: Incoming call without OAD, assuming '0'\n");
1960 si2 = (
int) setup->
si2;
1966 #ifdef ISDN_DEBUG_MODEM_ICALL
1974 if (info->
port.count == 0)
1979 #ifdef ISDN_DEBUG_MODEM_ICALL
1994 if ((matchret = isdn_tty_match_icall(eaz, &info->
emu, di)) > wret)
2009 spin_unlock_irqrestore(&
dev->lock, flags);
2020 spin_unlock_irqrestore(&
dev->lock, flags);
2023 return (wret == 2) ? 3 : 0;
2026 #define TTY_IS_ACTIVE(info) (info->port.flags & ASYNC_NORMAL_ACTIVE)
2037 if ((mi =
dev->m_idx[i]) >= 0) {
2038 info = &
dev->mdm.info[mi];
2048 #ifdef ISDN_TTY_STAT_DEBUG
2057 isdn_tty_tint(info);
2062 #ifdef ISDN_TTY_STAT_DEBUG
2069 #ifdef ISDN_TTY_STAT_DEBUG
2082 #ifdef ISDN_TTY_STAT_DEBUG
2093 #ifdef ISDN_TTY_STAT_DEBUG
2102 #ifdef ISDN_DEBUG_MODEM_HUP
2110 #ifdef ISDN_TTY_STAT_DEBUG
2117 if (info->
port.blocked_open &&
2127 (info->
port.blocked_open &&
2150 #ifdef ISDN_TTY_STAT_DEBUG
2154 #ifdef ISDN_DEBUG_MODEM_HUP
2162 #ifdef ISDN_TTY_STAT_DEBUG
2178 #ifdef ISDN_TTY_STAT_DEBUG
2182 info = &
dev->mdm.info[
i];
2189 #ifdef CONFIG_ISDN_TTY_FAX
2196 #ifdef CONFIG_ISDN_AUDIO
2201 if (info->vonline) {
2219 #define cmdchar(c) ((c >= ' ') && (c <= 0x7f))
2245 tty = info->
port.tty;
2247 spin_unlock_irqrestore(&info->
readlock, flags);
2257 spin_unlock_irqrestore(&info->
readlock, flags);
2261 #ifdef CONFIG_ISDN_AUDIO
2262 ISDN_AUDIO_SKB_DLECOUNT(skb) = 0;
2263 ISDN_AUDIO_SKB_LOCK(skb) = 0;
2267 for (p = msg; *
p; p++) {
2284 if (tty_insert_flip_char(tty, c,
TTY_NORMAL) == 0)
2291 spin_unlock_irqrestore(&info->
readlock, flags);
2297 spin_unlock_irqrestore(&info->
readlock, flags);
2309 #ifdef ISDN_DEBUG_MODEM_HUP
2317 isdn_tty_off_hook(
void)
2322 #define PLUSWAIT1 (HZ / 2)
2323 #define PLUSWAIT2 (HZ * 3 / 2)
2337 isdn_tty_check_esc(
const u_char *p,
u_char plus,
int count,
int *pluscount,
2348 if (*(p++) == plus) {
2349 if ((*pluscount)++) {
2358 if ((*pluscount == 3) && (count == 1))
2380 static char *msg[] =
2381 {
"OK",
"CONNECT",
"RING",
"NO CARRIER",
"ERROR",
2382 "CONNECT 64000",
"NO DIALTONE",
"BUSY",
"NO ANSWER",
2383 "RINGING",
"NO MSN/EAZ",
"VCON",
"RUNG"};
2391 isdn_tty_cmd_ATA(info);
2394 #ifdef ISDN_DEBUG_MODEM_HUP
2405 #ifdef CONFIG_ISDN_AUDIO
2406 if (info->vonline & 1) {
2407 #ifdef ISDN_DEBUG_MODEM_VOICE
2414 if (info->vonline & 2) {
2415 #ifdef ISDN_DEBUG_MODEM_VOICE
2431 #ifdef ISDN_DEBUG_MODEM_VOICE
2445 sprintf(s,
"\r\n%d\r\n", code);
2548 isdn_tty_show_profile(
int ridx,
modem_info *info)
2560 isdn_tty_get_msnstr(
char *n,
char **p)
2564 while (((*p[0] >=
'0' && *p[0] <=
'9') ||
2566 (*p[0] ==
',') || (*p[0] ==
':')) &&
2576 isdn_tty_getdial(
char *p,
char *q,
int cnt)
2582 while (
strchr(
" 0123456789,#.*WPTSR-", *p) && *p && --cnt > 0) {
2583 if ((*p >=
'0' && *p <=
'9') || ((*p ==
'S') && first) ||
2584 ((*p ==
'R') && first) ||
2585 (*p ==
'*') || (*p ==
'#')) {
2597 #define PARSE_ERROR { isdn_tty_modem_result(RESULT_ERROR, info); return; }
2598 #define PARSE_ERROR1 { isdn_tty_modem_result(RESULT_ERROR, info); return 1; }
2609 sprintf(s,
" Direction: %s\r\n", info->
last_dir ?
"outgoing" :
"incoming");
2669 sprintf(s,
" Hangup location: %s\r\n", info->
last_lhup ?
"local" :
"remote");
2679 isdn_tty_cmd_ATand(
char **p,
modem_info *info)
2685 #define MAXRB (sizeof(rb) - 1)
2694 #ifdef CONFIG_ISDN_AUDIO
2744 isdn_tty_get_msnstr(m->
msn, p);
2751 isdn_tty_reset_profile(m);
2752 isdn_tty_modem_reset_regs(info, 1);
2754 #ifdef DUMMY_HAYES_AT
2766 while (*p[0] && (
strchr(
"0123456789,-*[]?;", *p[0])) &&
2768 m->
lmsn[i++] = *p[0]++;
2809 if ((i > 0) && (i < 9))
2819 sprintf(rb,
"S%02d=%03d%s", i,
2820 m->
mdmreg[i], ((i + 1) % 10) ?
" " :
"\r\n");
2823 sprintf(rb,
"\r\nEAZ/MSN: %.50s\r\n",
2838 modem_write_profile(m);
2889 #ifdef CONFIG_ISDN_AUDIO
2923 if (mreg < 0 || mreg >= ISDN_MODEM_NUMREG)
2929 if (mval < 0 || mval > 255)
2931 if (isdn_tty_check_ats(mreg, mval, info, m))
2939 if ((bitpos < 0) || (bitpos > 7))
2945 if (bval < 0 || bval > 1)
2948 mval = m->
mdmreg[mreg] | (1 << bitpos);
2950 mval = m->
mdmreg[mreg] & ~(1 << bitpos);
2951 if (isdn_tty_check_ats(mreg, mval, info, m))
2967 isdn_tty_show_profile(mreg, info);
2993 #ifdef CONFIG_ISDN_AUDIO
2996 if (m->
mdmreg[REG_SI1I] == 1) {
3011 #ifdef CONFIG_ISDN_TTY_FAX
3013 cmd.
parm.fax = info->fax;
3014 info->fax->direction = ISDN_TTY_FAX_CONN_IN;
3029 #ifdef CONFIG_ISDN_AUDIO
3034 isdn_tty_cmd_PLUSF(
char **p,
modem_info *info)
3039 if (!
strncmp(p[0],
"CLASS", 5)) {
3046 #ifdef CONFIG_ISDN_TTY_FAX
3065 #ifdef CONFIG_ISDN_TTY_FAX
3068 if (!(
dev->global_features &
3079 if (!(
dev->global_features &
3100 #ifdef CONFIG_ISDN_TTY_FAX
3101 if (
dev->global_features &
3104 if (
dev->global_features &
3120 #ifdef CONFIG_ISDN_TTY_FAX
3131 isdn_tty_cmd_PLUSV(
char **p,
modem_info *info)
3135 static char *vcmd[] =
3136 {
"NH",
"IP",
"LS",
"RX",
"SD",
"SM",
"TX",
"DD",
NULL};
3144 if (!
strncmp(vcmd[i], p[0], 2)) {
3178 isdn_tty_modem_reset_vpar(m);
3185 sprintf(rs,
"\r\n%d", m->vpar[0]);
3220 if (!info->dtmf_state) {
3225 if (!info->silence_state) {
3229 if (m->vpar[3] < 5) {
3231 if (!info->adpcmr) {
3236 #ifdef ISDN_DEBUG_AT
3255 if ((*p[0] >=
'0') && (*p[0] <=
'9')) {
3257 if ((par1 < 0) || (par1 > 31))
3263 if ((par2 < 0) || (par2 > 255))
3286 sprintf(rs,
"\r\n<%d>,<%d><8000>",
3300 if ((par1 < 2) || (par1 > 6))
3334 if (!info->dtmf_state) {
3338 if (m->vpar[3] < 5) {
3340 if (!info->adpcms) {
3345 #ifdef ISDN_DEBUG_AT
3365 if ((*p[0] >=
'0') && (*p[0] <=
'9')) {
3369 if ((par1 < 0) || (par1 > 15))
3375 if ((par2 < 0) || (par2 > 255))
3416 #ifdef ISDN_DEBUG_AT
3419 for (p = &m->
mdmcmd[2]; *p;) {
3427 isdn_tty_cmd_ATA(info);
3438 isdn_tty_getdial(++p, ds,
sizeof ds);
3443 isdn_tty_dial(ds, info, m);
3467 isdn_tty_on_hook(info);
3471 isdn_tty_off_hook();
3474 isdn_tty_on_hook(info);
3489 isdn_tty_report(info);
3499 #ifdef DUMMY_HAYES_AT
3534 if (isdn_tty_cmd_ATS(&p, info))
3556 isdn_tty_on_hook(info);
3558 isdn_tty_modem_reset_regs(info, 1);
3563 #ifdef CONFIG_ISDN_AUDIO
3566 if (isdn_tty_cmd_PLUSF(&p, info))
3574 if (isdn_tty_cmd_PLUSV(&p, info))
3580 isdn_tty_get_msnstr(ds, &p);
3581 isdn_tty_suspend(ds, info, m);
3585 isdn_tty_get_msnstr(ds, &p);
3586 isdn_tty_resume(ds, info, m);
3590 isdn_tty_send_msg(info, m, p);
3598 if (isdn_tty_cmd_ATand(&p, info))
3605 #ifdef CONFIG_ISDN_AUDIO
3614 #define my_toupper(c) (((c >= 'a') && (c <= 'z')) ? (c & 0xdf) : c)
3625 isdn_tty_edit_at(
const char *p,
int count,
modem_info *info)
3633 for (cnt = count; cnt > 0; p++, cnt--) {
3645 isdn_tty_parse_at(info);
3757 isdn_tty_senddown(info);
3758 isdn_tty_tint(info);