1 /******************************************************************************
4 Revision 1.6 1999/12/01 05:25:58 markster
7 Revision 1.1 1999/12/01 05:25:58 markster
8 Start on the Internet Phone Jack channel
10 Revision 3.0 1999/11/18 22:21:43 root
11 Added isapnp kernel module support.
13 Revision 2.5 1999/11/09 15:42:06 root
14 Fixed convert code for older PhoneJACK cards.
15 Fixed G723.1 5.3 record bug.
17 Revision 2.4 1999/11/02 20:17:20 root
18 Fixed hookswitch bug for PhoneJACK
19 Added filter exception bit code.
21 Revision 2.3 1999/11/01 23:22:02 root
22 Added tone cadence generation.
23 Fixed hookswitch detection when PORT != POTS
24 Fixed ringing when PORT != POTS
26 Revision 2.2 1999/10/13 05:33:31 root
30 Revision 2.1 1999/10/11 19:29:46 root
31 Enhanced PSTN ring detection
32 Added Caller ID recognition
35 Revision 2.0 1999/09/18 03:29:15 root
37 Enhanced mixer functions
38 Fixed LineJACK and PhoneJACK Lite not reporting second IO range in p/proc/ioports
39 Added DSP Volume controls
41 Revision 1.23 1999/08/16 16:37:27 root
42 Added drybuffer ioctls
45 Revision 1.22 1999/08/14 05:15:58 root
46 Fixed select timeout problems. Was using the wrong wait queues.
48 Revision 1.21 1999/08/04 22:53:43 root
51 Revision 1.20 1999/07/28 20:32:23 root
52 Added non-blocking rings
55 Revision 1.19 1999/07/14 21:08:10 root
58 Revision 1.18 1999/07/14 21:03:33 root
61 Revision 1.17 1999/07/12 20:20:00 root
62 Continuing work on 20ms and 10ms linear modes.
64 Revision 1.16 1999/07/09 19:13:50 root
65 Added IXJCTL_RATE to set the rate the DSP is polled.
66 Added 20ms and 10ms linear modes for LineJack and PhoneJack Lite.
68 Revision 1.15 1999/07/08 02:21:20 root
69 Async Notification on hookswitch changes.
70 Added IXJ_EXCEPTION bitfield structure for select exception sets
71 Added IXJCTL_DTMFASCII ioctl
73 Revision 1.14 1999/07/06 23:20:52 root
74 *** empty log message ***
76 Revision 1.14 1999/07/06 21:48:38 root
77 Fixed lockups in linear modes during write.
79 Revision 1.13 1999/06/28 18:30:44 root
80 Added buffer depth commands to reduce latency in compressed modes.
82 Revision 1.12 1999/06/25 21:03:18 root
83 Close device properly.
84 Started Mixer code for LineJack
86 Revision 1.11 1999/06/24 21:51:21 root
89 Revision 1.10 1999/06/17 18:23:16 root
90 Added tone generation.
91 Fixed LineJack hookswitch again.
93 Revision 1.9 1999/06/09 14:18:15 root
94 Fixed duplicate IOCTL numbers
96 Revision 1.8 1999/06/09 14:13:29 root
97 Added DTMF Recognition with Async Notification
99 Revision 1.7 1999/06/03 16:50:43 root
100 Added IXJCTL_HZ to allow changing the HZ value the driver uses.
102 Revision 1.6 1999/05/31 17:56:07 root
103 All linear modes now work properly.
105 Revision 1.5 1999/05/25 14:05:44 root
106 Added multiple codec selections.
108 Revision 1.4 1999/04/28 03:43:52 root
109 More work on echo cancellation
111 Revision 1.3 1999/04/27 17:17:12 root
114 Revision 1.2 1999/04/22 11:43:52 root
115 Fixed stability problems
117 Revision 1.1 1999/03/25 21:52:42 root
121 * IOCTL's used for the Quicknet Cards
123 * If you use the IXJCTL_TESTRAM command, the card must be power cycled to
124 * reset the SRAM values before futher use.
126 ******************************************************************************/
127 static char ixjuser_h_rcsid[] = "$Id$";
129 #define IXJCTL_DSP_RESET _IO ('q', 0x80)
130 #define IXJCTL_RING _IO ('q', 0x82)
131 #define IXJCTL_HOOKSTATE _IO ('q', 0x83)
132 #define IXJCTL_MAXRINGS _IOW ('q', 0x84, char)
133 #define IXJCTL_RING_CADENCE _IOW ('q', 0x85, short)
134 #define IXJCTL_RING_START _IO ('q', 0x86)
135 #define IXJCTL_RING_STOP _IO ('q', 0x87)
136 #define IXJCTL_CARDTYPE _IOR ('q', 0x88, int)
137 #define IXJCTL_DSP_TYPE _IOR ('q', 0x8C, int)
138 #define IXJCTL_DSP_VERSION _IOR ('q', 0x8D, int)
139 #define IXJCTL_DSP_IDLE _IO ('q', 0x8E)
140 #define IXJCTL_TESTRAM _IO ('q', 0x8F)
142 /******************************************************************************
144 * This group of IOCTLs deal with the record settings of the DSP
146 * The IXJCTL_REC_DEPTH command sets the internal buffer depth of the DSP.
147 * Setting a lower depth reduces latency, but increases the demand of the
148 * application to service the driver without frame loss. The DSP has 480
149 * bytes of physical buffer memory for the record channel so the true
150 * maximum limit is determined by how many frames will fit in the buffer.
152 * 1 uncompressed (480 byte) 16-bit linear frame.
153 * 2 uncompressed (240 byte) 8-bit A-law/mu-law frames.
154 * 15 TrueSpeech 8.5 frames.
155 * 20 TrueSpeech 6.3,5.3,4.8 or 4.1 frames.
157 * The default in the driver is currently set to 2 frames.
159 * The IXJCTL_REC_VOLUME and IXJCTL_PLAY_VOLUME commands both use a Q8
160 * number as a parameter, 0x100 scales the signal by 1.0, 0x200 scales the
161 * signal by 2.0, 0x80 scales the signal by 0.5. No protection is given
162 * against over-scaling, if the multiplication factor times the input
163 * signal exceeds 16 bits, overflow distortion will occur. The default
164 * setting is 0x100 (1.0).
166 * The IXJCTL_REC_LEVEL returns the average signal level (not r.m.s.) on
167 * the most recently recorded frame as a 16 bit value.
168 ******************************************************************************/
170 #define IXJCTL_REC_CODEC _IOW ('q', 0x90, int)
171 #define IXJCTL_REC_START _IO ('q', 0x92)
172 #define IXJCTL_REC_STOP _IO ('q', 0x93)
173 #define IXJCTL_REC_DEPTH _IOW ('q', 0x94, int)
174 #define IXJCTL_FRAME _IOW ('q', 0x95, int)
175 #define IXJCTL_REC_VOLUME _IOW ('q', 0x96, int)
176 #define IXJCTL_REC_LEVEL _IO ('q', 0x97)
179 f300_640 = 4, f300_500, f1100, f350, f400, f480, f440, f620, f20_50,
180 f133_200, f300, f300_420, f330, f300_425, f330_440, f340, f350_400,
181 f350_440, f350_450, f360, f380_420, f392, f400_425, f400_440, f400_450,
182 f420, f425, f425_450, f425_475, f435, f440_450, f440_480, f445, f450,
183 f452, f475, f480_620, f494, f500, f520, f523, f525, f540_660, f587,
184 f590, f600, f660, f700, f740, f750, f750_1450, f770, f800, f816, f850,
185 f857_1645, f900, f900_1300, f935_1215, f941_1477, f942, f950, f950_1400,
186 f975, f1000, f1020, f1050, f1100_1750, f1140, f1200, f1209, f1330, f1336,
187 lf1366, f1380, f1400, f1477, f1600, f1633_1638, f1800, f1860
193 IXJ_FILTER_FREQ freq;
197 #define IXJCTL_SET_FILTER _IOW ('q', 0x98, IXJ_FILTER *)
198 #define IXJCTL_GET_FILTER_HIST _IOW ('q', 0x9B, int)
199 /******************************************************************************
201 * This IOCTL allows you to reassign values in the tone index table. The
202 * tone table has 32 entries (0 - 31), but the driver only allows entries
203 * 13 - 27 to be modified, entry 0 is reserved for silence and 1 - 12 are
204 * the standard DTMF digits and 28 - 31 are the DTMF tones for A, B, C & D.
205 * The positions used internally for Call Progress Tones are as follows:
210 * The freq values are calculated as:
211 * freq = cos(2 * PI * frequency / 8000)
213 * The most commonly needed values are already calculated and listed in the
214 * enum IXJ_TONE_FREQ. Each tone index can have two frequencies with
215 * different gains, if you are only using a single frequency set the unused
218 * The gain values range from 0 to 15 indicating +6dB to -24dB in 2dB
221 ******************************************************************************/
229 hz261 = 0x7d50, /* .63 C1 */
230 hz277 = 0x7cfa, /* .18 CS1 */
231 hz293 = 0x7c9f, /* .66 D1 */
233 hz311 = 0x7c32, /* .13 DS1 */
234 hz329 = 0x7bbf, /* .63 E1 */
237 hz349 = 0x7b37, /* .23 F1 */
240 hz369 = 0x7aa8, /* .99 FS1 */
242 hz392 = 0x79fa, /* .00 G1 */
244 hz415 = 0x7941, /* .30 GS1 */
248 hz440 = 0x786d, /* .00 A1 */
252 hz466 = 0x7784, /* .16 AS1 */
255 hz493 = 0x7685, /* .88 B1 */
259 hz523 = 0x7559, /* .25 C2 */
262 hz554 = 0x7411, /* .37 CS2 */
263 hz587 = 0x72a1, /* .33 D2 */
267 hz622 = 0x7106, /* .25 DS2 */
268 hz659 = 0x6f3b, /* .26 E2 */
270 hz698 = 0x6d3d, /* .46 F2 */
272 hz739 = 0x6b09, /* .99 FS2 */
276 hz783 = 0x688b, /* .99 G2 */
279 hz830 = 0x65bf, /* .61 GS2 */
282 hz880 = 0x629f, /* .00 A2 */
284 hz932 = 0x5f35, /* .33 AS2 */
355 #define IXJCTL_INIT_TONE _IOW ('q', 0x99, IXJ_TONE *)
357 /******************************************************************************
359 * The IXJCTL_TONE_CADENCE ioctl defines tone sequences used for various
360 * Call Progress Tones (CPT). This is accomplished by setting up an array of
361 * IXJ_CADENCE_ELEMENT structures that sequentially define the states of
362 * the tone sequence. The tone_on_time and tone_off time are in
363 * 250 microsecond intervals. A pointer to this array is passed to the
364 * driver as the ce element of an IXJ_CADENCE structure. The elements_used
365 * must be set to the number of IXJ_CADENCE_ELEMENTS in the array. The
366 * termination variable defines what to do at the end of a cadence, the
367 * options are to play the cadence once and stop, to repeat the last
368 * element of the cadence indefinatly, or to repeat the entire cadence
369 * indefinatly. The ce variable is a pointer to the array of IXJ_TONE
370 * structures. If the freq0 variable is non-zero, the tone table contents
371 * for the tone_index are updated to the frequencies and gains defined. It
372 * should be noted that DTMF tones cannot be reassigned, so if DTMF tone
373 * table indexs are used in a cadence the frequency and gain variables will
376 * If the array elements contain frequency parameters the driver will
377 * initialize the needed tone table elements and begin playing the tone,
378 * there is no preset limit on the number of elements in the cadence. If
379 * there is more than one frequency used in the cadence, sequential elements
380 * of different frequencies MUST use different tone table indexes. Only one
381 * cadence can be played at a time. It is possible to build complex
382 * cadences with multiple frequencies using 2 tone table indexes by
383 * alternating between them.
385 ******************************************************************************/
396 }IXJ_CADENCE_ELEMENT;
408 IXJ_CADENCE_TERM termination;
409 IXJ_CADENCE_ELEMENT *ce;
412 #define IXJCTL_TONE_CADENCE _IOW ('q', 0x9A, IXJ_CADENCE *)
413 /******************************************************************************
415 * This group of IOCTLs deal with the playback settings of the DSP
417 ******************************************************************************/
419 #define IXJCTL_PLAY_CODEC _IOW ('q', 0xA0, int)
420 #define IXJCTL_PLAY_START _IO ('q', 0xA2)
421 #define IXJCTL_PLAY_STOP _IO ('q', 0xA3)
422 #define IXJCTL_PLAY_DEPTH _IOW ('q', 0xA4, int)
423 #define IXJCTL_PLAY_VOLUME _IOW ('q', 0xA5, int)
424 #define IXJCTL_PLAY_LEVEL _IO ('q', 0xA6)
426 /******************************************************************************
428 * This group of IOCTLs deal with the Acoustic Echo Cancellation settings
431 * Issueing the IXJCTL_AEC_START command with a value of AEC_OFF has the
432 * same effect as IXJCTL_AEC_STOP. This is to simplify slider bar
434 ******************************************************************************/
435 #define IXJCTL_AEC_START _IOW ('q', 0xB0, int)
436 #define IXJCTL_AEC_STOP _IO ('q', 0xB1)
442 /******************************************************************************
444 * Call Progress Tones, DTMF, etc.
445 * Tone on and off times are in 250 microsecond intervals so
446 * ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360);
447 * will set the tone on time of board ixj1 to 360 * 250us = 90ms
448 * the default values of tone on and off times is 840 or 210ms
449 ******************************************************************************/
451 #define IXJCTL_DTMF_READY _IOR ('q', 0xC0, int)
452 #define IXJCTL_GET_DTMF _IOR ('q', 0xC1, int)
453 #define IXJCTL_GET_DTMF_ASCII _IOR ('q', 0xC2, int)
454 #define IXJCTL_EXCEPTION _IOR ('q', 0xC4, int)
455 #define IXJCTL_PLAY_TONE _IOW ('q', 0xC6, char)
456 #define IXJCTL_SET_TONE_ON_TIME _IOW ('q', 0xC7, int)
457 #define IXJCTL_SET_TONE_OFF_TIME _IOW ('q', 0xC8, int)
458 #define IXJCTL_GET_TONE_ON_TIME _IO ('q', 0xC9)
459 #define IXJCTL_GET_TONE_OFF_TIME _IO ('q', 0xCA)
460 #define IXJCTL_GET_TONE_STATE _IO ('q', 0xCB)
461 #define IXJCTL_BUSY _IO ('q', 0xCC)
462 #define IXJCTL_RINGBACK _IO ('q', 0xCD)
463 #define IXJCTL_DIALTONE _IO ('q', 0xCE)
465 // This IOCTL replaced both IXJCTL_BUSY_STOP and IXJCTL_RINGBACK_STOP and
466 // should be used from now on to stop all Call Progress Tones. It will
467 // actually abort any tone, regardless of time left in the tone_on_time
468 // and tone_off_time counters.
469 #define IXJCTL_CPT_STOP _IO ('q', 0xCF)
471 /******************************************************************************
472 * LineJack specific IOCTLs
474 * The lsb 4 bits of the LED argument represent the state of each of the 4
475 * LED's on the LineJack
476 ******************************************************************************/
478 #define IXJCTL_SET_LED _IOW ('q', 0xD0, int)
479 #define IXJCTL_MIXER _IOW ('q', 0xD1, int)
481 /******************************************************************************
483 * The master volume controls use attenuation with 32 levels from 0 to -62dB
484 * with steps of 2dB each, the defines should be OR'ed together then sent
485 * as the parameter to the mixer command to change the mixer settings.
487 ******************************************************************************/
488 #define MIXER_MASTER_L 0x0100
489 #define MIXER_MASTER_R 0x0200
522 #define MASTER_MUTE 0x80
524 /******************************************************************************
526 * The input volume controls use gain with 32 levels from +12dB to -50dB
527 * with steps of 2dB each, the defines should be OR'ed together then sent
528 * as the parameter to the mixer command to change the mixer settings.
530 ******************************************************************************/
531 #define MIXER_PORT_CD_L 0x0600
532 #define MIXER_PORT_CD_R 0x0700
533 #define MIXER_PORT_LINE_IN_L 0x0800
534 #define MIXER_PORT_LINE_IN_R 0x0900
535 #define MIXER_PORT_POTS_REC 0x0C00
536 #define MIXER_PORT_MIC 0x0E00
538 #define GAIN12DB 0x00
539 #define GAIN10DB 0x01
540 #define GAIN08DB 0x02
541 #define GAIN06DB 0x03
542 #define GAIN04DB 0x04
543 #define GAIN02DB 0x05
544 #define GAIN00DB 0x06
545 #define GAIN_02DB 0x07
546 #define GAIN_04DB 0x08
547 #define GAIN_06DB 0x09
548 #define GAIN_08DB 0x0A
549 #define GAIN_10DB 0x0B
550 #define GAIN_12DB 0x0C
551 #define GAIN_14DB 0x0D
552 #define GAIN_16DB 0x0E
553 #define GAIN_18DB 0x0F
554 #define GAIN_20DB 0x10
555 #define GAIN_22DB 0x11
556 #define GAIN_24DB 0x12
557 #define GAIN_26DB 0x13
558 #define GAIN_28DB 0x14
559 #define GAIN_30DB 0x15
560 #define GAIN_32DB 0x16
561 #define GAIN_34DB 0x17
562 #define GAIN_36DB 0x18
563 #define GAIN_38DB 0x19
564 #define GAIN_40DB 0x1A
565 #define GAIN_42DB 0x1B
566 #define GAIN_44DB 0x1C
567 #define GAIN_46DB 0x1D
568 #define GAIN_48DB 0x1E
569 #define GAIN_50DB 0x1F
570 #define INPUT_MUTE 0x80
572 /******************************************************************************
574 * The POTS volume control use attenuation with 8 levels from 0dB to -28dB
575 * with steps of 4dB each, the defines should be OR'ed together then sent
576 * as the parameter to the mixer command to change the mixer settings.
578 ******************************************************************************/
579 #define MIXER_PORT_POTS_PLAY 0x0F00
581 #define POTS_ATT_00DB 0x00
582 #define POTS_ATT_04DB 0x01
583 #define POTS_ATT_08DB 0x02
584 #define POTS_ATT_12DB 0x03
585 #define POTS_ATT_16DB 0x04
586 #define POTS_ATT_20DB 0x05
587 #define POTS_ATT_24DB 0x06
588 #define POTS_ATT_28DB 0x07
589 #define POTS_MUTE 0x80
591 /******************************************************************************
593 * The DAA controls the interface to the PSTN port. The driver loads the
594 * US coefficients by default, so if you live in a different country you
595 * need to load the set for your countries phone system.
597 ******************************************************************************/
598 #define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD2, int)
600 #define DAA_US 1 //PITA 8kHz
601 #define DAA_UK 2 //ISAR34 8kHz
602 #define DAA_FRANCE 3 //
603 #define DAA_GERMANY 4
604 #define DAA_AUSTRALIA 5
607 /******************************************************************************
609 * Use IXJCTL_PORT to set or query the port the card is set to. If the
610 * argument is set to PORT_QUERY, the return value of the ioctl will
611 * indicate which port is currently in use, otherwise it will change the
614 ******************************************************************************/
615 #define IXJCTL_PORT _IOW ('q', 0xD3, int)
620 #define PORT_SPEAKER 3
621 #define PORT_HANDSET 4
623 #define IXJCTL_PSTN_SET_STATE _IOW ('q', 0xD4, int)
624 #define IXJCTL_PSTN_GET_STATE _IO ('q', 0xD5)
626 #define PSTN_ON_HOOK 0
627 #define PSTN_RINGING 1
628 #define PSTN_OFF_HOOK 2
629 #define PSTN_PULSE_DIAL 3
631 /******************************************************************************
633 * The DAA Analog GAIN sets 2 parameters at one time, the recieve gain (AGRR),
634 * and the transmit gain (AGX). OR together the components and pass them
635 * as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB.
637 ******************************************************************************/
638 #define IXJCTL_DAA_AGAIN _IOW ('q', 0xD6, int)
640 #define AGRR00DB 0x00 // Analog gain in recieve direction 0dB
641 #define AGRR3_5DB 0x10 // Analog gain in recieve direction 3.5dB
642 #define AGRR06DB 0x30 // Analog gain in recieve direction 6dB
644 #define AGX00DB 0x00 // Analog gain in transmit direction 0dB
645 #define AGX_6DB 0x04 // Analog gain in transmit direction -6dB
646 #define AGX3_5DB 0x08 // Analog gain in transmit direction 3.5dB
647 #define AGX_2_5B 0x0C // Analog gain in transmit direction -2.5dB
649 #define IXJCTL_PSTN_LINETEST _IO ('q', 0xD7)
663 #define IXJCTL_CID _IOR ('q', 0xD8, IXJ_CID *)
664 /******************************************************************************
666 * The wink duration is tunable with this ioctl. The default wink duration
667 * is 320ms. You do not need to use this ioctl if you do not require a
668 * different wink duration.
670 ******************************************************************************/
671 #define IXJCTL_WINK_DURATION _IOW ('q', 0xD9, int)
673 /******************************************************************************
675 * This ioctl will connect the POTS port to the PSTN port on the LineJACK
676 * In order for this to work properly the port selection should be set to
677 * the PSTN port with IXJCTL_PORT prior to calling this ioctl. This will
678 * enable conference calls between PSTN callers and network callers.
679 * Passing a 1 to this ioctl enables the POTS<->PSTN connection while
680 * passing a 0 turns it back off.
682 ******************************************************************************/
683 #define IXJCTL_POTS_PSTN _IOW ('q', 0xDA, int)
685 /******************************************************************************
687 * IOCTLs added by request.
689 * IXJCTL_HZ sets the value your Linux kernel uses for HZ as defined in
690 * /usr/include/asm/param.h, this determines the fundamental
691 * frequency of the clock ticks on your Linux system. The kernel
692 * must be rebuilt if you change this value, also all modules you
693 * use (except this one) must be recompiled. The default value
694 * is 100, and you only need to use this IOCTL if you use some
698 * IXJCTL_RATE sets the number of times per second that the driver polls
699 * the DSP. This value cannot be larger than HZ. By
700 * increasing both of these values, you may be able to reduce
701 * latency because the max hang time that can exist between the
702 * driver and the DSP will be reduced.
704 ******************************************************************************/
706 #define IXJCTL_HZ _IOW ('q', 0xE0, int)
707 #define IXJCTL_RATE _IOW ('q', 0xE1, int)
708 #define IXJCTL_FRAMES_READ _IOR ('q', 0xE2, unsigned long)
709 #define IXJCTL_FRAMES_WRITTEN _IOR ('q', 0xE3, unsigned long)
710 #define IXJCTL_READ_WAIT _IOR ('q', 0xE4, unsigned long)
711 #define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long)
712 #define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long)
713 #define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7)
715 /******************************************************************************
717 * The defined CODECs that can be used with the IXJCTL_REC_CODEC and
718 * IXJ_PLAY_CODEC IOCTLs.
720 * PCM uLaw mode is a "pass through" mode.
722 * 16 bit linear data is signed integer (2's complement form), positive
723 * full scale is 7FFFH, negative full scale is 8000H, zero is 0000H
725 * 8 bit linear data is signed byte (2's complement form), positive
726 * full scale is 7FH, negative full scale is 80H, zero is 00H
728 * 8 bit linear WSS data is unsigned byte, positive full scale is FFH,
729 * negative full scale is 00H, zero is 80H. This is the format used for
730 * 8-bit WAVE format data (Windows Sound System). Data can be converted
731 * between the two 8-bit formats by simply inverting the ms bit.
733 * G729 currently works most reliably with 10ms frames. Use 20ms and 30ms
734 * at your own risk. If you really need larger frame sizes you can
735 * concatenate multiple 10ms frames.
737 ******************************************************************************/
738 typedef enum{ // Bytes per 30ms audio frame
741 TS85 = 3, // 32 Does not currently work on LineJack
744 G728 = 6, // 96 LineJack only!
745 G729 = 7, // 30 LineJack only!
747 ALAW = 9, // 240 not implemented DO NOT USE!
752 /******************************************************************************
754 * The intercom IOCTL's short the output from one card to the input of the
755 * other and vice versa (actually done in the DSP read function). It is only
756 * necessary to execute the IOCTL on one card, but it is necessary to have
757 * both devices open to be able to detect hook switch changes. The record
758 * codec and rate of each card must match the playback codec and rate of
759 * the other card for this to work properly.
761 ******************************************************************************/
763 #define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int)
764 #define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int)
766 /******************************************************************************
768 * This IOCTL will decrement the module usage counter so you can force
769 * the module to unload after a program bombs.
771 ******************************************************************************/
773 #define IXJCTL_MODRESET _IO ('q', 0xFF)
775 /******************************************************************************
777 * Various Defines used for the Quicknet Cards
779 ******************************************************************************/
781 #define SYNC_MODE_CODEC 0
782 #define SYNC_MODE_DATA 1
783 #define SYNC_MODE_POLL 2
784 #define SYNC_MODE_HOST 3
786 #define RECORD_SYNC_MODE 0x5100
787 #define PLAYBACK_SYNC_MODE 0x5200
789 #define USA_RING_CADENCE 0xC0C0
791 /******************************************************************************
793 * The exception structure allows us to multiplex multiple events onto the
794 * select() exception set. If any of these flags are set select() will
795 * return with a positive indication on the exception set. The dtmf_ready
796 * bit indicates if there is data waiting in the DTMF buffer. The
797 * hookstate bit is set if there is a change in hookstate status, it does not
798 * indicate the current state of the hookswitch. The pstn_ring bit
799 * indicates that the DAA on a LineJACK card has detected ring voltage on
800 * the PSTN port. The caller_id bit indicates that caller_id data has been
801 * recieved and is available. The pstn_wink bit indicates that the DAA on
802 * the LineJACK has recieved a wink from the telco switch. The f0, f1, f2
803 * and f3 bits indicate that the filter has been triggered by detecting the
804 * frequency programmed into that filter.
806 ******************************************************************************/
810 unsigned int dtmf_ready:1;
811 unsigned int hookstate:1;
812 unsigned int pstn_ring:1;
813 unsigned int caller_id:1;
814 unsigned int pstn_wink:1;
819 unsigned int reserved:23;