File: /usr/src/linux/drivers/isdn/eicon/eicon_dsp.h
1 /* $Id: eicon_dsp.h,v 1.7 2000/05/07 08:51:04 armin Exp $
2 *
3 * ISDN lowlevel-module for Eicon active cards.
4 * DSP definitions
5 *
6 * Copyright 1999,2000 by Armin Schindler (mac@melware.de)
7 * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 *
24 */
25
26 #ifndef DSP_H
27 #define DSP_H
28
29 #include "dsp_defs.h"
30
31
32 #define DSP_UDATA_REQUEST_SWITCH_FRAMER 1
33 /*
34 parameters:
35 <byte> transmit framer type
36 <byte> receive framer type
37 */
38
39 #define DSP_REQUEST_SWITCH_FRAMER_HDLC 0
40 #define DSP_REQUEST_SWITCH_FRAMER_TRANSPARENT 1
41 #define DSP_REQUEST_SWITCH_FRAMER_ASYNC 2
42
43
44 #define DSP_UDATA_REQUEST_CLEARDOWN 2
45 /*
46 parameters:
47 - none -
48 */
49
50
51 #define DSP_UDATA_REQUEST_TX_CONFIRMATION_ON 3
52 /*
53 parameters:
54 - none -
55 */
56
57
58 #define DSP_UDATA_REQUEST_TX_CONFIRMATION_OFF 4
59 /*
60 parameters:
61 - none -
62 */
63
64 typedef struct eicon_dsp_ind {
65 __u16 time __attribute__ ((packed));
66 __u8 norm __attribute__ ((packed));
67 __u16 options __attribute__ ((packed));
68 __u32 speed __attribute__ ((packed));
69 __u16 delay __attribute__ ((packed));
70 __u32 txspeed __attribute__ ((packed));
71 __u32 rxspeed __attribute__ ((packed));
72 } eicon_dsp_ind;
73
74 #define DSP_CONNECTED_OPTION_V42_TRANS 0x0002
75 #define DSP_CONNECTED_OPTION_V42_LAPM 0x0004
76 #define DSP_CONNECTED_OPTION_SHORT_TRAIN 0x0008
77 #define DSP_CONNECTED_OPTION_TALKER_ECHO_PROTECT 0x0010
78
79 #define DSP_UDATA_INDICATION_DISCONNECT 5
80 /*
81 returns:
82 <byte> cause
83 */
84
85 #define DSP_DISCONNECT_CAUSE_NONE 0x00
86 #define DSP_DISCONNECT_CAUSE_BUSY_TONE 0x01
87 #define DSP_DISCONNECT_CAUSE_CONGESTION_TONE 0x02
88 #define DSP_DISCONNECT_CAUSE_INCOMPATIBILITY 0x03
89 #define DSP_DISCONNECT_CAUSE_CLEARDOWN 0x04
90 #define DSP_DISCONNECT_CAUSE_TRAINING_TIMEOUT 0x05
91
92 #define DSP_UDATA_INDICATION_TX_CONFIRMATION 6
93 /*
94 returns:
95 <word> confirmation number
96 */
97
98
99 #define DSP_UDATA_REQUEST_SEND_DTMF_DIGITS 16
100 /*
101 parameters:
102 <word> tone duration (ms)
103 <word> gap duration (ms)
104 <byte> digit 0 tone code
105 ...
106 <byte> digit n tone code
107 */
108
109 #define DSP_SEND_DTMF_DIGITS_HEADER_LENGTH 5
110
111 #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_697_HZ 0x00
112 #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_770_HZ 0x01
113 #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_852_HZ 0x02
114 #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_941_HZ 0x03
115 #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_MASK 0x03
116 #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1209_HZ 0x00
117 #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1336_HZ 0x04
118 #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1477_HZ 0x08
119 #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1633_HZ 0x0c
120 #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_MASK 0x0c
121
122 #define DSP_DTMF_DIGIT_TONE_CODE_0 0x07
123 #define DSP_DTMF_DIGIT_TONE_CODE_1 0x00
124 #define DSP_DTMF_DIGIT_TONE_CODE_2 0x04
125 #define DSP_DTMF_DIGIT_TONE_CODE_3 0x08
126 #define DSP_DTMF_DIGIT_TONE_CODE_4 0x01
127 #define DSP_DTMF_DIGIT_TONE_CODE_5 0x05
128 #define DSP_DTMF_DIGIT_TONE_CODE_6 0x09
129 #define DSP_DTMF_DIGIT_TONE_CODE_7 0x02
130 #define DSP_DTMF_DIGIT_TONE_CODE_8 0x06
131 #define DSP_DTMF_DIGIT_TONE_CODE_9 0x0a
132 #define DSP_DTMF_DIGIT_TONE_CODE_STAR 0x03
133 #define DSP_DTMF_DIGIT_TONE_CODE_HASHMARK 0x0b
134 #define DSP_DTMF_DIGIT_TONE_CODE_A 0x0c
135 #define DSP_DTMF_DIGIT_TONE_CODE_B 0x0d
136 #define DSP_DTMF_DIGIT_TONE_CODE_C 0x0e
137 #define DSP_DTMF_DIGIT_TONE_CODE_D 0x0f
138
139
140 #define DSP_UDATA_INDICATION_DTMF_DIGITS_SENT 16
141 /*
142 returns:
143 - none -
144 One indication will be sent for every request.
145 */
146
147
148 #define DSP_UDATA_REQUEST_ENABLE_DTMF_RECEIVER 17
149 /*
150 parameters:
151 <word> tone duration (ms)
152 <word> gap duration (ms)
153 */
154 typedef struct enable_dtmf_s {
155 __u16 tone;
156 __u16 gap;
157 } enable_dtmf_s;
158
159 #define DSP_UDATA_REQUEST_DISABLE_DTMF_RECEIVER 18
160 /*
161 parameters:
162 - none -
163 */
164
165 #define DSP_UDATA_INDICATION_DTMF_DIGITS_RECEIVED 17
166 /*
167 returns:
168 <byte> digit 0 tone code
169 ...
170 <byte> digit n tone code
171 */
172
173 #define DSP_DTMF_DIGITS_RECEIVED_HEADER_LENGTH 1
174
175
176 #define DSP_UDATA_INDICATION_MODEM_CALLING_TONE 18
177 /*
178 returns:
179 - none -
180 */
181
182 #define DSP_UDATA_INDICATION_FAX_CALLING_TONE 19
183 /*
184 returns:
185 - none -
186 */
187
188 #define DSP_UDATA_INDICATION_ANSWER_TONE 20
189 /*
190 returns:
191 - none -
192 */
193
194 /* ============= FAX ================ */
195
196 #define EICON_FAXID_LEN 20
197
198 typedef struct eicon_t30_s {
199 __u8 code;
200 __u8 rate;
201 __u8 resolution;
202 __u8 format;
203 __u8 pages_low;
204 __u8 pages_high;
205 __u8 atf;
206 __u8 control_bits_low;
207 __u8 control_bits_high;
208 __u8 feature_bits_low;
209 __u8 feature_bits_high;
210 __u8 universal_5;
211 __u8 universal_6;
212 __u8 universal_7;
213 __u8 station_id_len;
214 __u8 head_line_len;
215 __u8 station_id[EICON_FAXID_LEN];
216 /* __u8 head_line[]; */
217 } eicon_t30_s;
218
219 /* EDATA transmit messages */
220 #define EDATA_T30_DIS 0x01
221 #define EDATA_T30_FTT 0x02
222 #define EDATA_T30_MCF 0x03
223
224 /* EDATA receive messages */
225 #define EDATA_T30_DCS 0x81
226 #define EDATA_T30_TRAIN_OK 0x82
227 #define EDATA_T30_EOP 0x83
228 #define EDATA_T30_MPS 0x84
229 #define EDATA_T30_EOM 0x85
230 #define EDATA_T30_DTC 0x86
231
232 #define T30_FORMAT_SFF 0
233 #define T30_FORMAT_ASCII 1
234 #define T30_FORMAT_COUNT 2
235
236 #define T30_CONTROL_BIT_DISABLE_FINE 0x0001
237 #define T30_CONTROL_BIT_ENABLE_ECM 0x0002
238 #define T30_CONTROL_BIT_ECM_64_BYTES 0x0004
239 #define T30_CONTROL_BIT_ENABLE_2D_CODING 0x0008
240 #define T30_CONTROL_BIT_ENABLE_T6_CODING 0x0010
241 #define T30_CONTROL_BIT_ENABLE_UNCOMPR 0x0020
242 #define T30_CONTROL_BIT_ACCEPT_POLLING 0x0040
243 #define T30_CONTROL_BIT_REQUEST_POLLING 0x0080
244 #define T30_CONTROL_BIT_MORE_DOCUMENTS 0x0100
245
246 #define T30_CONTROL_BIT_ALL_FEATURES\
247 (T30_CONTROL_BIT_ENABLE_ECM | T30_CONTROL_BIT_ENABLE_2D_CODING |\
248 T30_CONTROL_BIT_ENABLE_T6_CODING | T30_CONTROL_BIT_ENABLE_UNCOMPR)
249
250 #define T30_FEATURE_BIT_FINE 0x0001
251 #define T30_FEATURE_BIT_ECM 0x0002
252 #define T30_FEATURE_BIT_ECM_64_BYTES 0x0004
253 #define T30_FEATURE_BIT_2D_CODING 0x0008
254 #define T30_FEATURE_BIT_T6_CODING 0x0010
255 #define T30_FEATURE_BIT_UNCOMPR_ENABLED 0x0020
256 #define T30_FEATURE_BIT_POLLING 0x0040
257
258 #define FAX_OBJECT_DOCU 1
259 #define FAX_OBJECT_PAGE 2
260 #define FAX_OBJECT_LINE 3
261
262 #define T4_EOL 0x800
263 #define T4_EOL_BITSIZE 12
264 #define T4_EOL_DWORD (T4_EOL << (32 - T4_EOL_BITSIZE))
265 #define T4_EOL_MASK_DWORD ((__u32) -1 << (32 - T4_EOL_BITSIZE))
266
267 #define SFF_LEN_FLD_SIZE 3
268
269 #define _DLE_ 0x10
270 #define _ETX_ 0x03
271
272 typedef struct eicon_sff_dochead {
273 __u32 id __attribute__ ((packed));
274 __u8 version __attribute__ ((packed));
275 __u8 reserved1 __attribute__ ((packed));
276 __u16 userinfo __attribute__ ((packed));
277 __u16 pagecount __attribute__ ((packed));
278 __u16 off1pagehead __attribute__ ((packed));
279 __u32 offnpagehead __attribute__ ((packed));
280 __u32 offdocend __attribute__ ((packed));
281 } eicon_sff_dochead;
282
283 typedef struct eicon_sff_pagehead {
284 __u8 pageheadid __attribute__ ((packed));
285 __u8 pageheadlen __attribute__ ((packed));
286 __u8 resvert __attribute__ ((packed));
287 __u8 reshoriz __attribute__ ((packed));
288 __u8 coding __attribute__ ((packed));
289 __u8 reserved2 __attribute__ ((packed));
290 __u16 linelength __attribute__ ((packed));
291 __u16 pagelength __attribute__ ((packed));
292 __u32 offprevpage __attribute__ ((packed));
293 __u32 offnextpage __attribute__ ((packed));
294 } eicon_sff_pagehead;
295
296 #endif /* DSP_H */
297
298