| [2] | 1 | #ifndef __LINUX_IXJUSER_H |
|---|
| 2 | #define __LINUX_IXJUSER_H |
|---|
| 3 | |
|---|
| 4 | /****************************************************************************** |
|---|
| 5 | * |
|---|
| 6 | * ixjuser.h |
|---|
| 7 | * |
|---|
| 8 | * Device Driver for Quicknet Technologies, Inc.'s Telephony cards |
|---|
| 9 | * including the Internet PhoneJACK, Internet PhoneJACK Lite, |
|---|
| 10 | * Internet PhoneJACK PCI, Internet LineJACK, Internet PhoneCARD and |
|---|
| 11 | * SmartCABLE |
|---|
| 12 | * |
|---|
| 13 | * (c) Copyright 1999-2001 Quicknet Technologies, Inc. |
|---|
| 14 | * |
|---|
| 15 | * This program is free software; you can redistribute it and/or |
|---|
| 16 | * modify it under the terms of the GNU General Public License |
|---|
| 17 | * as published by the Free Software Foundation; either version |
|---|
| 18 | * 2 of the License, or (at your option) any later version. |
|---|
| 19 | * |
|---|
| 20 | * Author: Ed Okerson, <eokerson@quicknet.net> |
|---|
| 21 | * |
|---|
| 22 | * Contributors: Greg Herlein, <gherlein@quicknet.net> |
|---|
| 23 | * David W. Erhart, <derhart@quicknet.net> |
|---|
| 24 | * John Sellers, <jsellers@quicknet.net> |
|---|
| 25 | * Mike Preston, <mpreston@quicknet.net> |
|---|
| 26 | * |
|---|
| 27 | * More information about the hardware related to this driver can be found |
|---|
| 28 | * at our website: http://www.quicknet.net |
|---|
| 29 | * |
|---|
| 30 | * Fixes: |
|---|
| 31 | * |
|---|
| 32 | * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR |
|---|
| 33 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
|---|
| 34 | * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET |
|---|
| 35 | * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 36 | * |
|---|
| 37 | * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES, |
|---|
| 38 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|---|
| 39 | * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
|---|
| 40 | * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION |
|---|
| 41 | * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|---|
| 42 | * |
|---|
| 43 | *****************************************************************************/ |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | #include <linux/telephony.h> |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | /****************************************************************************** |
|---|
| 50 | * |
|---|
| 51 | * IOCTL's used for the Quicknet Telephony Cards |
|---|
| 52 | * |
|---|
| 53 | * If you use the IXJCTL_TESTRAM command, the card must be power cycled to |
|---|
| 54 | * reset the SRAM values before futher use. |
|---|
| 55 | * |
|---|
| 56 | ******************************************************************************/ |
|---|
| 57 | |
|---|
| 58 | #define IXJCTL_DSP_RESET _IO ('q', 0xC0) |
|---|
| 59 | |
|---|
| 60 | #define IXJCTL_RING PHONE_RING |
|---|
| 61 | #define IXJCTL_HOOKSTATE PHONE_HOOKSTATE |
|---|
| 62 | #define IXJCTL_MAXRINGS PHONE_MAXRINGS |
|---|
| 63 | #define IXJCTL_RING_CADENCE PHONE_RING_CADENCE |
|---|
| 64 | #define IXJCTL_RING_START PHONE_RING_START |
|---|
| 65 | #define IXJCTL_RING_STOP PHONE_RING_STOP |
|---|
| 66 | |
|---|
| 67 | #define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int) |
|---|
| 68 | #define IXJCTL_SERIAL _IOR ('q', 0xC2, int) |
|---|
| 69 | #define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int) |
|---|
| 70 | #define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int) |
|---|
| 71 | #define IXJCTL_VERSION _IOR ('q', 0xDA, char *) |
|---|
| 72 | #define IXJCTL_DSP_IDLE _IO ('q', 0xC5) |
|---|
| 73 | #define IXJCTL_TESTRAM _IO ('q', 0xC6) |
|---|
| 74 | |
|---|
| 75 | /****************************************************************************** |
|---|
| 76 | * |
|---|
| 77 | * This group of IOCTLs deal with the record settings of the DSP |
|---|
| 78 | * |
|---|
| 79 | * The IXJCTL_REC_DEPTH command sets the internal buffer depth of the DSP. |
|---|
| 80 | * Setting a lower depth reduces latency, but increases the demand of the |
|---|
| 81 | * application to service the driver without frame loss. The DSP has 480 |
|---|
| 82 | * bytes of physical buffer memory for the record channel so the true |
|---|
| 83 | * maximum limit is determined by how many frames will fit in the buffer. |
|---|
| 84 | * |
|---|
| 85 | * 1 uncompressed (480 byte) 16-bit linear frame. |
|---|
| 86 | * 2 uncompressed (240 byte) 8-bit A-law/mu-law frames. |
|---|
| 87 | * 15 TrueSpeech 8.5 frames. |
|---|
| 88 | * 20 TrueSpeech 6.3,5.3,4.8 or 4.1 frames. |
|---|
| 89 | * |
|---|
| 90 | * The default in the driver is currently set to 2 frames. |
|---|
| 91 | * |
|---|
| 92 | * The IXJCTL_REC_VOLUME and IXJCTL_PLAY_VOLUME commands both use a Q8 |
|---|
| 93 | * number as a parameter, 0x100 scales the signal by 1.0, 0x200 scales the |
|---|
| 94 | * signal by 2.0, 0x80 scales the signal by 0.5. No protection is given |
|---|
| 95 | * against over-scaling, if the multiplication factor times the input |
|---|
| 96 | * signal exceeds 16 bits, overflow distortion will occur. The default |
|---|
| 97 | * setting is 0x100 (1.0). |
|---|
| 98 | * |
|---|
| 99 | * The IXJCTL_REC_LEVEL returns the average signal level (not r.m.s.) on |
|---|
| 100 | * the most recently recorded frame as a 16 bit value. |
|---|
| 101 | ******************************************************************************/ |
|---|
| 102 | |
|---|
| 103 | #define IXJCTL_REC_CODEC PHONE_REC_CODEC |
|---|
| 104 | #define IXJCTL_REC_START PHONE_REC_START |
|---|
| 105 | #define IXJCTL_REC_STOP PHONE_REC_STOP |
|---|
| 106 | #define IXJCTL_REC_DEPTH PHONE_REC_DEPTH |
|---|
| 107 | #define IXJCTL_FRAME PHONE_FRAME |
|---|
| 108 | #define IXJCTL_REC_VOLUME PHONE_REC_VOLUME |
|---|
| 109 | #define IXJCTL_REC_LEVEL PHONE_REC_LEVEL |
|---|
| 110 | |
|---|
| 111 | typedef enum { |
|---|
| 112 | f300_640 = 4, f300_500, f1100, f350, f400, f480, f440, f620, f20_50, |
|---|
| 113 | f133_200, f300, f300_420, f330, f300_425, f330_440, f340, f350_400, |
|---|
| 114 | f350_440, f350_450, f360, f380_420, f392, f400_425, f400_440, f400_450, |
|---|
| 115 | f420, f425, f425_450, f425_475, f435, f440_450, f440_480, f445, f450, |
|---|
| 116 | f452, f475, f480_620, f494, f500, f520, f523, f525, f540_660, f587, |
|---|
| 117 | f590, f600, f660, f700, f740, f750, f750_1450, f770, f800, f816, f850, |
|---|
| 118 | f857_1645, f900, f900_1300, f935_1215, f941_1477, f942, f950, f950_1400, |
|---|
| 119 | f975, f1000, f1020, f1050, f1100_1750, f1140, f1200, f1209, f1330, f1336, |
|---|
| 120 | lf1366, f1380, f1400, f1477, f1600, f1633_1638, f1800, f1860 |
|---|
| 121 | } IXJ_FILTER_FREQ; |
|---|
| 122 | |
|---|
| 123 | typedef struct { |
|---|
| 124 | unsigned int filter; |
|---|
| 125 | IXJ_FILTER_FREQ freq; |
|---|
| 126 | char enable; |
|---|
| 127 | } IXJ_FILTER; |
|---|
| 128 | |
|---|
| 129 | typedef struct { |
|---|
| 130 | char enable; |
|---|
| 131 | char en_filter; |
|---|
| 132 | unsigned int filter; |
|---|
| 133 | unsigned int on1; |
|---|
| 134 | unsigned int off1; |
|---|
| 135 | unsigned int on2; |
|---|
| 136 | unsigned int off2; |
|---|
| 137 | unsigned int on3; |
|---|
| 138 | unsigned int off3; |
|---|
| 139 | } IXJ_FILTER_CADENCE; |
|---|
| 140 | |
|---|
| 141 | #define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *) |
|---|
| 142 | #define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *) |
|---|
| 143 | #define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int) |
|---|
| 144 | #define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *) |
|---|
| 145 | #define IXJCTL_PLAY_CID _IO ('q', 0xD7) |
|---|
| 146 | /****************************************************************************** |
|---|
| 147 | * |
|---|
| 148 | * This IOCTL allows you to reassign values in the tone index table. The |
|---|
| 149 | * tone table has 32 entries (0 - 31), but the driver only allows entries |
|---|
| 150 | * 13 - 27 to be modified, entry 0 is reserved for silence and 1 - 12 are |
|---|
| 151 | * the standard DTMF digits and 28 - 31 are the DTMF tones for A, B, C & D. |
|---|
| 152 | * The positions used internally for Call Progress Tones are as follows: |
|---|
| 153 | * Dial Tone - 25 |
|---|
| 154 | * Ring Back - 26 |
|---|
| 155 | * Busy Signal - 27 |
|---|
| 156 | * |
|---|
| 157 | * The freq values are calculated as: |
|---|
| 158 | * freq = cos(2 * PI * frequency / 8000) |
|---|
| 159 | * |
|---|
| 160 | * The most commonly needed values are already calculated and listed in the |
|---|
| 161 | * enum IXJ_TONE_FREQ. Each tone index can have two frequencies with |
|---|
| 162 | * different gains, if you are only using a single frequency set the unused |
|---|
| 163 | * one to 0. |
|---|
| 164 | * |
|---|
| 165 | * The gain values range from 0 to 15 indicating +6dB to -24dB in 2dB |
|---|
| 166 | * increments. |
|---|
| 167 | * |
|---|
| 168 | ******************************************************************************/ |
|---|
| 169 | |
|---|
| 170 | typedef enum { |
|---|
| 171 | hz20 = 0x7ffa, |
|---|
| 172 | hz50 = 0x7fe5, |
|---|
| 173 | hz133 = 0x7f4c, |
|---|
| 174 | hz200 = 0x7e6b, |
|---|
| 175 | hz261 = 0x7d50, /* .63 C1 */ |
|---|
| 176 | hz277 = 0x7cfa, /* .18 CS1 */ |
|---|
| 177 | hz293 = 0x7c9f, /* .66 D1 */ |
|---|
| 178 | hz300 = 0x7c75, |
|---|
| 179 | hz311 = 0x7c32, /* .13 DS1 */ |
|---|
| 180 | hz329 = 0x7bbf, /* .63 E1 */ |
|---|
| 181 | hz330 = 0x7bb8, |
|---|
| 182 | hz340 = 0x7b75, |
|---|
| 183 | hz349 = 0x7b37, /* .23 F1 */ |
|---|
| 184 | hz350 = 0x7b30, |
|---|
| 185 | hz360 = 0x7ae9, |
|---|
| 186 | hz369 = 0x7aa8, /* .99 FS1 */ |
|---|
| 187 | hz380 = 0x7a56, |
|---|
| 188 | hz392 = 0x79fa, /* .00 G1 */ |
|---|
| 189 | hz400 = 0x79bb, |
|---|
| 190 | hz415 = 0x7941, /* .30 GS1 */ |
|---|
| 191 | hz420 = 0x7918, |
|---|
| 192 | hz425 = 0x78ee, |
|---|
| 193 | hz435 = 0x7899, |
|---|
| 194 | hz440 = 0x786d, /* .00 A1 */ |
|---|
| 195 | hz445 = 0x7842, |
|---|
| 196 | hz450 = 0x7815, |
|---|
| 197 | hz452 = 0x7803, |
|---|
| 198 | hz466 = 0x7784, /* .16 AS1 */ |
|---|
| 199 | hz475 = 0x7731, |
|---|
| 200 | hz480 = 0x7701, |
|---|
| 201 | hz493 = 0x7685, /* .88 B1 */ |
|---|
| 202 | hz494 = 0x767b, |
|---|
| 203 | hz500 = 0x7640, |
|---|
| 204 | hz520 = 0x7578, |
|---|
| 205 | hz523 = 0x7559, /* .25 C2 */ |
|---|
| 206 | hz525 = 0x7544, |
|---|
| 207 | hz540 = 0x74a7, |
|---|
| 208 | hz554 = 0x7411, /* .37 CS2 */ |
|---|
| 209 | hz587 = 0x72a1, /* .33 D2 */ |
|---|
| 210 | hz590 = 0x727f, |
|---|
| 211 | hz600 = 0x720b, |
|---|
| 212 | hz620 = 0x711e, |
|---|
| 213 | hz622 = 0x7106, /* .25 DS2 */ |
|---|
| 214 | hz659 = 0x6f3b, /* .26 E2 */ |
|---|
| 215 | hz660 = 0x6f2e, |
|---|
| 216 | hz698 = 0x6d3d, /* .46 F2 */ |
|---|
| 217 | hz700 = 0x6d22, |
|---|
| 218 | hz739 = 0x6b09, /* .99 FS2 */ |
|---|
| 219 | hz740 = 0x6afa, |
|---|
| 220 | hz750 = 0x6a6c, |
|---|
| 221 | hz770 = 0x694b, |
|---|
| 222 | hz783 = 0x688b, /* .99 G2 */ |
|---|
| 223 | hz800 = 0x678d, |
|---|
| 224 | hz816 = 0x6698, |
|---|
| 225 | hz830 = 0x65bf, /* .61 GS2 */ |
|---|
| 226 | hz850 = 0x6484, |
|---|
| 227 | hz857 = 0x6414, |
|---|
| 228 | hz880 = 0x629f, /* .00 A2 */ |
|---|
| 229 | hz900 = 0x6154, |
|---|
| 230 | hz932 = 0x5f35, /* .33 AS2 */ |
|---|
| 231 | hz935 = 0x5f01, |
|---|
| 232 | hz941 = 0x5e9a, |
|---|
| 233 | hz942 = 0x5e88, |
|---|
| 234 | hz950 = 0x5dfd, |
|---|
| 235 | hz975 = 0x5c44, |
|---|
| 236 | hz1000 = 0x5a81, |
|---|
| 237 | hz1020 = 0x5912, |
|---|
| 238 | hz1050 = 0x56e2, |
|---|
| 239 | hz1100 = 0x5320, |
|---|
| 240 | hz1140 = 0x5007, |
|---|
| 241 | hz1200 = 0x4b3b, |
|---|
| 242 | hz1209 = 0x4a80, |
|---|
| 243 | hz1215 = 0x4a02, |
|---|
| 244 | hz1250 = 0x471c, |
|---|
| 245 | hz1300 = 0x42e0, |
|---|
| 246 | hz1330 = 0x4049, |
|---|
| 247 | hz1336 = 0x3fc4, |
|---|
| 248 | hz1366 = 0x3d22, |
|---|
| 249 | hz1380 = 0x3be4, |
|---|
| 250 | hz1400 = 0x3a1b, |
|---|
| 251 | hz1450 = 0x3596, |
|---|
| 252 | hz1477 = 0x331c, |
|---|
| 253 | hz1500 = 0x30fb, |
|---|
| 254 | hz1600 = 0x278d, |
|---|
| 255 | hz1633 = 0x2462, |
|---|
| 256 | hz1638 = 0x23e7, |
|---|
| 257 | hz1645 = 0x233a, |
|---|
| 258 | hz1750 = 0x18f8, |
|---|
| 259 | hz1800 = 0x1405, |
|---|
| 260 | hz1860 = 0xe0b, |
|---|
| 261 | hz2100 = 0xf5f6, |
|---|
| 262 | hz2130 = 0xf2f5, |
|---|
| 263 | hz2450 = 0xd3b3, |
|---|
| 264 | hz2750 = 0xb8e4 |
|---|
| 265 | } IXJ_FREQ; |
|---|
| 266 | |
|---|
| 267 | typedef enum { |
|---|
| 268 | C1 = hz261, |
|---|
| 269 | CS1 = hz277, |
|---|
| 270 | D1 = hz293, |
|---|
| 271 | DS1 = hz311, |
|---|
| 272 | E1 = hz329, |
|---|
| 273 | F1 = hz349, |
|---|
| 274 | FS1 = hz369, |
|---|
| 275 | G1 = hz392, |
|---|
| 276 | GS1 = hz415, |
|---|
| 277 | A1 = hz440, |
|---|
| 278 | AS1 = hz466, |
|---|
| 279 | B1 = hz493, |
|---|
| 280 | C2 = hz523, |
|---|
| 281 | CS2 = hz554, |
|---|
| 282 | D2 = hz587, |
|---|
| 283 | DS2 = hz622, |
|---|
| 284 | E2 = hz659, |
|---|
| 285 | F2 = hz698, |
|---|
| 286 | FS2 = hz739, |
|---|
| 287 | G2 = hz783, |
|---|
| 288 | GS2 = hz830, |
|---|
| 289 | A2 = hz880, |
|---|
| 290 | AS2 = hz932 |
|---|
| 291 | } IXJ_NOTE; |
|---|
| 292 | |
|---|
| 293 | typedef struct { |
|---|
| 294 | int tone_index; |
|---|
| 295 | int freq0; |
|---|
| 296 | int gain0; |
|---|
| 297 | int freq1; |
|---|
| 298 | int gain1; |
|---|
| 299 | } IXJ_TONE; |
|---|
| 300 | |
|---|
| 301 | #define IXJCTL_INIT_TONE _IOW ('q', 0xC9, IXJ_TONE *) |
|---|
| 302 | |
|---|
| 303 | /****************************************************************************** |
|---|
| 304 | * |
|---|
| 305 | * The IXJCTL_TONE_CADENCE ioctl defines tone sequences used for various |
|---|
| 306 | * Call Progress Tones (CPT). This is accomplished by setting up an array of |
|---|
| 307 | * IXJ_CADENCE_ELEMENT structures that sequentially define the states of |
|---|
| 308 | * the tone sequence. The tone_on_time and tone_off time are in |
|---|
| 309 | * 250 microsecond intervals. A pointer to this array is passed to the |
|---|
| 310 | * driver as the ce element of an IXJ_CADENCE structure. The elements_used |
|---|
| 311 | * must be set to the number of IXJ_CADENCE_ELEMENTS in the array. The |
|---|
| 312 | * termination variable defines what to do at the end of a cadence, the |
|---|
| 313 | * options are to play the cadence once and stop, to repeat the last |
|---|
| 314 | * element of the cadence indefinitely, or to repeat the entire cadence |
|---|
| 315 | * indefinitely. The ce variable is a pointer to the array of IXJ_TONE |
|---|
| 316 | * structures. If the freq0 variable is non-zero, the tone table contents |
|---|
| 317 | * for the tone_index are updated to the frequencies and gains defined. It |
|---|
| 318 | * should be noted that DTMF tones cannot be reassigned, so if DTMF tone |
|---|
| 319 | * table indexs are used in a cadence the frequency and gain variables will |
|---|
| 320 | * be ignored. |
|---|
| 321 | * |
|---|
| 322 | * If the array elements contain frequency parameters the driver will |
|---|
| 323 | * initialize the needed tone table elements and begin playing the tone, |
|---|
| 324 | * there is no preset limit on the number of elements in the cadence. If |
|---|
| 325 | * there is more than one frequency used in the cadence, sequential elements |
|---|
| 326 | * of different frequencies MUST use different tone table indexes. Only one |
|---|
| 327 | * cadence can be played at a time. It is possible to build complex |
|---|
| 328 | * cadences with multiple frequencies using 2 tone table indexes by |
|---|
| 329 | * alternating between them. |
|---|
| 330 | * |
|---|
| 331 | ******************************************************************************/ |
|---|
| 332 | |
|---|
| 333 | typedef struct { |
|---|
| 334 | int index; |
|---|
| 335 | int tone_on_time; |
|---|
| 336 | int tone_off_time; |
|---|
| 337 | int freq0; |
|---|
| 338 | int gain0; |
|---|
| 339 | int freq1; |
|---|
| 340 | int gain1; |
|---|
| 341 | } IXJ_CADENCE_ELEMENT; |
|---|
| 342 | |
|---|
| 343 | typedef enum { |
|---|
| 344 | PLAY_ONCE, |
|---|
| 345 | REPEAT_LAST_ELEMENT, |
|---|
| 346 | REPEAT_ALL |
|---|
| 347 | } IXJ_CADENCE_TERM; |
|---|
| 348 | |
|---|
| 349 | typedef struct { |
|---|
| 350 | int elements_used; |
|---|
| 351 | IXJ_CADENCE_TERM termination; |
|---|
| 352 | IXJ_CADENCE_ELEMENT *ce; |
|---|
| 353 | } IXJ_CADENCE; |
|---|
| 354 | |
|---|
| 355 | #define IXJCTL_TONE_CADENCE _IOW ('q', 0xCA, IXJ_CADENCE *) |
|---|
| 356 | /****************************************************************************** |
|---|
| 357 | * |
|---|
| 358 | * This group of IOCTLs deal with the playback settings of the DSP |
|---|
| 359 | * |
|---|
| 360 | ******************************************************************************/ |
|---|
| 361 | |
|---|
| 362 | #define IXJCTL_PLAY_CODEC PHONE_PLAY_CODEC |
|---|
| 363 | #define IXJCTL_PLAY_START PHONE_PLAY_START |
|---|
| 364 | #define IXJCTL_PLAY_STOP PHONE_PLAY_STOP |
|---|
| 365 | #define IXJCTL_PLAY_DEPTH PHONE_PLAY_DEPTH |
|---|
| 366 | #define IXJCTL_PLAY_VOLUME PHONE_PLAY_VOLUME |
|---|
| 367 | #define IXJCTL_PLAY_LEVEL PHONE_PLAY_LEVEL |
|---|
| 368 | |
|---|
| 369 | /****************************************************************************** |
|---|
| 370 | * |
|---|
| 371 | * This group of IOCTLs deal with the Acoustic Echo Cancellation settings |
|---|
| 372 | * of the DSP |
|---|
| 373 | * |
|---|
| 374 | * Issuing the IXJCTL_AEC_START command with a value of AEC_OFF has the |
|---|
| 375 | * same effect as IXJCTL_AEC_STOP. This is to simplify slider bar |
|---|
| 376 | * controls. IXJCTL_AEC_GET_LEVEL returns the current setting of the AEC. |
|---|
| 377 | ******************************************************************************/ |
|---|
| 378 | #define IXJCTL_AEC_START _IOW ('q', 0xCB, int) |
|---|
| 379 | #define IXJCTL_AEC_STOP _IO ('q', 0xCC) |
|---|
| 380 | #define IXJCTL_AEC_GET_LEVEL _IO ('q', 0xCD) |
|---|
| 381 | |
|---|
| 382 | #define AEC_OFF 0 |
|---|
| 383 | #define AEC_LOW 1 |
|---|
| 384 | #define AEC_MED 2 |
|---|
| 385 | #define AEC_HIGH 3 |
|---|
| 386 | #define AEC_AUTO 4 |
|---|
| 387 | #define AEC_AGC 5 |
|---|
| 388 | /****************************************************************************** |
|---|
| 389 | * |
|---|
| 390 | * Call Progress Tones, DTMF, etc. |
|---|
| 391 | * IXJCTL_DTMF_OOB determines if DTMF signaling is sent as Out-Of-Band |
|---|
| 392 | * only. If you pass a 1, DTMF is suppressed from the audio stream. |
|---|
| 393 | * Tone on and off times are in 250 microsecond intervals so |
|---|
| 394 | * ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360); |
|---|
| 395 | * will set the tone on time of board ixj1 to 360 * 250us = 90ms |
|---|
| 396 | * the default values of tone on and off times is 840 or 210ms |
|---|
| 397 | ******************************************************************************/ |
|---|
| 398 | |
|---|
| 399 | #define IXJCTL_DTMF_READY PHONE_DTMF_READY |
|---|
| 400 | #define IXJCTL_GET_DTMF PHONE_GET_DTMF |
|---|
| 401 | #define IXJCTL_GET_DTMF_ASCII PHONE_GET_DTMF_ASCII |
|---|
| 402 | #define IXJCTL_DTMF_OOB PHONE_DTMF_OOB |
|---|
| 403 | #define IXJCTL_EXCEPTION PHONE_EXCEPTION |
|---|
| 404 | #define IXJCTL_PLAY_TONE PHONE_PLAY_TONE |
|---|
| 405 | #define IXJCTL_SET_TONE_ON_TIME PHONE_SET_TONE_ON_TIME |
|---|
| 406 | #define IXJCTL_SET_TONE_OFF_TIME PHONE_SET_TONE_OFF_TIME |
|---|
| 407 | #define IXJCTL_GET_TONE_ON_TIME PHONE_GET_TONE_ON_TIME |
|---|
| 408 | #define IXJCTL_GET_TONE_OFF_TIME PHONE_GET_TONE_OFF_TIME |
|---|
| 409 | #define IXJCTL_GET_TONE_STATE PHONE_GET_TONE_STATE |
|---|
| 410 | #define IXJCTL_BUSY PHONE_BUSY |
|---|
| 411 | #define IXJCTL_RINGBACK PHONE_RINGBACK |
|---|
| 412 | #define IXJCTL_DIALTONE PHONE_DIALTONE |
|---|
| 413 | #define IXJCTL_CPT_STOP PHONE_CPT_STOP |
|---|
| 414 | |
|---|
| 415 | /****************************************************************************** |
|---|
| 416 | * LineJACK specific IOCTLs |
|---|
| 417 | * |
|---|
| 418 | * The lsb 4 bits of the LED argument represent the state of each of the 4 |
|---|
| 419 | * LED's on the LineJACK |
|---|
| 420 | ******************************************************************************/ |
|---|
| 421 | |
|---|
| 422 | #define IXJCTL_SET_LED _IOW ('q', 0xCE, int) |
|---|
| 423 | #define IXJCTL_MIXER _IOW ('q', 0xCF, int) |
|---|
| 424 | |
|---|
| 425 | /****************************************************************************** |
|---|
| 426 | * |
|---|
| 427 | * The master volume controls use attenuation with 32 levels from 0 to -62dB |
|---|
| 428 | * with steps of 2dB each, the defines should be OR'ed together then sent |
|---|
| 429 | * as the parameter to the mixer command to change the mixer settings. |
|---|
| 430 | * |
|---|
| 431 | ******************************************************************************/ |
|---|
| 432 | #define MIXER_MASTER_L 0x0000 |
|---|
| 433 | #define MIXER_MASTER_R 0x0100 |
|---|
| 434 | #define ATT00DB 0x00 |
|---|
| 435 | #define ATT02DB 0x01 |
|---|
| 436 | #define ATT04DB 0x02 |
|---|
| 437 | #define ATT06DB 0x03 |
|---|
| 438 | #define ATT08DB 0x04 |
|---|
| 439 | #define ATT10DB 0x05 |
|---|
| 440 | #define ATT12DB 0x06 |
|---|
| 441 | #define ATT14DB 0x07 |
|---|
| 442 | #define ATT16DB 0x08 |
|---|
| 443 | #define ATT18DB 0x09 |
|---|
| 444 | #define ATT20DB 0x0A |
|---|
| 445 | #define ATT22DB 0x0B |
|---|
| 446 | #define ATT24DB 0x0C |
|---|
| 447 | #define ATT26DB 0x0D |
|---|
| 448 | #define ATT28DB 0x0E |
|---|
| 449 | #define ATT30DB 0x0F |
|---|
| 450 | #define ATT32DB 0x10 |
|---|
| 451 | #define ATT34DB 0x11 |
|---|
| 452 | #define ATT36DB 0x12 |
|---|
| 453 | #define ATT38DB 0x13 |
|---|
| 454 | #define ATT40DB 0x14 |
|---|
| 455 | #define ATT42DB 0x15 |
|---|
| 456 | #define ATT44DB 0x16 |
|---|
| 457 | #define ATT46DB 0x17 |
|---|
| 458 | #define ATT48DB 0x18 |
|---|
| 459 | #define ATT50DB 0x19 |
|---|
| 460 | #define ATT52DB 0x1A |
|---|
| 461 | #define ATT54DB 0x1B |
|---|
| 462 | #define ATT56DB 0x1C |
|---|
| 463 | #define ATT58DB 0x1D |
|---|
| 464 | #define ATT60DB 0x1E |
|---|
| 465 | #define ATT62DB 0x1F |
|---|
| 466 | #define MASTER_MUTE 0x80 |
|---|
| 467 | |
|---|
| 468 | /****************************************************************************** |
|---|
| 469 | * |
|---|
| 470 | * The input volume controls use gain with 32 levels from +12dB to -50dB |
|---|
| 471 | * with steps of 2dB each, the defines should be OR'ed together then sent |
|---|
| 472 | * as the parameter to the mixer command to change the mixer settings. |
|---|
| 473 | * |
|---|
| 474 | ******************************************************************************/ |
|---|
| 475 | #define MIXER_PORT_CD_L 0x0600 |
|---|
| 476 | #define MIXER_PORT_CD_R 0x0700 |
|---|
| 477 | #define MIXER_PORT_LINE_IN_L 0x0800 |
|---|
| 478 | #define MIXER_PORT_LINE_IN_R 0x0900 |
|---|
| 479 | #define MIXER_PORT_POTS_REC 0x0C00 |
|---|
| 480 | #define MIXER_PORT_MIC 0x0E00 |
|---|
| 481 | |
|---|
| 482 | #define GAIN12DB 0x00 |
|---|
| 483 | #define GAIN10DB 0x01 |
|---|
| 484 | #define GAIN08DB 0x02 |
|---|
| 485 | #define GAIN06DB 0x03 |
|---|
| 486 | #define GAIN04DB 0x04 |
|---|
| 487 | #define GAIN02DB 0x05 |
|---|
| 488 | #define GAIN00DB 0x06 |
|---|
| 489 | #define GAIN_02DB 0x07 |
|---|
| 490 | #define GAIN_04DB 0x08 |
|---|
| 491 | #define GAIN_06DB 0x09 |
|---|
| 492 | #define GAIN_08DB 0x0A |
|---|
| 493 | #define GAIN_10DB 0x0B |
|---|
| 494 | #define GAIN_12DB 0x0C |
|---|
| 495 | #define GAIN_14DB 0x0D |
|---|
| 496 | #define GAIN_16DB 0x0E |
|---|
| 497 | #define GAIN_18DB 0x0F |
|---|
| 498 | #define GAIN_20DB 0x10 |
|---|
| 499 | #define GAIN_22DB 0x11 |
|---|
| 500 | #define GAIN_24DB 0x12 |
|---|
| 501 | #define GAIN_26DB 0x13 |
|---|
| 502 | #define GAIN_28DB 0x14 |
|---|
| 503 | #define GAIN_30DB 0x15 |
|---|
| 504 | #define GAIN_32DB 0x16 |
|---|
| 505 | #define GAIN_34DB 0x17 |
|---|
| 506 | #define GAIN_36DB 0x18 |
|---|
| 507 | #define GAIN_38DB 0x19 |
|---|
| 508 | #define GAIN_40DB 0x1A |
|---|
| 509 | #define GAIN_42DB 0x1B |
|---|
| 510 | #define GAIN_44DB 0x1C |
|---|
| 511 | #define GAIN_46DB 0x1D |
|---|
| 512 | #define GAIN_48DB 0x1E |
|---|
| 513 | #define GAIN_50DB 0x1F |
|---|
| 514 | #define INPUT_MUTE 0x80 |
|---|
| 515 | |
|---|
| 516 | /****************************************************************************** |
|---|
| 517 | * |
|---|
| 518 | * The POTS volume control use attenuation with 8 levels from 0dB to -28dB |
|---|
| 519 | * with steps of 4dB each, the defines should be OR'ed together then sent |
|---|
| 520 | * as the parameter to the mixer command to change the mixer settings. |
|---|
| 521 | * |
|---|
| 522 | ******************************************************************************/ |
|---|
| 523 | #define MIXER_PORT_POTS_PLAY 0x0F00 |
|---|
| 524 | |
|---|
| 525 | #define POTS_ATT_00DB 0x00 |
|---|
| 526 | #define POTS_ATT_04DB 0x01 |
|---|
| 527 | #define POTS_ATT_08DB 0x02 |
|---|
| 528 | #define POTS_ATT_12DB 0x03 |
|---|
| 529 | #define POTS_ATT_16DB 0x04 |
|---|
| 530 | #define POTS_ATT_20DB 0x05 |
|---|
| 531 | #define POTS_ATT_24DB 0x06 |
|---|
| 532 | #define POTS_ATT_28DB 0x07 |
|---|
| 533 | #define POTS_MUTE 0x80 |
|---|
| 534 | |
|---|
| 535 | /****************************************************************************** |
|---|
| 536 | * |
|---|
| 537 | * The DAA controls the interface to the PSTN port. The driver loads the |
|---|
| 538 | * US coefficients by default, so if you live in a different country you |
|---|
| 539 | * need to load the set for your countries phone system. |
|---|
| 540 | * |
|---|
| 541 | ******************************************************************************/ |
|---|
| 542 | #define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD0, int) |
|---|
| 543 | |
|---|
| 544 | #define DAA_US 1 /*PITA 8kHz */ |
|---|
| 545 | #define DAA_UK 2 /*ISAR34 8kHz */ |
|---|
| 546 | #define DAA_FRANCE 3 /* */ |
|---|
| 547 | #define DAA_GERMANY 4 |
|---|
| 548 | #define DAA_AUSTRALIA 5 |
|---|
| 549 | #define DAA_JAPAN 6 |
|---|
| 550 | |
|---|
| 551 | /****************************************************************************** |
|---|
| 552 | * |
|---|
| 553 | * Use IXJCTL_PORT to set or query the port the card is set to. If the |
|---|
| 554 | * argument is set to PORT_QUERY, the return value of the ioctl will |
|---|
| 555 | * indicate which port is currently in use, otherwise it will change the |
|---|
| 556 | * port. |
|---|
| 557 | * |
|---|
| 558 | ******************************************************************************/ |
|---|
| 559 | #define IXJCTL_PORT _IOW ('q', 0xD1, int) |
|---|
| 560 | |
|---|
| 561 | #define PORT_QUERY 0 |
|---|
| 562 | #define PORT_POTS 1 |
|---|
| 563 | #define PORT_PSTN 2 |
|---|
| 564 | #define PORT_SPEAKER 3 |
|---|
| 565 | #define PORT_HANDSET 4 |
|---|
| 566 | |
|---|
| 567 | #define IXJCTL_PSTN_SET_STATE PHONE_PSTN_SET_STATE |
|---|
| 568 | #define IXJCTL_PSTN_GET_STATE PHONE_PSTN_GET_STATE |
|---|
| 569 | |
|---|
| 570 | #define PSTN_ON_HOOK 0 |
|---|
| 571 | #define PSTN_RINGING 1 |
|---|
| 572 | #define PSTN_OFF_HOOK 2 |
|---|
| 573 | #define PSTN_PULSE_DIAL 3 |
|---|
| 574 | |
|---|
| 575 | /****************************************************************************** |
|---|
| 576 | * |
|---|
| 577 | * The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR), |
|---|
| 578 | * and the transmit gain (AGX). OR together the components and pass them |
|---|
| 579 | * as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB. |
|---|
| 580 | * |
|---|
| 581 | ******************************************************************************/ |
|---|
| 582 | #define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int) |
|---|
| 583 | |
|---|
| 584 | #define AGRR00DB 0x00 /* Analog gain in receive direction 0dB */ |
|---|
| 585 | #define AGRR3_5DB 0x10 /* Analog gain in receive direction 3.5dB */ |
|---|
| 586 | #define AGRR06DB 0x30 /* Analog gain in receive direction 6dB */ |
|---|
| 587 | |
|---|
| 588 | #define AGX00DB 0x00 /* Analog gain in transmit direction 0dB */ |
|---|
| 589 | #define AGX_6DB 0x04 /* Analog gain in transmit direction -6dB */ |
|---|
| 590 | #define AGX3_5DB 0x08 /* Analog gain in transmit direction 3.5dB */ |
|---|
| 591 | #define AGX_2_5B 0x0C /* Analog gain in transmit direction -2.5dB */ |
|---|
| 592 | |
|---|
| 593 | #define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3) |
|---|
| 594 | |
|---|
| 595 | #define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *) |
|---|
| 596 | #define IXJCTL_VMWI _IOR ('q', 0xD8, int) |
|---|
| 597 | #define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *) |
|---|
| 598 | /****************************************************************************** |
|---|
| 599 | * |
|---|
| 600 | * The wink duration is tunable with this ioctl. The default wink duration |
|---|
| 601 | * is 320ms. You do not need to use this ioctl if you do not require a |
|---|
| 602 | * different wink duration. |
|---|
| 603 | * |
|---|
| 604 | ******************************************************************************/ |
|---|
| 605 | #define IXJCTL_WINK_DURATION PHONE_WINK_DURATION |
|---|
| 606 | |
|---|
| 607 | /****************************************************************************** |
|---|
| 608 | * |
|---|
| 609 | * This ioctl will connect the POTS port to the PSTN port on the LineJACK |
|---|
| 610 | * In order for this to work properly the port selection should be set to |
|---|
| 611 | * the PSTN port with IXJCTL_PORT prior to calling this ioctl. This will |
|---|
| 612 | * enable conference calls between PSTN callers and network callers. |
|---|
| 613 | * Passing a 1 to this ioctl enables the POTS<->PSTN connection while |
|---|
| 614 | * passing a 0 turns it back off. |
|---|
| 615 | * |
|---|
| 616 | ******************************************************************************/ |
|---|
| 617 | #define IXJCTL_POTS_PSTN _IOW ('q', 0xD5, int) |
|---|
| 618 | |
|---|
| 619 | /****************************************************************************** |
|---|
| 620 | * |
|---|
| 621 | * IOCTLs added by request. |
|---|
| 622 | * |
|---|
| 623 | * IXJCTL_HZ sets the value your Linux kernel uses for HZ as defined in |
|---|
| 624 | * /usr/include/asm/param.h, this determines the fundamental |
|---|
| 625 | * frequency of the clock ticks on your Linux system. The kernel |
|---|
| 626 | * must be rebuilt if you change this value, also all modules you |
|---|
| 627 | * use (except this one) must be recompiled. The default value |
|---|
| 628 | * is 100, and you only need to use this IOCTL if you use some |
|---|
| 629 | * other value. |
|---|
| 630 | * |
|---|
| 631 | * |
|---|
| 632 | * IXJCTL_RATE sets the number of times per second that the driver polls |
|---|
| 633 | * the DSP. This value cannot be larger than HZ. By |
|---|
| 634 | * increasing both of these values, you may be able to reduce |
|---|
| 635 | * latency because the max hang time that can exist between the |
|---|
| 636 | * driver and the DSP will be reduced. |
|---|
| 637 | * |
|---|
| 638 | ******************************************************************************/ |
|---|
| 639 | |
|---|
| 640 | #define IXJCTL_HZ _IOW ('q', 0xE0, int) |
|---|
| 641 | #define IXJCTL_RATE _IOW ('q', 0xE1, int) |
|---|
| 642 | #define IXJCTL_FRAMES_READ _IOR ('q', 0xE2, unsigned long) |
|---|
| 643 | #define IXJCTL_FRAMES_WRITTEN _IOR ('q', 0xE3, unsigned long) |
|---|
| 644 | #define IXJCTL_READ_WAIT _IOR ('q', 0xE4, unsigned long) |
|---|
| 645 | #define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long) |
|---|
| 646 | #define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long) |
|---|
| 647 | #define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7) |
|---|
| 648 | #define IXJCTL_DTMF_PRESCALE _IOW ('q', 0xE8, int) |
|---|
| 649 | |
|---|
| 650 | /****************************************************************************** |
|---|
| 651 | * |
|---|
| 652 | * This ioctl allows the user application to control what events the driver |
|---|
| 653 | * will send signals for, and what signals it will send for which event. |
|---|
| 654 | * By default, if signaling is enabled, all events will send SIGIO when |
|---|
| 655 | * they occur. To disable signals for an event set the signal to 0. |
|---|
| 656 | * |
|---|
| 657 | ******************************************************************************/ |
|---|
| 658 | typedef enum { |
|---|
| 659 | SIG_DTMF_READY, |
|---|
| 660 | SIG_HOOKSTATE, |
|---|
| 661 | SIG_FLASH, |
|---|
| 662 | SIG_PSTN_RING, |
|---|
| 663 | SIG_CALLER_ID, |
|---|
| 664 | SIG_PSTN_WINK, |
|---|
| 665 | SIG_F0, SIG_F1, SIG_F2, SIG_F3, |
|---|
| 666 | SIG_FC0, SIG_FC1, SIG_FC2, SIG_FC3, |
|---|
| 667 | SIG_READ_READY = 33, |
|---|
| 668 | SIG_WRITE_READY = 34 |
|---|
| 669 | } IXJ_SIGEVENT; |
|---|
| 670 | |
|---|
| 671 | typedef struct { |
|---|
| 672 | unsigned int event; |
|---|
| 673 | int signal; |
|---|
| 674 | } IXJ_SIGDEF; |
|---|
| 675 | |
|---|
| 676 | #define IXJCTL_SIGCTL _IOW ('q', 0xE9, IXJ_SIGDEF *) |
|---|
| 677 | |
|---|
| 678 | /****************************************************************************** |
|---|
| 679 | * |
|---|
| 680 | * These ioctls allow the user application to change the gain in the |
|---|
| 681 | * Smart Cable of the Internet Phone Card. Sending -1 as a value will cause |
|---|
| 682 | * return value to be the current setting. Valid values to set are 0x00 - 0x1F |
|---|
| 683 | * |
|---|
| 684 | * 11111 = +12 dB |
|---|
| 685 | * 10111 = 0 dB |
|---|
| 686 | * 00000 = -34.5 dB |
|---|
| 687 | * |
|---|
| 688 | * IXJCTL_SC_RXG sets the Receive gain |
|---|
| 689 | * IXJCTL_SC_TXG sets the Transmit gain |
|---|
| 690 | * |
|---|
| 691 | ******************************************************************************/ |
|---|
| 692 | #define IXJCTL_SC_RXG _IOW ('q', 0xEA, int) |
|---|
| 693 | #define IXJCTL_SC_TXG _IOW ('q', 0xEB, int) |
|---|
| 694 | |
|---|
| 695 | /****************************************************************************** |
|---|
| 696 | * |
|---|
| 697 | * The intercom IOCTL's short the output from one card to the input of the |
|---|
| 698 | * other and vice versa (actually done in the DSP read function). It is only |
|---|
| 699 | * necessary to execute the IOCTL on one card, but it is necessary to have |
|---|
| 700 | * both devices open to be able to detect hook switch changes. The record |
|---|
| 701 | * codec and rate of each card must match the playback codec and rate of |
|---|
| 702 | * the other card for this to work properly. |
|---|
| 703 | * |
|---|
| 704 | ******************************************************************************/ |
|---|
| 705 | |
|---|
| 706 | #define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int) |
|---|
| 707 | #define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int) |
|---|
| 708 | |
|---|
| 709 | /****************************************************************************** |
|---|
| 710 | * |
|---|
| 711 | * new structure for accessing raw filter information |
|---|
| 712 | * |
|---|
| 713 | ******************************************************************************/ |
|---|
| 714 | |
|---|
| 715 | typedef struct { |
|---|
| 716 | unsigned int filter; |
|---|
| 717 | char enable; |
|---|
| 718 | unsigned int coeff[19]; |
|---|
| 719 | } IXJ_FILTER_RAW; |
|---|
| 720 | |
|---|
| 721 | #endif |
|---|