| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 2 | **************************************************************************** | 
|  | 3 | *** | 
|  | 4 | ***   This header was automatically generated from a Linux kernel header | 
|  | 5 | ***   of the same name, to make information necessary for userspace to | 
|  | 6 | ***   call into the kernel available to libc.  It contains only constants, | 
|  | 7 | ***   structures, and macros generated from the original header, and thus, | 
|  | 8 | ***   contains no copyrightable information. | 
|  | 9 | *** | 
|  | 10 | ***   To edit the content of this header, modify the corresponding | 
|  | 11 | ***   source file (e.g. under external/kernel-headers/original/) then | 
|  | 12 | ***   run bionic/libc/kernel/tools/update_all.py | 
|  | 13 | *** | 
|  | 14 | ***   Any manual change here will be lost the next time this script will | 
|  | 15 | ***   be run. You've been warned! | 
|  | 16 | *** | 
|  | 17 | **************************************************************************** | 
|  | 18 | ****************************************************************************/ | 
|  | 19 | #ifndef TELEPHONY_H | 
|  | 20 | #define TELEPHONY_H | 
|  | 21 | #define TELEPHONY_VERSION 3013 | 
|  | 22 | #define PHONE_VENDOR_IXJ 1 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ | 
|  | 24 | #define PHONE_VENDOR_VOICETRONIX 2 | 
|  | 25 | #define PHONE_VENDOR_ACULAB 3 | 
|  | 26 | #define PHONE_VENDOR_DIGI 4 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define PHONE_VENDOR_FRANKLIN 5 | 
|  | 28 | #define QTI_PHONEJACK 100 | 
|  | 29 | #define QTI_LINEJACK 300 | 
|  | 30 | #define QTI_PHONEJACK_LITE 400 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define QTI_PHONEJACK_PCI 500 | 
|  | 32 | #define QTI_PHONECARD 600 | 
|  | 33 | typedef enum { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 34 | vendor = 0, | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | device, | 
|  | 36 | port, | 
|  | 37 | codec, | 
|  | 38 | dsp | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | } phone_cap; | 
|  | 40 | struct phone_capability { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | char desc[80]; | 
|  | 42 | phone_cap captype; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | int cap; | 
|  | 44 | int handle; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | }; | 
|  | 46 | typedef enum { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | pots = 0, | 
|  | 48 | pstn, | 
|  | 49 | handset, | 
|  | 50 | speaker | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | } phone_ports; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 52 | #define PHONE_CAPABILITIES _IO('q', 0x80) | 
|  | 53 | #define PHONE_CAPABILITIES_LIST _IOR('q', 0x81, struct phone_capability *) | 
|  | 54 | #define PHONE_CAPABILITIES_CHECK _IOW('q', 0x82, struct phone_capability *) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | typedef struct { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 56 | char month[3]; | 
|  | 57 | char day[3]; | 
|  | 58 | char hour[3]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | char min[3]; | 
|  | 60 | int numlen; | 
|  | 61 | char number[11]; | 
|  | 62 | int namelen; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | char name[80]; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | } PHONE_CID; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | #define PHONE_RING _IO('q', 0x83) | 
|  | 66 | #define PHONE_HOOKSTATE _IO('q', 0x84) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | #define PHONE_MAXRINGS _IOW('q', 0x85, char) | 
|  | 68 | #define PHONE_RING_CADENCE _IOW('q', 0x86, short) | 
|  | 69 | #define OLD_PHONE_RING_START _IO('q', 0x87) | 
|  | 70 | #define PHONE_RING_START _IOW('q', 0x87, PHONE_CID *) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | #define PHONE_RING_STOP _IO('q', 0x88) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #define USA_RING_CADENCE 0xC0C0 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 73 | #define PHONE_REC_CODEC _IOW('q', 0x89, int) | 
|  | 74 | #define PHONE_REC_START _IO('q', 0x8A) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | #define PHONE_REC_STOP _IO('q', 0x8B) | 
|  | 76 | #define PHONE_REC_DEPTH _IOW('q', 0x8C, int) | 
|  | 77 | #define PHONE_FRAME _IOW('q', 0x8D, int) | 
|  | 78 | #define PHONE_REC_VOLUME _IOW('q', 0x8E, int) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | #define PHONE_REC_VOLUME_LINEAR _IOW('q', 0xDB, int) | 
|  | 80 | #define PHONE_REC_LEVEL _IO('q', 0x8F) | 
|  | 81 | #define PHONE_PLAY_CODEC _IOW('q', 0x90, int) | 
|  | 82 | #define PHONE_PLAY_START _IO('q', 0x91) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | #define PHONE_PLAY_STOP _IO('q', 0x92) | 
|  | 84 | #define PHONE_PLAY_DEPTH _IOW('q', 0x93, int) | 
|  | 85 | #define PHONE_PLAY_VOLUME _IOW('q', 0x94, int) | 
|  | 86 | #define PHONE_PLAY_VOLUME_LINEAR _IOW('q', 0xDC, int) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | #define PHONE_PLAY_LEVEL _IO('q', 0x95) | 
|  | 88 | #define PHONE_DTMF_READY _IOR('q', 0x96, int) | 
|  | 89 | #define PHONE_GET_DTMF _IOR('q', 0x97, int) | 
|  | 90 | #define PHONE_GET_DTMF_ASCII _IOR('q', 0x98, int) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | #define PHONE_DTMF_OOB _IOW('q', 0x99, int) | 
|  | 92 | #define PHONE_EXCEPTION _IOR('q', 0x9A, int) | 
|  | 93 | #define PHONE_PLAY_TONE _IOW('q', 0x9B, char) | 
|  | 94 | #define PHONE_SET_TONE_ON_TIME _IOW('q', 0x9C, int) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | #define PHONE_SET_TONE_OFF_TIME _IOW('q', 0x9D, int) | 
|  | 96 | #define PHONE_GET_TONE_ON_TIME _IO('q', 0x9E) | 
|  | 97 | #define PHONE_GET_TONE_OFF_TIME _IO('q', 0x9F) | 
|  | 98 | #define PHONE_GET_TONE_STATE _IO('q', 0xA0) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | #define PHONE_BUSY _IO('q', 0xA1) | 
|  | 100 | #define PHONE_RINGBACK _IO('q', 0xA2) | 
|  | 101 | #define PHONE_DIALTONE _IO('q', 0xA3) | 
|  | 102 | #define PHONE_CPT_STOP _IO('q', 0xA4) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 103 | #define PHONE_PSTN_SET_STATE _IOW('q', 0xA4, int) | 
|  | 104 | #define PHONE_PSTN_GET_STATE _IO('q', 0xA5) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | #define PSTN_ON_HOOK 0 | 
|  | 106 | #define PSTN_RINGING 1 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 107 | #define PSTN_OFF_HOOK 2 | 
|  | 108 | #define PSTN_PULSE_DIAL 3 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 109 | #define PHONE_WINK_DURATION _IOW('q', 0xA6, int) | 
|  | 110 | #define PHONE_WINK _IOW('q', 0xAA, int) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | typedef enum { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | G723_63 = 1, | 
|  | 113 | G723_53 = 2, | 
|  | 114 | TS85 = 3, | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 115 | TS48 = 4, | 
|  | 116 | TS41 = 5, | 
|  | 117 | G728 = 6, | 
|  | 118 | G729 = 7, | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 | ULAW = 8, | 
|  | 120 | ALAW = 9, | 
|  | 121 | LINEAR16 = 10, | 
|  | 122 | LINEAR8 = 11, | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 123 | WSS = 12, | 
|  | 124 | G729B = 13 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 125 | } phone_codec; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 126 | struct phone_codec_data { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 | phone_codec type; | 
|  | 128 | unsigned short buf_min, buf_opt, buf_max; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 129 | }; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 130 | #define PHONE_QUERY_CODEC _IOWR('q', 0xA7, struct phone_codec_data *) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 131 | #define PHONE_PSTN_LINETEST _IO('q', 0xA8) | 
|  | 132 | #define PHONE_VAD _IOW('q', 0xA9, int) | 
|  | 133 | struct phone_except { | 
|  | 134 | unsigned int dtmf_ready : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 135 | unsigned int hookstate : 1; | 
|  | 136 | unsigned int pstn_ring : 1; | 
|  | 137 | unsigned int caller_id : 1; | 
|  | 138 | unsigned int pstn_wink : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 139 | unsigned int f0 : 1; | 
|  | 140 | unsigned int f1 : 1; | 
|  | 141 | unsigned int f2 : 1; | 
|  | 142 | unsigned int f3 : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 | unsigned int flash : 1; | 
|  | 144 | unsigned int fc0 : 1; | 
|  | 145 | unsigned int fc1 : 1; | 
|  | 146 | unsigned int fc2 : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | unsigned int fc3 : 1; | 
|  | 148 | unsigned int reserved : 18; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 149 | }; | 
|  | 150 | union telephony_exception { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 151 | struct phone_except bits; | 
|  | 152 | unsigned int bytes; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 153 | }; | 
|  | 154 | #endif |