1 /* $Id: isdn_ttyfax.c,v 1.3 1999/08/22 20:26:12 calle Exp $
2 * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel).
4 * Copyright 1999 by Armin Schindler (mac@melware.de)
5 * Copyright 1999 by Ralf Spachmann (mel@melware.de)
6 * Copyright 1999 by Cytronics & Melware
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * $Log: isdn_ttyfax.c,v $
23 * Revision 1.3 1999/08/22 20:26:12 calle
24 * backported changes from kernel 2.3.14:
25 * - several #include "config.h" gone, others come.
26 * - "struct device" changed to "struct net_device" in 2.3.14, added a
27 * define in isdn_compat.h for older kernel versions.
29 * Revision 1.2 1999/08/05 10:36:10 armin
30 * Bugfix: kernel oops on getting revision.
32 * Revision 1.1 1999/07/31 12:59:50 armin
33 * Added tty fax capabilities.
38 #undef ISDN_TTY_FAX_STAT_DEBUG
39 #undef ISDN_TTY_FAX_CMD_DEBUG
41 #define __NO_VERSION__
42 #include <linux/module.h>
43 #include <linux/isdn.h>
44 #include "isdn_common.h"
46 #include "isdn_ttyfax.h"
49 static char *isdn_tty_fax_revision
= "$Revision: 1.3 $";
51 #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; }
54 isdn_getrev(const char *revision
)
59 if ((p
= strchr(revision
, ':'))) {
70 * Fax Class 2 Modem results
73 static void isdn_tty_fax_modem_result(int code
, modem_info
* info
)
75 atemu
*m
= &info
->emu
;
82 {"OK", "ERROR", "+FCON", "+FCSI:", "+FDIS:",
83 "+FHNG:", "+FDCS:", "CONNECT", "+FTSI:",
84 "+FCFR", "+FPTS:", "+FET:" };
87 isdn_tty_at_cout("\r\n", info
);
88 isdn_tty_at_cout(msg
[code
], info
);
90 #ifdef ISDN_TTY_FAX_CMD_DEBUG
91 printk(KERN_DEBUG
"isdn_tty: Fax send %s on ttyI%d\n",
92 msg
[code
], info
->line
);
100 /* Append CPN, if enabled */
101 if ((m
->mdmreg
[REG_CPN
] & BIT_CPN
) &&
102 (!(dev
->usage
[info
->isdn_channel
] & ISDN_USAGE_OUTGOING
))) {
103 sprintf(rs
, "/%s", m
->cpn
);
104 isdn_tty_at_cout(rs
, info
);
108 if (f
->phase
== ISDN_FAX_PHASE_A
)
109 f
->phase
= ISDN_FAX_PHASE_B
;
113 sprintf(rs
, "\"%s\"", f
->r_id
);
114 isdn_tty_at_cout(rs
, info
);
118 rp
= &f
->r_resolution
;
119 for(i
= 0; i
< 8; i
++) {
120 sprintf(rss
, "%c%s", rp
[i
] + 48,
124 isdn_tty_at_cout(rs
, info
);
125 #ifdef ISDN_TTY_FAX_CMD_DEBUG
126 printk(KERN_DEBUG
"isdn_tty: Fax DIS=%s on ttyI%d\n",
131 sprintf(rs
, "%d", f
->code
);
132 isdn_tty_at_cout(rs
, info
);
137 rp
= &f
->r_resolution
;
138 for(i
= 0; i
< 8; i
++) {
139 sprintf(rss
, "%c%s", rp
[i
] + 48,
143 isdn_tty_at_cout(rs
, info
);
144 #ifdef ISDN_TTY_FAX_CMD_DEBUG
145 printk(KERN_DEBUG
"isdn_tty: Fax DCS=%s on ttyI%d\n",
149 case 7: /* CONNECT */
150 info
->faxonline
|= 2;
155 isdn_tty_at_cout("1", info
);
158 sprintf(rs
, "%d", f
->fet
);
159 isdn_tty_at_cout(rs
, info
);
163 isdn_tty_at_cout("\r\n", info
);
166 case 7: /* CONNECT */
168 if (info
->faxonline
& 1) {
169 sprintf(rs
, "%c", XON
);
170 isdn_tty_at_cout(rs
, info
);
177 isdn_tty_fax_command(modem_info
* info
)
179 T30_s
*f
= info
->fax
;
182 #ifdef ISDN_TTY_FAX_CMD_DEBUG
183 printk(KERN_DEBUG
"isdn_tty: Fax cmd %d on ttyI%d\n",
184 f
->r_code
, info
->line
);
187 case ISDN_TTY_FAX_FCON
:
189 isdn_tty_fax_modem_result(2, info
); /* +FCON */
191 case ISDN_TTY_FAX_FCON_I
:
192 info
->faxonline
= 16;
193 isdn_tty_fax_modem_result(2, info
); /* +FCON */
195 case ISDN_TTY_FAX_RID
:
196 if (info
->faxonline
& 1)
197 isdn_tty_fax_modem_result(3, info
); /* +FCSI */
198 if (info
->faxonline
& 16)
199 isdn_tty_fax_modem_result(8, info
); /* +FTSI */
201 case ISDN_TTY_FAX_DIS
:
202 isdn_tty_fax_modem_result(4, info
); /* +FDIS */
204 case ISDN_TTY_FAX_HNG
:
205 if (f
->phase
== ISDN_FAX_PHASE_C
) {
206 if (f
->direction
== ISDN_TTY_FAX_CONN_IN
) {
207 sprintf(rs
, "%c%c", DLE
, ETX
);
208 isdn_tty_at_cout(rs
, info
);
210 sprintf(rs
, "%c", 0x18);
211 isdn_tty_at_cout(rs
, info
);
213 info
->faxonline
&= ~2; /* leave data mode */
216 f
->phase
= ISDN_FAX_PHASE_E
;
217 isdn_tty_fax_modem_result(5, info
); /* +FHNG */
218 isdn_tty_fax_modem_result(0, info
); /* OK */
220 case ISDN_TTY_FAX_DCS
:
221 isdn_tty_fax_modem_result(6, info
); /* +FDCS */
222 isdn_tty_fax_modem_result(7, info
); /* CONNECT */
223 f
->phase
= ISDN_FAX_PHASE_C
;
225 case ISDN_TTY_FAX_TRAIN_OK
:
226 isdn_tty_fax_modem_result(6, info
); /* +FDCS */
227 isdn_tty_fax_modem_result(0, info
); /* OK */
229 case ISDN_TTY_FAX_SENT
:
230 isdn_tty_fax_modem_result(0, info
); /* OK */
232 case ISDN_TTY_FAX_CFR
:
233 isdn_tty_fax_modem_result(9, info
); /* +FCFR */
235 case ISDN_TTY_FAX_ET
:
236 sprintf(rs
, "%c%c", DLE
, ETX
);
237 isdn_tty_at_cout(rs
, info
);
238 isdn_tty_fax_modem_result(10, info
); /* +FPTS */
239 isdn_tty_fax_modem_result(11, info
); /* +FET */
240 isdn_tty_fax_modem_result(0, info
); /* OK */
241 info
->faxonline
&= ~2; /* leave data mode */
243 f
->phase
= ISDN_FAX_PHASE_D
;
245 case ISDN_TTY_FAX_PTS
:
246 isdn_tty_fax_modem_result(10, info
); /* +FPTS */
247 if (f
->direction
== ISDN_TTY_FAX_CONN_OUT
) {
249 f
->phase
= ISDN_FAX_PHASE_B
;
251 isdn_tty_fax_modem_result(0, info
); /* OK */
254 case ISDN_TTY_FAX_EOP
:
255 info
->faxonline
&= ~2; /* leave data mode */
257 f
->phase
= ISDN_FAX_PHASE_D
;
266 isdn_tty_fax_bitorder(modem_info
*info
, struct sk_buff
*skb
)
274 if (!info
->fax
->bor
) {
275 for(i
= 0; i
< skb
->len
; i
++) {
278 LeftMask
= 0x80, RightMask
= 0x01;
279 LeftMask
> RightMask
;
280 LeftMask
>>= 1, RightMask
<<= 1
282 fBit
= (Data
& LeftMask
);
283 if (Data
& RightMask
)
299 * Parse AT+F.. FAX class 2 commands
302 int isdn_tty_cmd_PLUSF_FAX(char **p
, modem_info
* info
)
304 atemu
*m
= &info
->emu
;
305 T30_s
*f
= info
->fax
;
310 int maxdccval
[]={1,5,2,2,3,2,0,7};
312 /* FAA still unchanged */
313 if (!strncmp(p
[0], "AA", 2)) { /* TODO */
318 sprintf(rs
, "\r\n%d", 0);
319 isdn_tty_at_cout(rs
, info
);
323 par
= isdn_getnum(p
);
324 if ((par
< 0) || (par
> 255))
333 /* BADLIN=value - dummy 0=disable errorchk disabled, 1-255 nr. of lines for making page bad */
334 if (!strncmp(p
[0], "BADLIN", 6)) {
339 sprintf(rs
, "\r\n%d",f
->badlin
);
340 isdn_tty_at_cout(rs
, info
);
347 sprintf(rs
, "\r\n0-255");
348 isdn_tty_at_cout(rs
, info
);
352 par
= isdn_getnum(p
);
353 if ((par
< 0) || (par
> 255))
356 #ifdef ISDN_TTY_FAX_STAT_DEBUG
357 printk(KERN_DEBUG
"isdn_tty: Fax FBADLIN=%d\n", par
);
367 /* BADMUL=value - dummy 0=disable errorchk disabled (treshold multiplier) */
368 if (!strncmp(p
[0], "BADMUL", 6)){
373 sprintf(rs
, "\r\n%d", f
->badmul
);
374 isdn_tty_at_cout(rs
, info
);
381 sprintf(rs
, "\r\n0-255");
382 isdn_tty_at_cout(rs
, info
);
386 par
= isdn_getnum(p
);
387 if ((par
< 0) || (par
> 255))
390 #ifdef ISDN_TTY_FAX_STAT_DEBUG
391 printk(KERN_DEBUG
"isdn_tty: Fax FBADMUL=%d\n", par
);
401 /* BOR=n - Phase C bit order, 0=direct, 1=reverse */
402 if (!strncmp(p
[0], "BOR", 3)){
407 sprintf(rs
, "\r\n%d", f
->bor
);
408 isdn_tty_at_cout(rs
, info
);
415 sprintf(rs
, "\r\n0,1");
416 isdn_tty_at_cout(rs
, info
);
420 par
= isdn_getnum(p
);
421 if ((par
< 0) || (par
> 1))
424 #ifdef ISDN_TTY_FAX_STAT_DEBUG
425 printk(KERN_DEBUG
"isdn_tty: Fax FBOR=%d\n", par
);
435 /* NBC=n - No Best Capabilities */
436 if (!strncmp(p
[0], "NBC", 3)){
441 sprintf(rs
, "\r\n%d", f
->nbc
);
442 isdn_tty_at_cout(rs
, info
);
449 sprintf(rs
, "\r\n0,1");
450 isdn_tty_at_cout(rs
, info
);
454 par
= isdn_getnum(p
);
455 if ((par
< 0) || (par
> 1))
458 #ifdef ISDN_TTY_FAX_STAT_DEBUG
459 printk(KERN_DEBUG
"isdn_tty: Fax FNBC=%d\n", par
);
469 /* BUF? - Readonly buffersize readout */
470 if (!strncmp(p
[0], "BUF?", 4)) {
472 #ifdef ISDN_TTY_FAX_STAT_DEBUG
473 printk(KERN_DEBUG
"isdn_tty: Fax FBUF? (%d) \n", (16 * m
->mdmreg
[REG_PSIZE
]));
476 sprintf(rs
, "\r\n %d ", (16 * m
->mdmreg
[REG_PSIZE
]));
477 isdn_tty_at_cout(rs
, info
);
481 /* CIG=string - local fax station id string for polling rx */
482 if (!strncmp(p
[0], "CIG", 3)) {
488 sprintf(rs
, "\r\n\"%s\"", f
->pollid
);
489 isdn_tty_at_cout(rs
, info
);
496 sprintf(rs
, "\r\n\"STRING\"");
497 isdn_tty_at_cout(rs
, info
);
503 for(i
=0; (*p
[0]) && i
< (FAXIDLEN
-1) && (*p
[0] != '"'); i
++)
505 f
->pollid
[i
] = *p
[0]++;
509 for(r
=i
; r
< FAXIDLEN
; r
++)
513 f
->pollid
[FAXIDLEN
-1] = 0;
514 #ifdef ISDN_TTY_FAX_STAT_DEBUG
515 printk(KERN_DEBUG
"isdn_tty: Fax local poll ID rx \"%s\"\n", f
->pollid
);
525 /* CQ=n - copy qlty chk, 0= no chk, 1=only 1D chk, 2=1D+2D chk */
526 if (!strncmp(p
[0], "CQ", 2)) {
531 sprintf(rs
, "\r\n%d", f
->cq
);
532 isdn_tty_at_cout(rs
, info
);
539 sprintf(rs
, "\r\n0,1,2");
540 isdn_tty_at_cout(rs
, info
);
544 par
= isdn_getnum(p
);
545 if ((par
< 0) || (par
> 2))
548 #ifdef ISDN_TTY_FAX_STAT_DEBUG
549 printk(KERN_DEBUG
"isdn_tty: Fax FCQ=%d\n", par
);
559 /* CR=n - can receive? 0= no data rx or poll remote dev, 1=do receive data or poll remote dev */
560 if (!strncmp(p
[0], "CR", 2)) {
565 sprintf(rs
, "\r\n%d", f
->cr
); /* read actual value from struct and print */
566 isdn_tty_at_cout(rs
, info
);
573 sprintf(rs
, "\r\n0,1"); /* display online help */
574 isdn_tty_at_cout(rs
, info
);
578 par
= isdn_getnum(p
);
579 if ((par
< 0) || (par
> 1))
582 #ifdef ISDN_TTY_FAX_STAT_DEBUG
583 printk(KERN_DEBUG
"isdn_tty: Fax FCR=%d\n", par
);
593 /* CTCRTY=value - ECM retry count */
594 if (!strncmp(p
[0], "CTCRTY", 6)){
599 sprintf(rs
, "\r\n%d",f
->ctcrty
);
600 isdn_tty_at_cout(rs
, info
);
607 sprintf(rs
, "\r\n0-255");
608 isdn_tty_at_cout(rs
, info
);
612 par
= isdn_getnum(p
);
613 if ((par
< 0) || (par
> 255))
616 #ifdef ISDN_TTY_FAX_STAT_DEBUG
617 printk(KERN_DEBUG
"isdn_tty: Fax FCTCRTY=%d\n", par
);
627 /* DCC=vr,br,wd,ln,df,ec,bf,st - DCE capabilities parms */
628 if (!strncmp(p
[0], "DCC", 3)) {
629 char *rp
= &f
->resolution
;
637 for(i
= 0; i
< 8; i
++) {
638 sprintf(rss
, "%c%s", rp
[i
] + 48,
642 isdn_tty_at_cout(rs
, info
);
647 isdn_tty_at_cout("\r\n(0,1),(0-5),(0-2),(0-2),(0-3),(0-2),(0),(0-7)",info
);
650 for (i
=0; (((*p
[0]>='0')&&(*p
[0]<='9'))||(*p
[0]==','))&&(i
<8); i
++) {
652 if ((*p
[0] - 48) > maxdccval
[i
]) {
661 #ifdef ISDN_TTY_FAX_STAT_DEBUG
662 printk(KERN_DEBUG
"isdn_tty: Fax FDCC capabilities DCE=%d,%d,%d,%d,%d,%d,%d,%d\n",
663 rp
[0], rp
[1], rp
[2], rp
[3], rp
[4], rp
[5], rp
[6], rp
[7]);
673 /* DIS=vr,br,wd,ln,df,ec,bf,st - current session parms */
674 if (!strncmp(p
[0], "DIS", 3)) {
675 char *rp
= &f
->resolution
;
683 for(i
= 0; i
< 8; i
++) {
684 sprintf(rss
, "%c%s", rp
[i
] + 48,
688 isdn_tty_at_cout(rs
, info
);
693 isdn_tty_at_cout("\r\n(0,1),(0-5),(0-2),(0-2),(0-3),(0-2),(0),(0-7)",info
);
696 for (i
=0; (((*p
[0]>='0')&&(*p
[0]<='9'))||(*p
[0]==','))&&(i
<8); i
++) {
698 if ((*p
[0] - 48) > maxdccval
[i
]) {
707 #ifdef ISDN_TTY_FAX_STAT_DEBUG
708 printk(KERN_DEBUG
"isdn_tty: Fax FDIS session parms=%d,%d,%d,%d,%d,%d,%d,%d\n",
709 rp
[0], rp
[1], rp
[2], rp
[3], rp
[4], rp
[5], rp
[6], rp
[7]);
719 /* DR - Receive Phase C data command, initiates document reception */
720 if (!strncmp(p
[0], "DR", 2)) {
722 if ((info
->faxonline
& 16) && /* incoming connection */
723 ((f
->phase
== ISDN_FAX_PHASE_B
) || (f
->phase
== ISDN_FAX_PHASE_D
))) {
724 #ifdef ISDN_TTY_FAX_STAT_DEBUG
725 printk(KERN_DEBUG
"isdn_tty: Fax FDR\n");
727 f
->code
= ISDN_TTY_FAX_DR
;
728 cmd
.driver
= info
->isdn_driver
;
729 cmd
.arg
= info
->isdn_channel
;
730 cmd
.command
= ISDN_CMD_FAXCMD
;
732 if (f
->phase
== ISDN_FAX_PHASE_B
) {
733 f
->phase
= ISDN_FAX_PHASE_C
;
734 } else if (f
->phase
== ISDN_FAX_PHASE_D
) {
736 case 0: /* next page will be received */
737 f
->phase
= ISDN_FAX_PHASE_C
;
738 isdn_tty_fax_modem_result(7, info
); /* CONNECT */
740 case 1: /* next doc will be received */
741 f
->phase
= ISDN_FAX_PHASE_B
;
743 case 2: /* fax session is terminating */
744 f
->phase
= ISDN_FAX_PHASE_E
;
756 /* DT=df,vr,wd,ln - TX phase C data command (release DCE to proceed with negotiation) */
757 if (!strncmp(p
[0], "DT", 2)) {
758 int i
, val
[]={4,0,2,3};
759 char *rp
= &f
->resolution
;
762 if (!info
->faxonline
& 1) /* not outgoing connection */
765 for (i
=0; (((*p
[0]>='0')&&(*p
[0]<='9'))||(*p
[0]==','))&&(i
<4); i
++) {
767 if ((*p
[0] - 48) > maxdccval
[val
[i
]]) {
770 rp
[val
[i
]] = *p
[0] - 48;
776 #ifdef ISDN_TTY_FAX_STAT_DEBUG
777 printk(KERN_DEBUG
"isdn_tty: Fax FDT tx data command parms=%d,%d,%d,%d\n",
778 rp
[4], rp
[0], rp
[2], rp
[3]);
780 if ((f
->phase
== ISDN_FAX_PHASE_B
) || (f
->phase
== ISDN_FAX_PHASE_D
)) {
781 f
->code
= ISDN_TTY_FAX_DT
;
782 cmd
.driver
= info
->isdn_driver
;
783 cmd
.arg
= info
->isdn_channel
;
784 cmd
.command
= ISDN_CMD_FAXCMD
;
786 if (f
->phase
== ISDN_FAX_PHASE_D
) {
787 f
->phase
= ISDN_FAX_PHASE_C
;
788 isdn_tty_fax_modem_result(7, info
); /* CONNECT */
796 /* ECM=n - Error mode control 0=disabled, 2=enabled, handled by DCE alone incl. buff of partial pages */
797 if (!strncmp(p
[0], "ECM", 3)) {
802 sprintf(rs
, "\r\n%d",f
->ecm
);
803 isdn_tty_at_cout(rs
, info
);
810 sprintf(rs
, "\r\n0,2");
811 isdn_tty_at_cout(rs
, info
);
815 par
= isdn_getnum(p
);
816 if ((par
!= 0) && (par
!= 2))
819 #ifdef ISDN_TTY_FAX_STAT_DEBUG
820 printk(KERN_DEBUG
"isdn_tty: Fax FECM=%d\n", par
);
830 /* ET=n - End of page or document */
831 if (!strncmp(p
[0], "ET=", 3)) {
835 sprintf(rs
, "\r\n0-2");
836 isdn_tty_at_cout(rs
, info
);
838 if ((f
->phase
!= ISDN_FAX_PHASE_D
) || (!info
->faxonline
& 1))
840 par
= isdn_getnum(p
);
841 if ((par
< 0) || (par
> 2))
844 f
->code
= ISDN_TTY_FAX_ET
;
845 cmd
.driver
= info
->isdn_driver
;
846 cmd
.arg
= info
->isdn_channel
;
847 cmd
.command
= ISDN_CMD_FAXCMD
;
849 #ifdef ISDN_TTY_FAX_STAT_DEBUG
850 printk(KERN_DEBUG
"isdn_tty: Fax FET=%d\n", par
);
858 if (!strncmp(p
[0], "K", 1)) {
860 if ((f
->phase
== ISDN_FAX_PHASE_IDLE
) || (f
->phase
== ISDN_FAX_PHASE_E
))
862 isdn_tty_modem_hup(info
, 1);
866 /* LID=string - local fax ID */
867 if (!strncmp(p
[0], "LID", 3)) {
873 sprintf(rs
, "\r\n\"%s\"", f
->id
);
874 isdn_tty_at_cout(rs
, info
);
881 sprintf(rs
, "\r\n\"STRING\"");
882 isdn_tty_at_cout(rs
, info
);
888 for(i
=0; (*p
[0]) && i
< (FAXIDLEN
-1) && (*p
[0] != '"'); i
++)
894 for(r
=i
; r
< FAXIDLEN
; r
++)
898 f
->id
[FAXIDLEN
-1] = 0;
899 #ifdef ISDN_TTY_FAX_STAT_DEBUG
900 printk(KERN_DEBUG
"isdn_tty: Fax local ID \"%s\"\n", f
->id
);
911 /* LO=n - Flow control opts */
912 if (!strncmp(p
[0], "LO", 2)) { /* TODO */
917 sprintf(rs
, "\r\n%d",f
->lo
);
918 isdn_tty_at_cout(rs
, info
);
925 sprintf(rs
, "\r\n0,1,2");
926 isdn_tty_at_cout(rs
, info
);
930 par
= isdn_getnum(p
);
931 if ((par
< 0) || (par
> 2))
934 #ifdef ISDN_TTY_FAX_STAT_DEBUG
935 printk(KERN_DEBUG
"isdn_tty: Fax FLO=%d\n", par
);
946 /* LPL=n - Doc for polling cmd */
947 if (!strncmp(p
[0], "LPL", 3)) { /* TODO */
952 sprintf(rs
, "\r\n%d",f
->lpl
);
953 isdn_tty_at_cout(rs
, info
);
960 sprintf(rs
, "\r\n0,1");
961 isdn_tty_at_cout(rs
, info
);
965 par
= isdn_getnum(p
);
966 if ((par
< 0) || (par
> 1))
969 #ifdef ISDN_TTY_FAX_STAT_DEBUG
970 printk(KERN_DEBUG
"isdn_tty: Fax FLPL=%d\n", par
);
981 /* MDL? - DCE Model */
982 if (!strncmp(p
[0], "MDL?", 4)) {
984 #ifdef ISDN_TTY_FAX_STAT_DEBUG
985 printk(KERN_DEBUG
"isdn_tty: FMDL?\n");
987 isdn_tty_at_cout("\r\nisdn4linux", info
);
991 /* MFR? - DCE Manufacturer */
992 if (!strncmp(p
[0], "MFR?", 4)) {
994 #ifdef ISDN_TTY_FAX_STAT_DEBUG
995 printk(KERN_DEBUG
"isdn_tty: FMFR?\n");
997 isdn_tty_at_cout("\r\nisdn4linux", info
);
1001 /* MINSP=n - Minimum Speed for Phase C */
1002 if (!strncmp(p
[0], "MINSP", 5)) {
1007 sprintf(rs
, "\r\n%d",f
->minsp
);
1008 isdn_tty_at_cout(rs
, info
);
1015 sprintf(rs
, "\r\n0-5");
1016 isdn_tty_at_cout(rs
, info
);
1020 par
= isdn_getnum(p
);
1021 if ((par
< 0) || (par
> 5))
1024 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1025 printk(KERN_DEBUG
"isdn_tty: Fax FMINSP=%d\n", par
);
1035 /* PHCTO=value - DTE phase C timeout */
1036 if (!strncmp(p
[0], "PHCTO", 5)){
1041 sprintf(rs
, "\r\n%d",f
->phcto
);
1042 isdn_tty_at_cout(rs
, info
);
1049 sprintf(rs
, "\r\n0-255");
1050 isdn_tty_at_cout(rs
, info
);
1054 par
= isdn_getnum(p
);
1055 if ((par
< 0) || (par
> 255))
1058 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1059 printk(KERN_DEBUG
"isdn_tty: Fax FPHCTO=%d\n", par
);
1070 /* PTS=n - Page transfer status */
1071 if (!strncmp(p
[0], "PTS", 3)) { /* TODO */
1076 sprintf(rs
, "\r\n%d",f
->pts
);
1077 isdn_tty_at_cout(rs
, info
);
1084 sprintf(rs
, "\r\n0-5");
1085 isdn_tty_at_cout(rs
, info
);
1089 par
= isdn_getnum(p
);
1090 if ((par
< 0) || (par
> 5))
1093 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1094 printk(KERN_DEBUG
"isdn_tty: Fax FPTS=%d\n", par
);
1105 /* REL=n - Phase C received EOL alignment */
1106 if (!strncmp(p
[0], "REL", 3)) {
1111 sprintf(rs
, "\r\n%d",f
->rel
);
1112 isdn_tty_at_cout(rs
, info
);
1119 sprintf(rs
, "\r\n0,1");
1120 isdn_tty_at_cout(rs
, info
);
1124 par
= isdn_getnum(p
);
1125 if ((par
< 0) || (par
> 1))
1128 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1129 printk(KERN_DEBUG
"isdn_tty: Fax FREL=%d\n", par
);
1139 /* REV? - DCE Revision */
1140 if (!strncmp(p
[0], "REV?", 4)) {
1142 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1143 printk(KERN_DEBUG
"isdn_tty: FREV?\n");
1145 strcpy(rss
, isdn_tty_fax_revision
);
1146 sprintf(rs
, "\r\nRev: %s", isdn_getrev(rss
));
1147 isdn_tty_at_cout(rs
, info
);
1152 /* SPL=n - Enable polling */
1153 if (!strncmp(p
[0], "SPL", 3)) { /* TODO */
1158 sprintf(rs
, "\r\n%d", f
->spl
);
1159 isdn_tty_at_cout(rs
, info
);
1166 sprintf(rs
, "\r\n0,1");
1167 isdn_tty_at_cout(rs
, info
);
1171 par
= isdn_getnum(p
);
1172 if ((par
< 0) || (par
> 1))
1175 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1176 printk(KERN_DEBUG
"isdn_tty: Fax FSPL=%d\n", par
);
1187 /* Phase C Transmit Data Block Size */
1188 if (!strncmp(p
[0], "TBC=", 4)) { /* dummy, not used */
1190 #ifdef ISDN_TTY_FAX_STAT_DEBUG
1191 printk(KERN_DEBUG
"isdn_tty: Fax FTBC=%c\n", *p
[0]);
1203 printk(KERN_DEBUG
"isdn_tty: unknown token=>AT+F%s<\n", p
[0]);