source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/telephony.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 8.9 KB
Line 
1/******************************************************************************
2 *
3 *              telephony.h
4 *
5 *              Basic Linux Telephony Interface
6 *
7 *              (c) Copyright 1999-2001 Quicknet Technologies, Inc.
8 *
9 *              This program is free software; you can redistribute it and/or
10 *              modify it under the terms of the GNU General Public License
11 *              as published by the Free Software Foundation; either version
12 *              2 of the License, or (at your option) any later version.
13 *
14 *    Authors:       Ed Okerson, <eokerson@quicknet.net>
15 *                   Greg Herlein, <gherlein@quicknet.net>
16 *
17 *    Contributors:  Alan Cox, <alan@redhat.com>
18 *                   David W. Erhart, <derhart@quicknet.net>
19 *
20 * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
21 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
22 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
23 * TECHNOLOGIES, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
26 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
28 * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
29 * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
30 *
31 * Version:       $Revision: 1.2 $
32 *
33 *
34 *****************************************************************************/
35
36#ifndef TELEPHONY_H
37#define TELEPHONY_H
38
39#define TELEPHONY_VERSION 3013
40
41#define PHONE_VENDOR_IXJ          1
42#define PHONE_VENDOR_QUICKNET     PHONE_VENDOR_IXJ
43#define PHONE_VENDOR_VOICETRONIX  2
44#define PHONE_VENDOR_ACULAB       3
45#define PHONE_VENDOR_DIGI         4
46#define PHONE_VENDOR_FRANKLIN     5
47
48/******************************************************************************
49 *  Vendor Summary Information Area
50 *
51 *  Quicknet Technologies, Inc. - makes low density analog telephony cards
52 *    with audio compression, POTS and PSTN interfaces (www.quicknet.net)
53 *
54 *  (other vendors following this API shuld add a short description of
55 *  the telephony products they support under Linux)
56 *
57 *****************************************************************************/
58#define QTI_PHONEJACK           100
59#define QTI_LINEJACK            300
60#define QTI_PHONEJACK_LITE      400
61#define QTI_PHONEJACK_PCI       500
62#define QTI_PHONECARD           600
63
64/******************************************************************************
65*
66* The capabilities ioctls can inform you of the capabilities of each phone
67* device installed in your system.  The PHONECTL_CAPABILITIES ioctl
68* returns an integer value indicating the number of capabilities the   
69* device has.  The PHONECTL_CAPABILITIES_LIST will fill an array of
70* capability structs with all of its capabilities.  The
71* PHONECTL_CAPABILITIES_CHECK takes a single capability struct and returns
72* a TRUE if the device has that capability, otherwise it returns false.
73*
74******************************************************************************/
75typedef enum {
76        vendor = 0,
77        device,
78        port,
79        codec,
80        dsp
81} phone_cap;
82
83struct phone_capability {
84        char desc[80];
85        phone_cap captype;
86        int cap;
87        int handle;
88};
89
90typedef enum {
91        pots = 0,
92        pstn,
93        handset,
94        speaker
95} phone_ports;
96
97#define PHONE_CAPABILITIES              _IO  ('q', 0x80)
98#define PHONE_CAPABILITIES_LIST         _IOR ('q', 0x81, struct phone_capability *)
99#define PHONE_CAPABILITIES_CHECK        _IOW ('q', 0x82, struct phone_capability *)
100
101typedef struct {
102        char month[3];
103        char day[3];
104        char hour[3];
105        char min[3];
106        int numlen;
107        char number[11];
108        int namelen;
109        char name[80];
110} PHONE_CID;
111 
112#define PHONE_RING                      _IO  ('q', 0x83)
113#define PHONE_HOOKSTATE                 _IO  ('q', 0x84)
114#define PHONE_MAXRINGS                  _IOW ('q', 0x85, char)
115#define PHONE_RING_CADENCE              _IOW ('q', 0x86, short)
116#define OLD_PHONE_RING_START            _IO  ('q', 0x87)
117#define PHONE_RING_START                _IOW ('q', 0x87, PHONE_CID *)
118#define PHONE_RING_STOP                 _IO  ('q', 0x88)
119
120#define USA_RING_CADENCE         0xC0C0
121
122#define PHONE_REC_CODEC                 _IOW ('q', 0x89, int)
123#define PHONE_REC_START                 _IO  ('q', 0x8A)
124#define PHONE_REC_STOP                  _IO  ('q', 0x8B)
125#define PHONE_REC_DEPTH                 _IOW ('q', 0x8C, int)
126#define PHONE_FRAME                     _IOW ('q', 0x8D, int)
127#define PHONE_REC_VOLUME                _IOW ('q', 0x8E, int)
128#define PHONE_REC_VOLUME_LINEAR         _IOW ('q', 0xDB, int)
129#define PHONE_REC_LEVEL                 _IO  ('q', 0x8F)
130
131#define PHONE_PLAY_CODEC                _IOW ('q', 0x90, int)
132#define PHONE_PLAY_START                _IO  ('q', 0x91)
133#define PHONE_PLAY_STOP                 _IO  ('q', 0x92)
134#define PHONE_PLAY_DEPTH                _IOW ('q', 0x93, int)
135#define PHONE_PLAY_VOLUME               _IOW ('q', 0x94, int)
136#define PHONE_PLAY_VOLUME_LINEAR        _IOW ('q', 0xDC, int)
137#define PHONE_PLAY_LEVEL                _IO  ('q', 0x95)
138#define PHONE_DTMF_READY                _IOR ('q', 0x96, int)
139#define PHONE_GET_DTMF                  _IOR ('q', 0x97, int)
140#define PHONE_GET_DTMF_ASCII            _IOR ('q', 0x98, int)
141#define PHONE_DTMF_OOB                  _IOW ('q', 0x99, int)
142#define PHONE_EXCEPTION                 _IOR ('q', 0x9A, int)
143#define PHONE_PLAY_TONE                 _IOW ('q', 0x9B, char)
144#define PHONE_SET_TONE_ON_TIME          _IOW ('q', 0x9C, int)
145#define PHONE_SET_TONE_OFF_TIME         _IOW ('q', 0x9D, int)
146#define PHONE_GET_TONE_ON_TIME          _IO  ('q', 0x9E)
147#define PHONE_GET_TONE_OFF_TIME         _IO  ('q', 0x9F)
148#define PHONE_GET_TONE_STATE            _IO  ('q', 0xA0)
149#define PHONE_BUSY                      _IO  ('q', 0xA1)
150#define PHONE_RINGBACK                  _IO  ('q', 0xA2)
151#define PHONE_DIALTONE                  _IO  ('q', 0xA3)
152#define PHONE_CPT_STOP                  _IO  ('q', 0xA4)
153
154#define PHONE_PSTN_SET_STATE            _IOW ('q', 0xA4, int)
155#define PHONE_PSTN_GET_STATE            _IO  ('q', 0xA5)
156
157#define PSTN_ON_HOOK            0
158#define PSTN_RINGING            1
159#define PSTN_OFF_HOOK           2
160#define PSTN_PULSE_DIAL         3
161
162/******************************************************************************
163*
164* The wink duration is tunable with this ioctl.  The default wink duration 
165* is 320ms.  You do not need to use this ioctl if you do not require a
166* different wink duration.
167*
168******************************************************************************/
169#define PHONE_WINK_DURATION             _IOW ('q', 0xA6, int)
170#define PHONE_WINK                      _IOW ('q', 0xAA, int)
171
172/******************************************************************************
173*
174*  Codec Definitions
175*
176******************************************************************************/
177typedef enum {
178        G723_63 = 1,
179        G723_53 = 2,
180        TS85 = 3,
181        TS48 = 4,
182        TS41 = 5,
183        G728 = 6,
184        G729 = 7,
185        ULAW = 8,
186        ALAW = 9,
187        LINEAR16 = 10,
188        LINEAR8 = 11,
189        WSS = 12,
190        G729B = 13
191} phone_codec;
192
193struct phone_codec_data
194{
195        phone_codec type;
196        unsigned short buf_min, buf_opt, buf_max;
197};
198
199#define PHONE_QUERY_CODEC               _IOWR ('q', 0xA7, struct phone_codec_data *)
200#define PHONE_PSTN_LINETEST             _IO ('q', 0xA8)
201
202/******************************************************************************
203*
204* This controls the VAD/CNG functionality of G.723.1.  The driver will
205* always pass full size frames, any unused bytes will be padded with zeros,
206* and frames passed to the driver should also be padded with zeros.  The
207* frame type is encoded in the least significant two bits of the first
208* WORD of the frame as follows:
209*
210* bits 1-0      Frame Type      Data Rate               Significant Words
211* 00            0               G.723.1 6.3             12
212* 01            1               G.723.1 5.3             10
213* 10            2               VAD/CNG                  2
214* 11            3               Repeat last CNG          2 bits
215*
216******************************************************************************/
217#define PHONE_VAD                       _IOW ('q', 0xA9, int)
218
219
220/******************************************************************************
221*
222* The exception structure allows us to multiplex multiple events onto the
223* select() exception set.  If any of these flags are set select() will
224* return with a positive indication on the exception set.  The dtmf_ready
225* bit indicates if there is data waiting in the DTMF buffer.  The
226* hookstate bit is set if there is a change in hookstate status, it does not
227* indicate the current state of the hookswitch.  The pstn_ring bit
228* indicates that the DAA on a LineJACK card has detected ring voltage on
229* the PSTN port.  The caller_id bit indicates that caller_id data has been
230* received and is available.  The pstn_wink bit indicates that the DAA on
231* the LineJACK has received a wink from the telco switch.  The f0, f1, f2
232* and f3 bits indicate that the filter has been triggered by detecting the
233* frequency programmed into that filter.
234*
235* The remaining bits should be set to zero. They will become defined over time
236* for other interface cards and their needs.
237*
238******************************************************************************/
239struct phone_except
240{
241        unsigned int dtmf_ready:1;
242        unsigned int hookstate:1;
243        unsigned int pstn_ring:1;
244        unsigned int caller_id:1;
245        unsigned int pstn_wink:1;
246        unsigned int f0:1;
247        unsigned int f1:1;
248        unsigned int f2:1;
249        unsigned int f3:1;
250        unsigned int flash:1;
251        unsigned int fc0:1;
252        unsigned int fc1:1;
253        unsigned int fc2:1;
254        unsigned int fc3:1;
255        unsigned int reserved:18;
256};
257
258union telephony_exception {
259        struct phone_except bits;
260        unsigned int bytes;
261};
262
263
264#endif          /* TELEPHONY_H */
265
Note: See TracBrowser for help on using the repository browser.