OSDN Git Service

Merge "Remove unused using statement."
[android-x86/hardware-ril.git] / include / telephony / ril.h
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef ANDROID_RIL_H
18 #define ANDROID_RIL_H 1
19
20 #include <stdlib.h>
21 #include <stdint.h>
22 #include <telephony/ril_cdma_sms.h>
23 #include <telephony/ril_nv_items.h>
24 #include <telephony/ril_msim.h>
25
26 #ifndef FEATURE_UNIT_TEST
27 #include <sys/time.h>
28 #endif /* !FEATURE_UNIT_TEST */
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34
35 #if defined(ANDROID_SIM_COUNT_2)
36 #define SIM_COUNT 2
37 #elif defined(ANDROID_SIM_COUNT_3)
38 #define SIM_COUNT 3
39 #elif defined(ANDROID_SIM_COUNT_4)
40 #define SIM_COUNT 4
41 #else
42 #define SIM_COUNT 1
43 #endif
44
45 #ifndef ANDROID_MULTI_SIM
46 #define SIM_COUNT 1
47 #endif
48
49 /*
50  * RIL version.
51  * Value of RIL_VERSION should not be changed in future. Here onwards,
52  * when a new change is supposed to be introduced  which could involve new
53  * schemes added like Wakelocks, data structures added/updated, etc, we would
54  * just document RIL version associated with that change below. When OEM updates its
55  * RIL with those changes, they would return that new RIL version during RIL_REGISTER.
56  * We should make use of the returned version by vendor to identify appropriate scheme
57  * or data structure version to use.
58  *
59  * Documentation of RIL version and associated changes
60  * RIL_VERSION = 12 : This version corresponds to updated data structures namely
61  *                    RIL_Data_Call_Response_v11, RIL_SIM_IO_v6, RIL_CardStatus_v6,
62  *                    RIL_SimRefreshResponse_v7, RIL_CDMA_CallWaiting_v6,
63  *                    RIL_LTE_SignalStrength_v8, RIL_SignalStrength_v10, RIL_CellIdentityGsm_v12
64  *                    RIL_CellIdentityWcdma_v12, RIL_CellIdentityLte_v12,RIL_CellInfoGsm_v12,
65  *                    RIL_CellInfoWcdma_v12, RIL_CellInfoLte_v12, RIL_CellInfo_v12.
66  *
67  * RIL_VERSION = 13 : This version includes new wakelock semantics and as the first
68  *                    strongly versioned version it enforces structure use.
69  *
70  * RIL_VERSION = 14 : New data structures are added, namely RIL_CarrierMatchType,
71  *                    RIL_Carrier, RIL_CarrierRestrictions and RIL_PCO_Data.
72  *                    New commands added: RIL_REQUEST_SET_CARRIER_RESTRICTIONS,
73  *                    RIL_REQUEST_SET_CARRIER_RESTRICTIONS and RIL_UNSOL_PCO_DATA.
74  *
75  * RIL_VERSION = 15 : New commands added:
76  *                    RIL_REQUEST_SEND_DEVICE_STATE,
77  *                    RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER,
78  *                    RIL_REQUEST_SET_SIM_CARD_POWER
79  *                    The new parameters for RIL_REQUEST_SETUP_DATA_CALL,
80  *                    Updated data structures: RIL_DataProfileInfo_v15, RIL_InitialAttachApn_v15
81  *                    New data structure RIL_DataRegistrationStateResponse,
82  *                    RIL_VoiceRegistrationStateResponse same is
83  *                    used in RIL_REQUEST_DATA_REGISTRATION_STATE and
84  *                    RIL_REQUEST_VOICE_REGISTRATION_STATE respectively.
85  */
86 #define RIL_VERSION 12
87 #define LAST_IMPRECISE_RIL_VERSION 12 // Better self-documented name
88 #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
89
90 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
91 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
92
93 #define MAX_RILDS 3
94 #define MAX_SOCKET_NAME_LENGTH 6
95 #define MAX_CLIENT_ID_LENGTH 2
96 #define MAX_DEBUG_SOCKET_NAME_LENGTH 12
97 #define MAX_QEMU_PIPE_NAME_LENGTH  11
98 #define MAX_UUID_LENGTH 64
99
100
101 typedef void * RIL_Token;
102
103 typedef enum {
104     RIL_SOCKET_1,
105 #if (SIM_COUNT >= 2)
106     RIL_SOCKET_2,
107 #if (SIM_COUNT >= 3)
108     RIL_SOCKET_3,
109 #endif
110 #if (SIM_COUNT >= 4)
111     RIL_SOCKET_4,
112 #endif
113 #endif
114     RIL_SOCKET_NUM
115 } RIL_SOCKET_ID;
116
117
118 typedef enum {
119     RIL_E_SUCCESS = 0,
120     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
121     RIL_E_GENERIC_FAILURE = 2,
122     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
123     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
124     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
125     RIL_E_REQUEST_NOT_SUPPORTED = 6,
126     RIL_E_CANCELLED = 7,
127     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
128                                                    call on a Class C GPRS device */
129     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
130                                                    registers in network */
131     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
132     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
133                                                    shall be retrieved because of SIM or RUIM
134                                                    card absent */
135     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
136                                                    location */
137     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
138     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
139     RIL_E_ILLEGAL_SIM_OR_ME = 15,               /* network selection failed due to
140                                                    illegal SIM or ME */
141     RIL_E_MISSING_RESOURCE = 16,                /* no logical channel available */
142     RIL_E_NO_SUCH_ELEMENT = 17,                  /* application not found on SIM */
143     RIL_E_DIAL_MODIFIED_TO_USSD = 18,           /* DIAL request modified to USSD */
144     RIL_E_DIAL_MODIFIED_TO_SS = 19,             /* DIAL request modified to SS */
145     RIL_E_DIAL_MODIFIED_TO_DIAL = 20,           /* DIAL request modified to DIAL with different
146                                                    data */
147     RIL_E_USSD_MODIFIED_TO_DIAL = 21,           /* USSD request modified to DIAL */
148     RIL_E_USSD_MODIFIED_TO_SS = 22,             /* USSD request modified to SS */
149     RIL_E_USSD_MODIFIED_TO_USSD = 23,           /* USSD request modified to different USSD
150                                                    request */
151     RIL_E_SS_MODIFIED_TO_DIAL = 24,             /* SS request modified to DIAL */
152     RIL_E_SS_MODIFIED_TO_USSD = 25,             /* SS request modified to USSD */
153     RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26,      /* Subscription not supported by RIL */
154     RIL_E_SS_MODIFIED_TO_SS = 27,               /* SS request modified to different SS request */
155     RIL_E_LCE_NOT_SUPPORTED = 36,               /* LCE service not supported(36 in RILConstants.java) */
156     RIL_E_NO_MEMORY = 37,                       /* Not sufficient memory to process the request */
157     RIL_E_INTERNAL_ERR = 38,                    /* Modem hit unexpected error scenario while handling
158                                                    this request */
159     RIL_E_SYSTEM_ERR = 39,                      /* Hit platform or system error */
160     RIL_E_MODEM_ERR = 40,                       /* Vendor RIL got unexpected or incorrect response
161                                                    from modem for this request */
162     RIL_E_INVALID_STATE = 41,                   /* Unexpected request for the current state */
163     RIL_E_NO_RESOURCES = 42,                    /* Not sufficient resource to process the request */
164     RIL_E_SIM_ERR = 43,                         /* Received error from SIM card */
165     RIL_E_INVALID_ARGUMENTS = 44,               /* Received invalid arguments in request */
166     RIL_E_INVALID_SIM_STATE = 45,               /* Can not process the request in current SIM state */
167     RIL_E_INVALID_MODEM_STATE = 46,             /* Can not process the request in current Modem state */
168     RIL_E_INVALID_CALL_ID = 47,                 /* Received invalid call id in request */
169     RIL_E_NO_SMS_TO_ACK = 48,                   /* ACK received when there is no SMS to ack */
170     RIL_E_NETWORK_ERR = 49,                     /* Received error from network */
171     RIL_E_REQUEST_RATE_LIMITED = 50,            /* Operation denied due to overly-frequent requests */
172     RIL_E_SIM_BUSY = 51,                        /* SIM is busy */
173     RIL_E_SIM_FULL = 52,                        /* The target EF is full */
174     RIL_E_NETWORK_REJECT = 53,                  /* Request is rejected by network */
175     RIL_E_OPERATION_NOT_ALLOWED = 54,           /* Not allowed the request now */
176     RIL_E_EMPTY_RECORD = 55,                    /* The request record is empty */
177     RIL_E_INVALID_SMS_FORMAT = 56,              /* Invalid sms format */
178     RIL_E_ENCODING_ERR = 57,                    /* Message not encoded properly */
179     RIL_E_INVALID_SMSC_ADDRESS = 58,            /* SMSC address specified is invalid */
180     RIL_E_NO_SUCH_ENTRY = 59,                   /* No such entry present to perform the request */
181     RIL_E_NETWORK_NOT_READY = 60,               /* Network is not ready to perform the request */
182     RIL_E_NOT_PROVISIONED = 61,                 /* Device doesnot have this value provisioned */
183     RIL_E_NO_SUBSCRIPTION = 62,                 /* Device doesnot have subscription */
184     RIL_E_NO_NETWORK_FOUND = 63,                /* Network cannot be found */
185     RIL_E_DEVICE_IN_USE = 64,                   /* Operation cannot be performed because the device
186                                                    is currently in use */
187     RIL_E_ABORTED = 65,                         /* Operation aborted */
188     RIL_E_INVALID_RESPONSE = 66,                /* Invalid response sent by vendor code */
189     // OEM specific error codes. To be used by OEM when they don't want to reveal
190     // specific error codes which would be replaced by Generic failure.
191     RIL_E_OEM_ERROR_1 = 501,
192     RIL_E_OEM_ERROR_2 = 502,
193     RIL_E_OEM_ERROR_3 = 503,
194     RIL_E_OEM_ERROR_4 = 504,
195     RIL_E_OEM_ERROR_5 = 505,
196     RIL_E_OEM_ERROR_6 = 506,
197     RIL_E_OEM_ERROR_7 = 507,
198     RIL_E_OEM_ERROR_8 = 508,
199     RIL_E_OEM_ERROR_9 = 509,
200     RIL_E_OEM_ERROR_10 = 510,
201     RIL_E_OEM_ERROR_11 = 511,
202     RIL_E_OEM_ERROR_12 = 512,
203     RIL_E_OEM_ERROR_13 = 513,
204     RIL_E_OEM_ERROR_14 = 514,
205     RIL_E_OEM_ERROR_15 = 515,
206     RIL_E_OEM_ERROR_16 = 516,
207     RIL_E_OEM_ERROR_17 = 517,
208     RIL_E_OEM_ERROR_18 = 518,
209     RIL_E_OEM_ERROR_19 = 519,
210     RIL_E_OEM_ERROR_20 = 520,
211     RIL_E_OEM_ERROR_21 = 521,
212     RIL_E_OEM_ERROR_22 = 522,
213     RIL_E_OEM_ERROR_23 = 523,
214     RIL_E_OEM_ERROR_24 = 524,
215     RIL_E_OEM_ERROR_25 = 525
216 } RIL_Errno;
217
218 typedef enum {
219     RIL_CALL_ACTIVE = 0,
220     RIL_CALL_HOLDING = 1,
221     RIL_CALL_DIALING = 2,    /* MO call only */
222     RIL_CALL_ALERTING = 3,   /* MO call only */
223     RIL_CALL_INCOMING = 4,   /* MT call only */
224     RIL_CALL_WAITING = 5     /* MT call only */
225 } RIL_CallState;
226
227 typedef enum {
228     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
229     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
230     RADIO_STATE_ON = 10                    /* Radio is on */
231 } RIL_RadioState;
232
233 typedef enum {
234     RADIO_TECH_UNKNOWN = 0,
235     RADIO_TECH_GPRS = 1,
236     RADIO_TECH_EDGE = 2,
237     RADIO_TECH_UMTS = 3,
238     RADIO_TECH_IS95A = 4,
239     RADIO_TECH_IS95B = 5,
240     RADIO_TECH_1xRTT =  6,
241     RADIO_TECH_EVDO_0 = 7,
242     RADIO_TECH_EVDO_A = 8,
243     RADIO_TECH_HSDPA = 9,
244     RADIO_TECH_HSUPA = 10,
245     RADIO_TECH_HSPA = 11,
246     RADIO_TECH_EVDO_B = 12,
247     RADIO_TECH_EHRPD = 13,
248     RADIO_TECH_LTE = 14,
249     RADIO_TECH_HSPAP = 15, // HSPA+
250     RADIO_TECH_GSM = 16, // Only supports voice
251     RADIO_TECH_TD_SCDMA = 17,
252     RADIO_TECH_IWLAN = 18,
253     RADIO_TECH_LTE_CA = 19
254 } RIL_RadioTechnology;
255
256 typedef enum {
257     RAF_UNKNOWN =  (1 <<  RADIO_TECH_UNKNOWN),
258     RAF_GPRS = (1 << RADIO_TECH_GPRS),
259     RAF_EDGE = (1 << RADIO_TECH_EDGE),
260     RAF_UMTS = (1 << RADIO_TECH_UMTS),
261     RAF_IS95A = (1 << RADIO_TECH_IS95A),
262     RAF_IS95B = (1 << RADIO_TECH_IS95B),
263     RAF_1xRTT = (1 << RADIO_TECH_1xRTT),
264     RAF_EVDO_0 = (1 << RADIO_TECH_EVDO_0),
265     RAF_EVDO_A = (1 << RADIO_TECH_EVDO_A),
266     RAF_HSDPA = (1 << RADIO_TECH_HSDPA),
267     RAF_HSUPA = (1 << RADIO_TECH_HSUPA),
268     RAF_HSPA = (1 << RADIO_TECH_HSPA),
269     RAF_EVDO_B = (1 << RADIO_TECH_EVDO_B),
270     RAF_EHRPD = (1 << RADIO_TECH_EHRPD),
271     RAF_LTE = (1 << RADIO_TECH_LTE),
272     RAF_HSPAP = (1 << RADIO_TECH_HSPAP),
273     RAF_GSM = (1 << RADIO_TECH_GSM),
274     RAF_TD_SCDMA = (1 << RADIO_TECH_TD_SCDMA),
275     RAF_LTE_CA = (1 << RADIO_TECH_LTE_CA)
276 } RIL_RadioAccessFamily;
277
278 typedef enum {
279     BAND_MODE_UNSPECIFIED = 0,      //"unspecified" (selected by baseband automatically)
280     BAND_MODE_EURO = 1,             //"EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
281     BAND_MODE_USA = 2,              //"US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
282     BAND_MODE_JPN = 3,              //"JPN band" (WCDMA-800 / WCDMA-IMT-2000)
283     BAND_MODE_AUS = 4,              //"AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
284     BAND_MODE_AUS_2 = 5,            //"AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
285     BAND_MODE_CELL_800 = 6,         //"Cellular" (800-MHz Band)
286     BAND_MODE_PCS = 7,              //"PCS" (1900-MHz Band)
287     BAND_MODE_JTACS = 8,            //"Band Class 3" (JTACS Band)
288     BAND_MODE_KOREA_PCS = 9,        //"Band Class 4" (Korean PCS Band)
289     BAND_MODE_5_450M = 10,          //"Band Class 5" (450-MHz Band)
290     BAND_MODE_IMT2000 = 11,         //"Band Class 6" (2-GMHz IMT2000 Band)
291     BAND_MODE_7_700M_2 = 12,        //"Band Class 7" (Upper 700-MHz Band)
292     BAND_MODE_8_1800M = 13,         //"Band Class 8" (1800-MHz Band)
293     BAND_MODE_9_900M = 14,          //"Band Class 9" (900-MHz Band)
294     BAND_MODE_10_800M_2 = 15,       //"Band Class 10" (Secondary 800-MHz Band)
295     BAND_MODE_EURO_PAMR_400M = 16,  //"Band Class 11" (400-MHz European PAMR Band)
296     BAND_MODE_AWS = 17,             //"Band Class 15" (AWS Band)
297     BAND_MODE_USA_2500M = 18        //"Band Class 16" (US 2.5-GHz Band)
298 } RIL_RadioBandMode;
299
300 typedef enum {
301     RC_PHASE_CONFIGURED = 0,  // LM is configured is initial value and value after FINISH completes
302     RC_PHASE_START      = 1,  // START is sent before Apply and indicates that an APPLY will be
303                               // forthcoming with these same parameters
304     RC_PHASE_APPLY      = 2,  // APPLY is sent after all LM's receive START and returned
305                               // RIL_RadioCapability.status = 0, if any START's fail no
306                               // APPLY will be sent
307     RC_PHASE_UNSOL_RSP  = 3,  // UNSOL_RSP is sent with RIL_UNSOL_RADIO_CAPABILITY
308     RC_PHASE_FINISH     = 4   // FINISH is sent after all commands have completed. If an error
309                               // occurs in any previous command the RIL_RadioAccessesFamily and
310                               // logicalModemUuid fields will be the prior configuration thus
311                               // restoring the configuration to the previous value. An error
312                               // returned by this command will generally be ignored or may
313                               // cause that logical modem to be removed from service.
314 } RadioCapabilityPhase;
315
316 typedef enum {
317     RC_STATUS_NONE       = 0, // This parameter has no meaning with RC_PHASE_START,
318                               // RC_PHASE_APPLY
319     RC_STATUS_SUCCESS    = 1, // Tell modem the action transaction of set radio
320                               // capability was success with RC_PHASE_FINISH
321     RC_STATUS_FAIL       = 2, // Tell modem the action transaction of set radio
322                               // capability is fail with RC_PHASE_FINISH.
323 } RadioCapabilityStatus;
324
325 #define RIL_RADIO_CAPABILITY_VERSION 1
326 typedef struct {
327     int version;            // Version of structure, RIL_RADIO_CAPABILITY_VERSION
328     int session;            // Unique session value defined by framework returned in all "responses/unsol"
329     int phase;              // CONFIGURED, START, APPLY, FINISH
330     int rat;                // RIL_RadioAccessFamily for the radio
331     char logicalModemUuid[MAX_UUID_LENGTH]; // A UUID typically "com.xxxx.lmX where X is the logical modem.
332     int status;             // Return status and an input parameter for RC_PHASE_FINISH
333 } RIL_RadioCapability;
334
335 // Do we want to split Data from Voice and the use
336 // RIL_RadioTechnology for get/setPreferredVoice/Data ?
337 typedef enum {
338     PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
339     PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
340     PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
341     PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
342     PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
343     PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
344     PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
345     PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
346     PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
347     PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
348     PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
349     PREF_NET_TYPE_LTE_ONLY                 = 11, /* LTE only */
350     PREF_NET_TYPE_LTE_WCDMA                = 12  /* LTE/WCDMA */
351 } RIL_PreferredNetworkType;
352
353 /* Source for cdma subscription */
354 typedef enum {
355    CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
356    CDMA_SUBSCRIPTION_SOURCE_NV = 1
357 } RIL_CdmaSubscriptionSource;
358
359 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
360 typedef enum {
361     RIL_UUS_TYPE1_IMPLICIT = 0,
362     RIL_UUS_TYPE1_REQUIRED = 1,
363     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
364     RIL_UUS_TYPE2_REQUIRED = 3,
365     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
366     RIL_UUS_TYPE3_REQUIRED = 5,
367     RIL_UUS_TYPE3_NOT_REQUIRED = 6
368 } RIL_UUS_Type;
369
370 /* User-to-User Signaling Information data coding schemes. Possible values for
371  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
372  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
373 typedef enum {
374     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
375     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
376     RIL_UUS_DCS_X244 = 2,         /* X.244 */
377     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
378                                      convergence function */
379     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
380 } RIL_UUS_DCS;
381
382 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
383  * This data is passed in RIL_ExtensionRecord and rec contains this
384  * structure when type is RIL_UUS_INFO_EXT_REC */
385 typedef struct {
386   RIL_UUS_Type    uusType;    /* UUS Type */
387   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
388   int             uusLength;  /* Length of UUS Data */
389   char *          uusData;    /* UUS Data */
390 } RIL_UUS_Info;
391
392 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
393 typedef struct {
394   char isPresent;    /* non-zero if signal information record is present */
395   char signalType;   /* as defined 3.7.5.5-1 */
396   char alertPitch;   /* as defined 3.7.5.5-2 */
397   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
398 } RIL_CDMA_SignalInfoRecord;
399
400 typedef struct {
401     RIL_CallState   state;
402     int             index;      /* Connection Index for use with, eg, AT+CHLD */
403     int             toa;        /* type of address, eg 145 = intl */
404     char            isMpty;     /* nonzero if is mpty call */
405     char            isMT;       /* nonzero if call is mobile terminated */
406     char            als;        /* ALS line indicator if available
407                                    (0 = line 1) */
408     char            isVoice;    /* nonzero if this is is a voice call */
409     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
410     char *          number;     /* Remote party number */
411     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
412     char *          name;       /* Remote party name */
413     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
414     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
415 } RIL_Call;
416
417 /* Deprecated, use RIL_Data_Call_Response_v6 */
418 typedef struct {
419     int             cid;        /* Context ID, uniquely identifies this call */
420     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
421     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
422                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
423     char *          apn;        /* ignored */
424     char *          address;    /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
425 } RIL_Data_Call_Response_v4;
426
427 /*
428  * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
429  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
430  */
431 typedef struct {
432     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
433     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
434                                            back-off timer value RIL wants to override the one
435                                            pre-configured in FW.
436                                            The unit is miliseconds.
437                                            The value < 0 means no value is suggested.
438                                            The value 0 means retry should be done ASAP.
439                                            The value of INT_MAX(0x7fffffff) means no retry. */
440     int             cid;        /* Context ID, uniquely identifies this call */
441     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
442     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
443                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
444                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
445                                    such as "IP" or "IPV6" */
446     char *          ifname;     /* The network interface name */
447     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
448                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
449                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
450                                    one of each. If the prefix length is absent the addresses
451                                    are assumed to be point to point with IPv4 having a prefix
452                                    length of 32 and IPv6 128. */
453     char *          dnses;      /* A space-delimited list of DNS server addresses,
454                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
455                                    May be empty. */
456     char *          gateways;   /* A space-delimited list of default gateway addresses,
457                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
458                                    May be empty in which case the addresses represent point
459                                    to point connections. */
460 } RIL_Data_Call_Response_v6;
461
462 typedef struct {
463     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
464     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
465                                            back-off timer value RIL wants to override the one
466                                            pre-configured in FW.
467                                            The unit is miliseconds.
468                                            The value < 0 means no value is suggested.
469                                            The value 0 means retry should be done ASAP.
470                                            The value of INT_MAX(0x7fffffff) means no retry. */
471     int             cid;        /* Context ID, uniquely identifies this call */
472     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
473     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
474                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
475                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
476                                    such as "IP" or "IPV6" */
477     char *          ifname;     /* The network interface name */
478     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
479                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
480                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
481                                    one of each. If the prefix length is absent the addresses
482                                    are assumed to be point to point with IPv4 having a prefix
483                                    length of 32 and IPv6 128. */
484     char *          dnses;      /* A space-delimited list of DNS server addresses,
485                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
486                                    May be empty. */
487     char *          gateways;   /* A space-delimited list of default gateway addresses,
488                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
489                                    May be empty in which case the addresses represent point
490                                    to point connections. */
491     char *          pcscf;    /* the Proxy Call State Control Function address
492                                  via PCO(Protocol Configuration Option) for IMS client. */
493 } RIL_Data_Call_Response_v9;
494
495 typedef struct {
496     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
497     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
498                                            back-off timer value RIL wants to override the one
499                                            pre-configured in FW.
500                                            The unit is miliseconds.
501                                            The value < 0 means no value is suggested.
502                                            The value 0 means retry should be done ASAP.
503                                            The value of INT_MAX(0x7fffffff) means no retry. */
504     int             cid;        /* Context ID, uniquely identifies this call */
505     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
506     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
507                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
508                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
509                                    such as "IP" or "IPV6" */
510     char *          ifname;     /* The network interface name */
511     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
512                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
513                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
514                                    one of each. If the prefix length is absent the addresses
515                                    are assumed to be point to point with IPv4 having a prefix
516                                    length of 32 and IPv6 128. */
517     char *          dnses;      /* A space-delimited list of DNS server addresses,
518                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
519                                    May be empty. */
520     char *          gateways;   /* A space-delimited list of default gateway addresses,
521                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
522                                    May be empty in which case the addresses represent point
523                                    to point connections. */
524     char *          pcscf;    /* the Proxy Call State Control Function address
525                                  via PCO(Protocol Configuration Option) for IMS client. */
526     int             mtu;        /* MTU received from network
527                                    Value <= 0 means network has either not sent a value or
528                                    sent an invalid value */
529 } RIL_Data_Call_Response_v11;
530
531 typedef enum {
532     RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
533     RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
534 } RIL_RadioTechnologyFamily;
535
536 typedef struct {
537     RIL_RadioTechnologyFamily tech;
538     unsigned char             retry;       /* 0 == not retry, nonzero == retry */
539     int                       messageRef;  /* Valid field if retry is set to nonzero.
540                                               Contains messageRef from RIL_SMS_Response
541                                               corresponding to failed MO SMS.
542                                             */
543
544     union {
545         /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */
546         RIL_CDMA_SMS_Message* cdmaMessage;
547
548         /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */
549         char**                gsmMessage;   /* This is an array of pointers where pointers
550                                                are contiguous but elements pointed by those pointers
551                                                are not contiguous
552                                             */
553     } message;
554 } RIL_IMS_SMS_Message;
555
556 typedef struct {
557     int messageRef;   /* TP-Message-Reference for GSM,
558                          and BearerData MessageId for CDMA
559                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
560     char *ackPDU;     /* or NULL if n/a */
561     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
562                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
563                          -1 if unknown or not applicable*/
564 } RIL_SMS_Response;
565
566 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
567 typedef struct {
568     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
569                     /*      0 = "REC UNREAD"    */
570                     /*      1 = "REC READ"      */
571                     /*      2 = "STO UNSENT"    */
572                     /*      3 = "STO SENT"      */
573     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
574                        the TP-layer length is "strlen(pdu)/2". */
575     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
576                        (as expected by TS 27.005) or NULL for default SMSC */
577 } RIL_SMS_WriteArgs;
578
579 /** Used by RIL_REQUEST_DIAL */
580 typedef struct {
581     char * address;
582     int clir;
583             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
584              * clir == 0 on "use subscription default value"
585              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
586              * clir == 2 on "CLIR suppression" (allow CLI presentation)
587              */
588     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
589 } RIL_Dial;
590
591 typedef struct {
592     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
593     int fileid;     /* EF id */
594     char *path;     /* "pathid" from TS 27.007 +CRSM command.
595                        Path is in hex asciii format eg "7f205f70"
596                        Path must always be provided.
597                      */
598     int p1;
599     int p2;
600     int p3;
601     char *data;     /* May be NULL*/
602     char *pin2;     /* May be NULL*/
603 } RIL_SIM_IO_v5;
604
605 typedef struct {
606     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
607     int fileid;     /* EF id */
608     char *path;     /* "pathid" from TS 27.007 +CRSM command.
609                        Path is in hex asciii format eg "7f205f70"
610                        Path must always be provided.
611                      */
612     int p1;
613     int p2;
614     int p3;
615     char *data;     /* May be NULL*/
616     char *pin2;     /* May be NULL*/
617     char *aidPtr;   /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
618 } RIL_SIM_IO_v6;
619
620 /* Used by RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL and
621  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC. */
622 typedef struct {
623     int sessionid;  /* "sessionid" from TS 27.007 +CGLA command. Should be
624                        ignored for +CSIM command. */
625
626     /* Following fields are used to derive the APDU ("command" and "length"
627        values in TS 27.007 +CSIM and +CGLA commands). */
628     int cla;
629     int instruction;
630     int p1;
631     int p2;
632     int p3;         /* A negative P3 implies a 4 byte APDU. */
633     char *data;     /* May be NULL. In hex string format. */
634 } RIL_SIM_APDU;
635
636 typedef struct {
637     int sw1;
638     int sw2;
639     char *simResponse;  /* In hex string format ([a-fA-F0-9]*), except for SIM_AUTHENTICATION
640                            response for which it is in Base64 format, see 3GPP TS 31.102 7.1.2 */
641 } RIL_SIM_IO_Response;
642
643 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
644
645 typedef struct {
646     int             status;     /*
647                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
648                                  * status 1 = active, 0 = not active
649                                  *
650                                  * For RIL_REQUEST_SET_CALL_FORWARD:
651                                  * status is:
652                                  * 0 = disable
653                                  * 1 = enable
654                                  * 2 = interrogate
655                                  * 3 = registeration
656                                  * 4 = erasure
657                                  */
658
659     int             reason;      /* from TS 27.007 7.11 "reason" */
660     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
661                                     See table for Android mapping from
662                                     MMI service code
663                                     0 means user doesn't input class */
664     int             toa;         /* "type" from TS 27.007 7.11 */
665     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
666     int             timeSeconds; /* for CF no reply only */
667 }RIL_CallForwardInfo;
668
669 typedef struct {
670    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
671                         * Upper 16 bits is LAC and lower 16 bits
672                         * is CID (as described in TS 27.005)
673                         * Primary Scrambling Code (as described in TS 25.331)
674                         *         in 9 bits in UMTS
675                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
676                         */
677    int    rssi;        /* Received RSSI in GSM,
678                         * Level index of CPICH Received Signal Code Power in UMTS
679                         */
680 } RIL_NeighboringCell;
681
682 typedef struct {
683   char lce_status;                 /* LCE service status:
684                                     * -1 = not supported;
685                                     * 0 = stopped;
686                                     * 1 = active.
687                                     */
688   unsigned int actual_interval_ms; /* actual LCE reporting interval,
689                                     * meaningful only if LCEStatus = 1.
690                                     */
691 } RIL_LceStatusInfo;
692
693 typedef struct {
694   unsigned int last_hop_capacity_kbps; /* last-hop cellular capacity: kilobits/second. */
695   unsigned char confidence_level;      /* capacity estimate confidence: 0-100 */
696   unsigned char lce_suspended;         /* LCE report going to be suspended? (e.g., radio
697                                         * moves to inactive state or network type change)
698                                         * 1 = suspended;
699                                         * 0 = not suspended.
700                                         */
701 } RIL_LceDataInfo;
702
703 typedef enum {
704     RIL_MATCH_ALL = 0,          /* Apply to all carriers with the same mcc/mnc */
705     RIL_MATCH_SPN = 1,          /* Use SPN and mcc/mnc to identify the carrier */
706     RIL_MATCH_IMSI_PREFIX = 2,  /* Use IMSI prefix and mcc/mnc to identify the carrier */
707     RIL_MATCH_GID1 = 3,         /* Use GID1 and mcc/mnc to identify the carrier */
708     RIL_MATCH_GID2 = 4,         /* Use GID2 and mcc/mnc to identify the carrier */
709 } RIL_CarrierMatchType;
710
711 typedef struct {
712     const char * mcc;
713     const char * mnc;
714     RIL_CarrierMatchType match_type;   /* Specify match type for the carrier.
715                                         * If it’s RIL_MATCH_ALL, match_data is null;
716                                         * otherwise, match_data is the value for the match type.
717                                         */
718     const char * match_data;
719 } RIL_Carrier;
720
721 typedef struct {
722   int32_t len_allowed_carriers;         /* length of array allowed_carriers */
723   int32_t len_excluded_carriers;        /* length of array excluded_carriers */
724   RIL_Carrier * allowed_carriers;       /* whitelist for allowed carriers */
725   RIL_Carrier * excluded_carriers;      /* blacklist for explicitly excluded carriers
726                                          * which match allowed_carriers. Eg. allowed_carriers match
727                                          * mcc/mnc, excluded_carriers has same mcc/mnc and gid1
728                                          * is ABCD. It means except the carrier whose gid1 is ABCD,
729                                          * all carriers with the same mcc/mnc are allowed.
730                                          */
731 } RIL_CarrierRestrictions;
732
733 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
734 typedef enum {
735     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
736     CALL_FAIL_NO_ROUTE_TO_DESTINATION = 3,
737     CALL_FAIL_CHANNEL_UNACCEPTABLE = 6,
738     CALL_FAIL_OPERATOR_DETERMINED_BARRING = 8,
739     CALL_FAIL_NORMAL = 16,
740     CALL_FAIL_BUSY = 17,
741     CALL_FAIL_NO_USER_RESPONDING = 18,
742     CALL_FAIL_NO_ANSWER_FROM_USER = 19,
743     CALL_FAIL_CALL_REJECTED = 21,
744     CALL_FAIL_NUMBER_CHANGED = 22,
745     CALL_FAIL_PREEMPTION = 25,
746     CALL_FAIL_DESTINATION_OUT_OF_ORDER = 27,
747     CALL_FAIL_INVALID_NUMBER_FORMAT = 28,
748     CALL_FAIL_FACILITY_REJECTED = 29,
749     CALL_FAIL_RESP_TO_STATUS_ENQUIRY = 30,
750     CALL_FAIL_NORMAL_UNSPECIFIED = 31,
751     CALL_FAIL_CONGESTION = 34,
752     CALL_FAIL_NETWORK_OUT_OF_ORDER = 38,
753     CALL_FAIL_TEMPORARY_FAILURE = 41,
754     CALL_FAIL_SWITCHING_EQUIPMENT_CONGESTION = 42,
755     CALL_FAIL_ACCESS_INFORMATION_DISCARDED = 43,
756     CALL_FAIL_REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44,
757     CALL_FAIL_RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47,
758     CALL_FAIL_QOS_UNAVAILABLE = 49,
759     CALL_FAIL_REQUESTED_FACILITY_NOT_SUBSCRIBED = 50,
760     CALL_FAIL_INCOMING_CALLS_BARRED_WITHIN_CUG = 55,
761     CALL_FAIL_BEARER_CAPABILITY_NOT_AUTHORIZED = 57,
762     CALL_FAIL_BEARER_CAPABILITY_UNAVAILABLE = 58,
763     CALL_FAIL_SERVICE_OPTION_NOT_AVAILABLE = 63,
764     CALL_FAIL_BEARER_SERVICE_NOT_IMPLEMENTED = 65,
765     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
766     CALL_FAIL_REQUESTED_FACILITY_NOT_IMPLEMENTED = 69,
767     CALL_FAIL_ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70,
768     CALL_FAIL_SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79,
769     CALL_FAIL_INVALID_TRANSACTION_IDENTIFIER = 81,
770     CALL_FAIL_USER_NOT_MEMBER_OF_CUG = 87,
771     CALL_FAIL_INCOMPATIBLE_DESTINATION = 88,
772     CALL_FAIL_INVALID_TRANSIT_NW_SELECTION = 91,
773     CALL_FAIL_SEMANTICALLY_INCORRECT_MESSAGE = 95,
774     CALL_FAIL_INVALID_MANDATORY_INFORMATION = 96,
775     CALL_FAIL_MESSAGE_TYPE_NON_IMPLEMENTED = 97,
776     CALL_FAIL_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
777     CALL_FAIL_INFORMATION_ELEMENT_NON_EXISTENT = 99,
778     CALL_FAIL_CONDITIONAL_IE_ERROR = 100,
779     CALL_FAIL_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
780     CALL_FAIL_RECOVERY_ON_TIMER_EXPIRED = 102,
781     CALL_FAIL_PROTOCOL_ERROR_UNSPECIFIED = 111,
782     CALL_FAIL_INTERWORKING_UNSPECIFIED = 127,
783     CALL_FAIL_CALL_BARRED = 240,
784     CALL_FAIL_FDN_BLOCKED = 241,
785     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
786     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
787     CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244, /* STK Call Control */
788     CALL_FAIL_DIAL_MODIFIED_TO_SS = 245,
789     CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246,
790     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
791     CALL_FAIL_CDMA_DROP = 1001,
792     CALL_FAIL_CDMA_INTERCEPT = 1002,
793     CALL_FAIL_CDMA_REORDER = 1003,
794     CALL_FAIL_CDMA_SO_REJECT = 1004,
795     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
796     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
797     CALL_FAIL_CDMA_PREEMPTED = 1007,
798     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
799                                             during emergency callback mode */
800     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
801     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff /* This error will be deprecated soon,
802                                             vendor code should make sure to map error
803                                             code to specific error */
804 } RIL_LastCallFailCause;
805
806 typedef struct {
807   RIL_LastCallFailCause cause_code;
808   char *                vendor_cause;
809 } RIL_LastCallFailCauseInfo;
810
811 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
812 typedef enum {
813     PDP_FAIL_NONE = 0, /* No error, connection ok */
814
815     /* an integer cause code defined in TS 24.008
816        section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
817        If the implementation does not have access to the exact cause codes,
818        then it should return one of the following values,
819        as the UI layer needs to distinguish these
820        cases for error notification and potential retries. */
821     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
822     PDP_FAIL_NAS_SIGNALLING = 0x0E,
823     PDP_FAIL_LLC_SNDCP = 0x19,
824     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
825     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
826     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
827     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
828     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
829     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
830     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
831     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
832     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
833     PDP_FAIL_NSAPI_IN_USE = 0x23,                  /* no retry */
834     PDP_FAIL_REGULAR_DEACTIVATION = 0x24,          /* possibly restart radio,
835                                                       based on framework config */
836     PDP_FAIL_QOS_NOT_ACCEPTED = 0x25,
837     PDP_FAIL_NETWORK_FAILURE = 0x26,
838     PDP_FAIL_UMTS_REACTIVATION_REQ = 0x27,
839     PDP_FAIL_FEATURE_NOT_SUPP = 0x28,
840     PDP_FAIL_TFT_SEMANTIC_ERROR = 0x29,
841     PDP_FAIL_TFT_SYTAX_ERROR = 0x2A,
842     PDP_FAIL_UNKNOWN_PDP_CONTEXT = 0x2B,
843     PDP_FAIL_FILTER_SEMANTIC_ERROR = 0x2C,
844     PDP_FAIL_FILTER_SYTAX_ERROR = 0x2D,
845     PDP_FAIL_PDP_WITHOUT_ACTIVE_TFT = 0x2E,
846     PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,             /* no retry */
847     PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,             /* no retry */
848     PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
849     PDP_FAIL_ESM_INFO_NOT_RECEIVED = 0x35,
850     PDP_FAIL_PDN_CONN_DOES_NOT_EXIST = 0x36,
851     PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
852     PDP_FAIL_MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
853     PDP_FAIL_UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
854     PDP_FAIL_INVALID_TRANSACTION_ID = 0x51,
855     PDP_FAIL_MESSAGE_INCORRECT_SEMANTIC = 0x5F,
856     PDP_FAIL_INVALID_MANDATORY_INFO = 0x60,
857     PDP_FAIL_MESSAGE_TYPE_UNSUPPORTED = 0x61,
858     PDP_FAIL_MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
859     PDP_FAIL_UNKNOWN_INFO_ELEMENT = 0x63,
860     PDP_FAIL_CONDITIONAL_IE_ERROR = 0x64,
861     PDP_FAIL_MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
862     PDP_FAIL_PROTOCOL_ERRORS = 0x6F,             /* no retry */
863     PDP_FAIL_APN_TYPE_CONFLICT = 0x70,
864     PDP_FAIL_INVALID_PCSCF_ADDR = 0x71,
865     PDP_FAIL_INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
866     PDP_FAIL_EMM_ACCESS_BARRED = 0x73,
867     PDP_FAIL_EMERGENCY_IFACE_ONLY = 0x74,
868     PDP_FAIL_IFACE_MISMATCH = 0x75,
869     PDP_FAIL_COMPANION_IFACE_IN_USE = 0x76,
870     PDP_FAIL_IP_ADDRESS_MISMATCH = 0x77,
871     PDP_FAIL_IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
872     PDP_FAIL_EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
873     PDP_FAIL_AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
874
875     // OEM specific error codes. To be used by OEMs when they don't want to
876     // reveal error code which would be replaced by PDP_FAIL_ERROR_UNSPECIFIED
877     PDP_FAIL_OEM_DCFAILCAUSE_1 = 0x1001,
878     PDP_FAIL_OEM_DCFAILCAUSE_2 = 0x1002,
879     PDP_FAIL_OEM_DCFAILCAUSE_3 = 0x1003,
880     PDP_FAIL_OEM_DCFAILCAUSE_4 = 0x1004,
881     PDP_FAIL_OEM_DCFAILCAUSE_5 = 0x1005,
882     PDP_FAIL_OEM_DCFAILCAUSE_6 = 0x1006,
883     PDP_FAIL_OEM_DCFAILCAUSE_7 = 0x1007,
884     PDP_FAIL_OEM_DCFAILCAUSE_8 = 0x1008,
885     PDP_FAIL_OEM_DCFAILCAUSE_9 = 0x1009,
886     PDP_FAIL_OEM_DCFAILCAUSE_10 = 0x100A,
887     PDP_FAIL_OEM_DCFAILCAUSE_11 = 0x100B,
888     PDP_FAIL_OEM_DCFAILCAUSE_12 = 0x100C,
889     PDP_FAIL_OEM_DCFAILCAUSE_13 = 0x100D,
890     PDP_FAIL_OEM_DCFAILCAUSE_14 = 0x100E,
891     PDP_FAIL_OEM_DCFAILCAUSE_15 = 0x100F,
892
893     /* Not mentioned in the specification */
894     PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
895     PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
896
897    /* reasons for data call drop - network/modem disconnect */
898     PDP_FAIL_SIGNAL_LOST = -3,
899     PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
900                                              with parameters appropriate for new technology */
901     PDP_FAIL_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
902                                              powered off - no retry */
903     PDP_FAIL_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
904                                              mode was up on same APN/data profile - no retry until
905                                              tethered call is off */
906
907     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* retry silently. Will be deprecated soon as
908                                              new error codes are added making this unnecessary */
909 } RIL_DataCallFailCause;
910
911 /* See RIL_REQUEST_SETUP_DATA_CALL */
912 typedef enum {
913     RIL_DATA_PROFILE_DEFAULT    = 0,
914     RIL_DATA_PROFILE_TETHERED   = 1,
915     RIL_DATA_PROFILE_IMS        = 2,
916     RIL_DATA_PROFILE_FOTA       = 3,
917     RIL_DATA_PROFILE_CBS        = 4,
918     RIL_DATA_PROFILE_OEM_BASE   = 1000,    /* Start of OEM-specific profiles */
919     RIL_DATA_PROFILE_INVALID    = 0xFFFFFFFF
920 } RIL_DataProfile;
921
922 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
923 typedef struct {
924     int     notificationType;   /*
925                                  * 0 = MO intermediate result code
926                                  * 1 = MT unsolicited result code
927                                  */
928     int     code;               /* See 27.007 7.17
929                                    "code1" for MO
930                                    "code2" for MT. */
931     int     index;              /* CUG index. See 27.007 7.17. */
932     int     type;               /* "type" from 27.007 7.17 (MT only). */
933     char *  number;             /* "number" from 27.007 7.17
934                                    (MT only, may be NULL). */
935 } RIL_SuppSvcNotification;
936
937 #define RIL_CARD_MAX_APPS     8
938
939 typedef enum {
940     RIL_CARDSTATE_ABSENT     = 0,
941     RIL_CARDSTATE_PRESENT    = 1,
942     RIL_CARDSTATE_ERROR      = 2,
943     RIL_CARDSTATE_RESTRICTED = 3  /* card is present but not usable due to carrier restrictions.*/
944 } RIL_CardState;
945
946 typedef enum {
947     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
948     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
949     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
950                                                         since each app can only have 1 active perso
951                                                         involved */
952     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
953     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
954     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
955     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
956     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
957     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
958     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
959     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
960     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
961     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
962     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
963     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
964     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
965     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
966     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
967     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
968     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
969     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
970     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
971     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
972     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
973     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
974 } RIL_PersoSubstate;
975
976 typedef enum {
977     RIL_APPSTATE_UNKNOWN               = 0,
978     RIL_APPSTATE_DETECTED              = 1,
979     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
980     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
981     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
982                                                when app_state is assigned to this value */
983     RIL_APPSTATE_READY                 = 5
984 } RIL_AppState;
985
986 typedef enum {
987     RIL_PINSTATE_UNKNOWN              = 0,
988     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
989     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
990     RIL_PINSTATE_DISABLED             = 3,
991     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
992     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
993 } RIL_PinState;
994
995 typedef enum {
996   RIL_APPTYPE_UNKNOWN = 0,
997   RIL_APPTYPE_SIM     = 1,
998   RIL_APPTYPE_USIM    = 2,
999   RIL_APPTYPE_RUIM    = 3,
1000   RIL_APPTYPE_CSIM    = 4,
1001   RIL_APPTYPE_ISIM    = 5
1002 } RIL_AppType;
1003
1004 /*
1005  * Please note that registration state UNKNOWN is
1006  * treated as "out of service" in the Android telephony.
1007  * Registration state REG_DENIED must be returned if Location Update
1008  * Reject (with cause 17 - Network Failure) is received
1009  * repeatedly from the network, to facilitate
1010  * "managed roaming"
1011  */
1012 typedef enum {
1013     RIL_NOT_REG_AND_NOT_SEARCHING = 0,           // Not registered, MT is not currently searching
1014                                                  // a new operator to register
1015     RIL_REG_HOME = 1,                            // Registered, home network
1016     RIL_NOT_REG_AND_SEARCHING = 2,               // Not registered, but MT is currently searching
1017                                                  // a new operator to register
1018     RIL_REG_DENIED = 3,                          // Registration denied
1019     RIL_UNKNOWN = 4,                             // Unknown
1020     RIL_REG_ROAMING = 5,                         // Registered, roaming
1021     RIL_NOT_REG_AND_EMERGENCY_AVAILABLE_AND_NOT_SEARCHING = 10,   // Same as
1022                                                  // RIL_NOT_REG_AND_NOT_SEARCHING but indicates that
1023                                                  // emergency calls are enabled.
1024     RIL_NOT_REG_AND_EMERGENCY_AVAILABLE_AND_SEARCHING = 12,  // Same as RIL_NOT_REG_AND_SEARCHING
1025                                                  // but indicates that
1026                                                  // emergency calls are enabled.
1027     RIL_REG_DENIED_AND_EMERGENCY_AVAILABLE = 13, // Same as REG_DENIED but indicates that
1028                                                  // emergency calls are enabled.
1029     RIL_UNKNOWN_AND_EMERGENCY_AVAILABLE = 14,    // Same as UNKNOWN but indicates that
1030                                                  // emergency calls are enabled.
1031 } RIL_RegState;
1032
1033 typedef struct
1034 {
1035   RIL_AppType      app_type;
1036   RIL_AppState     app_state;
1037   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
1038                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
1039   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
1040                                        0x30, 0x30, 0x30 */
1041   char             *app_label_ptr;  /* null terminated string */
1042   int              pin1_replaced;   /* applicable to USIM, CSIM & ISIM */
1043   RIL_PinState     pin1;
1044   RIL_PinState     pin2;
1045 } RIL_AppStatus;
1046
1047 /* Deprecated, use RIL_CardStatus_v6 */
1048 typedef struct
1049 {
1050   RIL_CardState card_state;
1051   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
1052   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
1053   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
1054   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
1055   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
1056 } RIL_CardStatus_v5;
1057
1058 typedef struct
1059 {
1060   RIL_CardState card_state;
1061   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
1062   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
1063   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
1064   int           ims_subscription_app_index;      /* value < RIL_CARD_MAX_APPS, -1 if none */
1065   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
1066   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
1067 } RIL_CardStatus_v6;
1068
1069 /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
1070  *      or as part of RIL_SimRefreshResponse_v7
1071  */
1072 typedef enum {
1073     /* A file on SIM has been updated.  data[1] contains the EFID. */
1074     SIM_FILE_UPDATE = 0,
1075     /* SIM initialized.  All files should be re-read. */
1076     SIM_INIT = 1,
1077     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
1078     SIM_RESET = 2
1079 } RIL_SimRefreshResult;
1080
1081 typedef struct {
1082     RIL_SimRefreshResult result;
1083     int                  ef_id; /* is the EFID of the updated file if the result is */
1084                                 /* SIM_FILE_UPDATE or 0 for any other result. */
1085     char *               aid;   /* is AID(application ID) of the card application */
1086                                 /* See ETSI 102.221 8.1 and 101.220 4 */
1087                                 /*     For SIM_FILE_UPDATE result it can be set to AID of */
1088                                 /*         application in which updated EF resides or it can be */
1089                                 /*         NULL if EF is outside of an application. */
1090                                 /*     For SIM_INIT result this field is set to AID of */
1091                                 /*         application that caused REFRESH */
1092                                 /*     For SIM_RESET result it is NULL. */
1093 } RIL_SimRefreshResponse_v7;
1094
1095 /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
1096 typedef struct {
1097     char *          number;             /* Remote party number */
1098     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
1099     char *          name;               /* Remote party name */
1100     RIL_CDMA_SignalInfoRecord signalInfoRecord;
1101 } RIL_CDMA_CallWaiting_v5;
1102
1103 typedef struct {
1104     char *          number;             /* Remote party number */
1105     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
1106     char *          name;               /* Remote party name */
1107     RIL_CDMA_SignalInfoRecord signalInfoRecord;
1108     /* Number type/Number plan required to support International Call Waiting */
1109     int             number_type;        /* 0=Unknown, 1=International, 2=National,
1110                                            3=Network specific, 4=subscriber */
1111     int             number_plan;        /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
1112 } RIL_CDMA_CallWaiting_v6;
1113
1114 /**
1115  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
1116  *
1117  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
1118  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
1119  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
1120  * CBM message ID.
1121  *
1122  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
1123  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
1124  * and 9.4.4.2.3 for UMTS.
1125  * All other values can be treated as empty CBM data coding scheme.
1126  *
1127  * selected 0 means message types specified in <fromServiceId, toServiceId>
1128  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
1129  *
1130  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
1131  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
1132  */
1133 typedef struct {
1134     int fromServiceId;
1135     int toServiceId;
1136     int fromCodeScheme;
1137     int toCodeScheme;
1138     unsigned char selected;
1139 } RIL_GSM_BroadcastSmsConfigInfo;
1140
1141 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
1142 #define RIL_RESTRICTED_STATE_NONE           0x00
1143 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
1144 #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
1145 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
1146 #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
1147 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
1148 #define RIL_RESTRICTED_STATE_CS_ALL         0x04
1149 /* Block packet data access due to restriction. */
1150 #define RIL_RESTRICTED_STATE_PS_ALL         0x10
1151
1152 /* The status for an OTASP/OTAPA session */
1153 typedef enum {
1154     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
1155     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
1156     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
1157     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
1158     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
1159     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
1160     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
1161     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
1162     CDMA_OTA_PROVISION_STATUS_COMMITTED,
1163     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
1164     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
1165     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
1166 } RIL_CDMA_OTA_ProvisionStatus;
1167
1168 typedef struct {
1169     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
1170     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
1171 } RIL_GW_SignalStrength;
1172
1173 typedef struct {
1174     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
1175     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
1176     int timingAdvance;   /* Timing Advance in bit periods. 1 bit period = 48/13 us.
1177                           * INT_MAX denotes invalid value */
1178 } RIL_GSM_SignalStrength_v12;
1179
1180 typedef struct {
1181     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
1182     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
1183 } RIL_SignalStrengthWcdma;
1184
1185 typedef struct {
1186     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
1187                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
1188                * value will be 75.
1189                */
1190     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
1191                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
1192                * will be 125.
1193                */
1194 } RIL_CDMA_SignalStrength;
1195
1196
1197 typedef struct {
1198     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
1199                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
1200                * value will be 75.
1201                */
1202     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
1203                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
1204                * will be 125.
1205                */
1206     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
1207 } RIL_EVDO_SignalStrength;
1208
1209 typedef struct {
1210     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
1211     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
1212                           * Range: 44 to 140 dBm
1213                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
1214                           * Reference: 3GPP TS 36.133 9.1.4 */
1215     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
1216                           * Range: 20 to 3 dB.
1217                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
1218                           * Reference: 3GPP TS 36.133 9.1.7 */
1219     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
1220                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
1221                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
1222                           * Reference: 3GPP TS 36.101 8.1.1 */
1223     int cqi;             /* The current Channel Quality Indicator.
1224                           * Range: 0 to 15.
1225                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
1226                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
1227 } RIL_LTE_SignalStrength;
1228
1229 typedef struct {
1230     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
1231     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
1232                           * Range: 44 to 140 dBm
1233                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
1234                           * Reference: 3GPP TS 36.133 9.1.4 */
1235     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
1236                           * Range: 20 to 3 dB.
1237                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
1238                           * Reference: 3GPP TS 36.133 9.1.7 */
1239     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
1240                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
1241                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
1242                           * Reference: 3GPP TS 36.101 8.1.1 */
1243     int cqi;             /* The current Channel Quality Indicator.
1244                           * Range: 0 to 15.
1245                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
1246                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
1247     int timingAdvance;   /* timing advance in micro seconds for a one way trip from cell to device.
1248                           * Approximate distance can be calculated using 300m/us * timingAdvance.
1249                           * Range: 0 to 0x7FFFFFFE
1250                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
1251                           * Reference: 3GPP 36.321 section 6.1.3.5
1252                           * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */
1253 } RIL_LTE_SignalStrength_v8;
1254
1255 typedef struct {
1256     int rscp;    /* The Received Signal Code Power in dBm multipled by -1.
1257                   * Range : 25 to 120
1258                   * INT_MAX: 0x7FFFFFFF denotes invalid value.
1259                   * Reference: 3GPP TS 25.123, section 9.1.1.1 */
1260 } RIL_TD_SCDMA_SignalStrength;
1261
1262 /* Deprecated, use RIL_SignalStrength_v6 */
1263 typedef struct {
1264     RIL_GW_SignalStrength   GW_SignalStrength;
1265     RIL_CDMA_SignalStrength CDMA_SignalStrength;
1266     RIL_EVDO_SignalStrength EVDO_SignalStrength;
1267 } RIL_SignalStrength_v5;
1268
1269 typedef struct {
1270     RIL_GW_SignalStrength   GW_SignalStrength;
1271     RIL_CDMA_SignalStrength CDMA_SignalStrength;
1272     RIL_EVDO_SignalStrength EVDO_SignalStrength;
1273     RIL_LTE_SignalStrength  LTE_SignalStrength;
1274 } RIL_SignalStrength_v6;
1275
1276 typedef struct {
1277     RIL_GW_SignalStrength       GW_SignalStrength;
1278     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
1279     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
1280     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
1281 } RIL_SignalStrength_v8;
1282
1283 typedef struct {
1284     RIL_GW_SignalStrength       GW_SignalStrength;
1285     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
1286     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
1287     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
1288     RIL_TD_SCDMA_SignalStrength TD_SCDMA_SignalStrength;
1289 } RIL_SignalStrength_v10;
1290
1291 typedef struct {
1292     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
1293     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
1294     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
1295     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
1296 } RIL_CellIdentityGsm;
1297
1298 typedef struct {
1299     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
1300     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
1301     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
1302     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
1303     int arfcn;  /* 16-bit GSM Absolute RF channel number, INT_MAX if unknown */
1304     uint8_t bsic;/* 6-bit Base Station Identity Code, 0xFF if unknown */
1305 } RIL_CellIdentityGsm_v12;
1306
1307 typedef struct {
1308     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1309     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1310     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
1311     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
1312     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
1313 } RIL_CellIdentityWcdma;
1314
1315 typedef struct {
1316     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1317     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1318     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
1319     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
1320     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
1321     int uarfcn; /* 16-bit UMTS Absolute RF Channel Number, INT_MAX if unknown */
1322 } RIL_CellIdentityWcdma_v12;
1323
1324 typedef struct {
1325     int networkId;      /* Network Id 0..65535, INT_MAX if unknown */
1326     int systemId;       /* CDMA System Id 0..32767, INT_MAX if unknown  */
1327     int basestationId;  /* Base Station Id 0..65535, INT_MAX if unknown  */
1328     int longitude;      /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
1329                          * It is represented in units of 0.25 seconds and ranges from -2592000
1330                          * to 2592000, both values inclusive (corresponding to a range of -180
1331                          * to +180 degrees). INT_MAX if unknown */
1332
1333     int latitude;       /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
1334                          * It is represented in units of 0.25 seconds and ranges from -1296000
1335                          * to 1296000, both values inclusive (corresponding to a range of -90
1336                          * to +90 degrees). INT_MAX if unknown */
1337 } RIL_CellIdentityCdma;
1338
1339 typedef struct {
1340     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1341     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1342     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
1343     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
1344     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
1345 } RIL_CellIdentityLte;
1346
1347 typedef struct {
1348     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1349     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1350     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
1351     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
1352     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
1353     int earfcn; /* 18-bit LTE Absolute RC Channel Number, INT_MAX if unknown */
1354 } RIL_CellIdentityLte_v12;
1355
1356 typedef struct {
1357     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1358     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1359     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
1360     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
1361     int cpid;    /* 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown */
1362 } RIL_CellIdentityTdscdma;
1363
1364 typedef struct {
1365   RIL_CellIdentityGsm   cellIdentityGsm;
1366   RIL_GW_SignalStrength signalStrengthGsm;
1367 } RIL_CellInfoGsm;
1368
1369 typedef struct {
1370   RIL_CellIdentityGsm_v12   cellIdentityGsm;
1371   RIL_GSM_SignalStrength_v12 signalStrengthGsm;
1372 } RIL_CellInfoGsm_v12;
1373
1374 typedef struct {
1375   RIL_CellIdentityWcdma cellIdentityWcdma;
1376   RIL_SignalStrengthWcdma signalStrengthWcdma;
1377 } RIL_CellInfoWcdma;
1378
1379 typedef struct {
1380   RIL_CellIdentityWcdma_v12 cellIdentityWcdma;
1381   RIL_SignalStrengthWcdma signalStrengthWcdma;
1382 } RIL_CellInfoWcdma_v12;
1383
1384 typedef struct {
1385   RIL_CellIdentityCdma      cellIdentityCdma;
1386   RIL_CDMA_SignalStrength   signalStrengthCdma;
1387   RIL_EVDO_SignalStrength   signalStrengthEvdo;
1388 } RIL_CellInfoCdma;
1389
1390 typedef struct {
1391   RIL_CellIdentityLte        cellIdentityLte;
1392   RIL_LTE_SignalStrength_v8  signalStrengthLte;
1393 } RIL_CellInfoLte;
1394
1395 typedef struct {
1396   RIL_CellIdentityLte_v12    cellIdentityLte;
1397   RIL_LTE_SignalStrength_v8  signalStrengthLte;
1398 } RIL_CellInfoLte_v12;
1399
1400 typedef struct {
1401   RIL_CellIdentityTdscdma cellIdentityTdscdma;
1402   RIL_TD_SCDMA_SignalStrength signalStrengthTdscdma;
1403 } RIL_CellInfoTdscdma;
1404
1405 // Must be the same as CellInfo.TYPE_XXX
1406 typedef enum {
1407   RIL_CELL_INFO_TYPE_NONE   = 0, /* indicates no cell information */
1408   RIL_CELL_INFO_TYPE_GSM    = 1,
1409   RIL_CELL_INFO_TYPE_CDMA   = 2,
1410   RIL_CELL_INFO_TYPE_LTE    = 3,
1411   RIL_CELL_INFO_TYPE_WCDMA  = 4,
1412   RIL_CELL_INFO_TYPE_TD_SCDMA  = 5
1413 } RIL_CellInfoType;
1414
1415 // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX
1416 typedef enum {
1417     RIL_TIMESTAMP_TYPE_UNKNOWN = 0,
1418     RIL_TIMESTAMP_TYPE_ANTENNA = 1,
1419     RIL_TIMESTAMP_TYPE_MODEM = 2,
1420     RIL_TIMESTAMP_TYPE_OEM_RIL = 3,
1421     RIL_TIMESTAMP_TYPE_JAVA_RIL = 4,
1422 } RIL_TimeStampType;
1423
1424 typedef struct {
1425   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
1426   int               registered;     /* !0 if this cell is registered 0 if not registered */
1427   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
1428   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
1429   union {
1430     RIL_CellInfoGsm     gsm;
1431     RIL_CellInfoCdma    cdma;
1432     RIL_CellInfoLte     lte;
1433     RIL_CellInfoWcdma   wcdma;
1434     RIL_CellInfoTdscdma tdscdma;
1435   } CellInfo;
1436 } RIL_CellInfo;
1437
1438 typedef struct {
1439   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
1440   int               registered;     /* !0 if this cell is registered 0 if not registered */
1441   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
1442   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
1443   union {
1444     RIL_CellInfoGsm_v12     gsm;
1445     RIL_CellInfoCdma        cdma;
1446     RIL_CellInfoLte_v12     lte;
1447     RIL_CellInfoWcdma_v12   wcdma;
1448     RIL_CellInfoTdscdma     tdscdma;
1449   } CellInfo;
1450 } RIL_CellInfo_v12;
1451
1452 typedef struct {
1453   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
1454   union {
1455     RIL_CellIdentityGsm_v12 cellIdentityGsm;
1456     RIL_CellIdentityWcdma_v12 cellIdentityWcdma;
1457     RIL_CellIdentityLte_v12 cellIdentityLte;
1458     RIL_CellIdentityTdscdma cellIdentityTdscdma;
1459     RIL_CellIdentityCdma cellIdentityCdma;
1460   };
1461 }RIL_CellIdentity_v16;
1462
1463 typedef struct {
1464     RIL_RegState regState;                // Valid reg states are RIL_NOT_REG_AND_NOT_SEARCHING,
1465                                           // REG_HOME, RIL_NOT_REG_AND_SEARCHING, REG_DENIED,
1466                                           // UNKNOWN, REG_ROAMING defined in RegState
1467     RIL_RadioTechnology rat;              // indicates the available voice radio technology,
1468                                           // valid values as defined by RadioTechnology.
1469     int32_t cssSupported;                 // concurrent services support indicator. if
1470                                           // registered on a CDMA system.
1471                                           // 0 - Concurrent services not supported,
1472                                           // 1 - Concurrent services supported
1473     int32_t roamingIndicator;             // TSB-58 Roaming Indicator if registered
1474                                           // on a CDMA or EVDO system or -1 if not.
1475                                           // Valid values are 0-255.
1476     int32_t systemIsInPrl;                // indicates whether the current system is in the
1477                                           // PRL if registered on a CDMA or EVDO system or -1 if
1478                                           // not. 0=not in the PRL, 1=in the PRL
1479     int32_t defaultRoamingIndicator;      // default Roaming Indicator from the PRL,
1480                                           // if registered on a CDMA or EVDO system or -1 if not.
1481                                           // Valid values are 0-255.
1482     int32_t reasonForDenial;              // reasonForDenial if registration state is 3
1483                                           // (Registration denied) this is an enumerated reason why
1484                                           // registration was denied. See 3GPP TS 24.008,
1485                                           // 10.5.3.6 and Annex G.
1486                                           // 0 - General
1487                                           // 1 - Authentication Failure
1488                                           // 2 - IMSI unknown in HLR
1489                                           // 3 - Illegal MS
1490                                           // 4 - Illegal ME
1491                                           // 5 - PLMN not allowed
1492                                           // 6 - Location area not allowed
1493                                           // 7 - Roaming not allowed
1494                                           // 8 - No Suitable Cells in this Location Area
1495                                           // 9 - Network failure
1496                                           // 10 - Persistent location update reject
1497                                           // 11 - PLMN not allowed
1498                                           // 12 - Location area not allowed
1499                                           // 13 - Roaming not allowed in this Location Area
1500                                           // 15 - No Suitable Cells in this Location Area
1501                                           // 17 - Network Failure
1502                                           // 20 - MAC Failure
1503                                           // 21 - Sync Failure
1504                                           // 22 - Congestion
1505                                           // 23 - GSM Authentication unacceptable
1506                                           // 25 - Not Authorized for this CSG
1507                                           // 32 - Service option not supported
1508                                           // 33 - Requested service option not subscribed
1509                                           // 34 - Service option temporarily out of order
1510                                           // 38 - Call cannot be identified
1511                                           // 48-63 - Retry upon entry into a new cell
1512                                           // 95 - Semantically incorrect message
1513                                           // 96 - Invalid mandatory information
1514                                           // 97 - Message type non-existent or not implemented
1515                                           // 98 - Message type not compatible with protocol state
1516                                           // 99 - Information element non-existent or
1517                                           //      not implemented
1518                                           // 100 - Conditional IE error
1519                                           // 101 - Message not compatible with protocol state;
1520     RIL_CellIdentity_v16 cellIdentity;    // current cell information
1521 }RIL_VoiceRegistrationStateResponse;
1522
1523
1524 typedef struct {
1525     RIL_RegState regState;                // Valid reg states are RIL_NOT_REG_AND_NOT_SEARCHING,
1526                                           // REG_HOME, RIL_NOT_REG_AND_SEARCHING, REG_DENIED,
1527                                           // UNKNOWN, REG_ROAMING defined in RegState
1528     RIL_RadioTechnology rat;              // indicates the available data radio technology,
1529                                           // valid values as defined by RadioTechnology.
1530     int32_t reasonDataDenied;             // if registration state is 3 (Registration
1531                                           // denied) this is an enumerated reason why
1532                                           // registration was denied. See 3GPP TS 24.008,
1533                                           // Annex G.6 "Additional cause codes for GMM".
1534                                           // 7 == GPRS services not allowed
1535                                           // 8 == GPRS services and non-GPRS services not allowed
1536                                           // 9 == MS identity cannot be derived by the network
1537                                           // 10 == Implicitly detached
1538                                           // 14 == GPRS services not allowed in this PLMN
1539                                           // 16 == MSC temporarily not reachable
1540                                           // 40 == No PDP context activated
1541     int32_t maxDataCalls;                 // The maximum number of simultaneous Data Calls that
1542                                           // must be established using setupDataCall().
1543     RIL_CellIdentity_v16 cellIdentity;    // Current cell information
1544 }RIL_DataRegistrationStateResponse;
1545
1546 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
1547 typedef enum {
1548   RIL_CDMA_DISPLAY_INFO_REC,
1549   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
1550   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
1551   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
1552   RIL_CDMA_SIGNAL_INFO_REC,
1553   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
1554   RIL_CDMA_LINE_CONTROL_INFO_REC,
1555   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
1556   RIL_CDMA_T53_CLIR_INFO_REC,
1557   RIL_CDMA_T53_RELEASE_INFO_REC,
1558   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
1559 } RIL_CDMA_InfoRecName;
1560
1561 /* Display Info Rec as defined in C.S0005 section 3.7.5.1
1562    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
1563    Note: the Extended Display info rec contains multiple records of the
1564    form: display_tag, display_len, and display_len occurrences of the
1565    chari field if the display_tag is not 10000000 or 10000001.
1566    To save space, the records are stored consecutively in a byte buffer.
1567    The display_tag, display_len and chari fields are all 1 byte.
1568 */
1569
1570 typedef struct {
1571   char alpha_len;
1572   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
1573 } RIL_CDMA_DisplayInfoRecord;
1574
1575 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
1576    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
1577    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
1578 */
1579
1580 typedef struct {
1581   char len;
1582   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
1583   char number_type;
1584   char number_plan;
1585   char pi;
1586   char si;
1587 } RIL_CDMA_NumberInfoRecord;
1588
1589 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
1590 typedef enum {
1591   RIL_REDIRECTING_REASON_UNKNOWN = 0,
1592   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
1593   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
1594   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
1595   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
1596   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
1597   RIL_REDIRECTING_REASON_RESERVED
1598 } RIL_CDMA_RedirectingReason;
1599
1600 typedef struct {
1601   RIL_CDMA_NumberInfoRecord redirectingNumber;
1602   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
1603   RIL_CDMA_RedirectingReason redirectingReason;
1604 } RIL_CDMA_RedirectingNumberInfoRecord;
1605
1606 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
1607 typedef struct {
1608   char lineCtrlPolarityIncluded;
1609   char lineCtrlToggle;
1610   char lineCtrlReverse;
1611   char lineCtrlPowerDenial;
1612 } RIL_CDMA_LineControlInfoRecord;
1613
1614 /* T53 CLIR Information Record */
1615 typedef struct {
1616   char cause;
1617 } RIL_CDMA_T53_CLIRInfoRecord;
1618
1619 /* T53 Audio Control Information Record */
1620 typedef struct {
1621   char upLink;
1622   char downLink;
1623 } RIL_CDMA_T53_AudioControlInfoRecord;
1624
1625 typedef struct {
1626
1627   RIL_CDMA_InfoRecName name;
1628
1629   union {
1630     /* Display and Extended Display Info Rec */
1631     RIL_CDMA_DisplayInfoRecord           display;
1632
1633     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
1634     RIL_CDMA_NumberInfoRecord            number;
1635
1636     /* Signal Info Rec */
1637     RIL_CDMA_SignalInfoRecord            signal;
1638
1639     /* Redirecting Number Info Rec */
1640     RIL_CDMA_RedirectingNumberInfoRecord redir;
1641
1642     /* Line Control Info Rec */
1643     RIL_CDMA_LineControlInfoRecord       lineCtrl;
1644
1645     /* T53 CLIR Info Rec */
1646     RIL_CDMA_T53_CLIRInfoRecord          clir;
1647
1648     /* T53 Audio Control Info Rec */
1649     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
1650   } rec;
1651 } RIL_CDMA_InformationRecord;
1652
1653 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
1654
1655 typedef struct {
1656   char numberOfInfoRecs;
1657   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
1658 } RIL_CDMA_InformationRecords;
1659
1660 /* See RIL_REQUEST_NV_READ_ITEM */
1661 typedef struct {
1662   RIL_NV_Item itemID;
1663 } RIL_NV_ReadItem;
1664
1665 /* See RIL_REQUEST_NV_WRITE_ITEM */
1666 typedef struct {
1667   RIL_NV_Item   itemID;
1668   char *        value;
1669 } RIL_NV_WriteItem;
1670
1671 typedef enum {
1672     HANDOVER_STARTED = 0,
1673     HANDOVER_COMPLETED = 1,
1674     HANDOVER_FAILED = 2,
1675     HANDOVER_CANCELED = 3
1676 } RIL_SrvccState;
1677
1678 /* hardware configuration reported to RILJ. */
1679 typedef enum {
1680    RIL_HARDWARE_CONFIG_MODEM = 0,
1681    RIL_HARDWARE_CONFIG_SIM = 1,
1682 } RIL_HardwareConfig_Type;
1683
1684 typedef enum {
1685    RIL_HARDWARE_CONFIG_STATE_ENABLED = 0,
1686    RIL_HARDWARE_CONFIG_STATE_STANDBY = 1,
1687    RIL_HARDWARE_CONFIG_STATE_DISABLED = 2,
1688 } RIL_HardwareConfig_State;
1689
1690 typedef struct {
1691    int rilModel;
1692    uint32_t rat; /* bitset - ref. RIL_RadioTechnology. */
1693    int maxVoice;
1694    int maxData;
1695    int maxStandby;
1696 } RIL_HardwareConfig_Modem;
1697
1698 typedef struct {
1699    char modemUuid[MAX_UUID_LENGTH];
1700 } RIL_HardwareConfig_Sim;
1701
1702 typedef struct {
1703   RIL_HardwareConfig_Type type;
1704   char uuid[MAX_UUID_LENGTH];
1705   RIL_HardwareConfig_State state;
1706   union {
1707      RIL_HardwareConfig_Modem modem;
1708      RIL_HardwareConfig_Sim sim;
1709   } cfg;
1710 } RIL_HardwareConfig;
1711
1712 typedef enum {
1713   SS_CFU,
1714   SS_CF_BUSY,
1715   SS_CF_NO_REPLY,
1716   SS_CF_NOT_REACHABLE,
1717   SS_CF_ALL,
1718   SS_CF_ALL_CONDITIONAL,
1719   SS_CLIP,
1720   SS_CLIR,
1721   SS_COLP,
1722   SS_COLR,
1723   SS_WAIT,
1724   SS_BAOC,
1725   SS_BAOIC,
1726   SS_BAOIC_EXC_HOME,
1727   SS_BAIC,
1728   SS_BAIC_ROAMING,
1729   SS_ALL_BARRING,
1730   SS_OUTGOING_BARRING,
1731   SS_INCOMING_BARRING
1732 } RIL_SsServiceType;
1733
1734 typedef enum {
1735   SS_ACTIVATION,
1736   SS_DEACTIVATION,
1737   SS_INTERROGATION,
1738   SS_REGISTRATION,
1739   SS_ERASURE
1740 } RIL_SsRequestType;
1741
1742 typedef enum {
1743   SS_ALL_TELE_AND_BEARER_SERVICES,
1744   SS_ALL_TELESEVICES,
1745   SS_TELEPHONY,
1746   SS_ALL_DATA_TELESERVICES,
1747   SS_SMS_SERVICES,
1748   SS_ALL_TELESERVICES_EXCEPT_SMS
1749 } RIL_SsTeleserviceType;
1750
1751 #define SS_INFO_MAX 4
1752 #define NUM_SERVICE_CLASSES 7
1753
1754 typedef struct {
1755   int numValidIndexes; /* This gives the number of valid values in cfInfo.
1756                        For example if voice is forwarded to one number and data
1757                        is forwarded to a different one then numValidIndexes will be
1758                        2 indicating total number of valid values in cfInfo.
1759                        Similarly if all the services are forwarded to the same
1760                        number then the value of numValidIndexes will be 1. */
1761
1762   RIL_CallForwardInfo cfInfo[NUM_SERVICE_CLASSES]; /* This is the response data
1763                                                       for SS request to query call
1764                                                       forward status. see
1765                                                       RIL_REQUEST_QUERY_CALL_FORWARD_STATUS */
1766 } RIL_CfData;
1767
1768 typedef struct {
1769   RIL_SsServiceType serviceType;
1770   RIL_SsRequestType requestType;
1771   RIL_SsTeleserviceType teleserviceType;
1772   int serviceClass;
1773   RIL_Errno result;
1774
1775   union {
1776     int ssInfo[SS_INFO_MAX]; /* This is the response data for most of the SS GET/SET
1777                                 RIL requests. E.g. RIL_REQUSET_GET_CLIR returns
1778                                 two ints, so first two values of ssInfo[] will be
1779                                 used for response if serviceType is SS_CLIR and
1780                                 requestType is SS_INTERROGATION */
1781
1782     RIL_CfData cfData;
1783   };
1784 } RIL_StkCcUnsolSsResponse;
1785
1786 /**
1787  * Data connection power state
1788  */
1789 typedef enum {
1790     RIL_DC_POWER_STATE_LOW      = 1,        // Low power state
1791     RIL_DC_POWER_STATE_MEDIUM   = 2,        // Medium power state
1792     RIL_DC_POWER_STATE_HIGH     = 3,        // High power state
1793     RIL_DC_POWER_STATE_UNKNOWN  = INT32_MAX // Unknown state
1794 } RIL_DcPowerStates;
1795
1796 /**
1797  * Data connection real time info
1798  */
1799 typedef struct {
1800     uint64_t                    time;       // Time in nanos as returned by ril_nano_time
1801     RIL_DcPowerStates           powerState; // Current power state
1802 } RIL_DcRtInfo;
1803
1804 /**
1805  * Data profile to modem
1806  */
1807 typedef struct {
1808     /* id of the data profile */
1809     int profileId;
1810     /* the APN to connect to */
1811     char* apn;
1812     /** one of the PDP_type values in TS 27.007 section 10.1.1.
1813      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
1814      */
1815     char* protocol;
1816     /** authentication protocol used for this PDP context
1817      * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
1818      */
1819     int authType;
1820     /* the username for APN, or NULL */
1821     char* user;
1822     /* the password for APN, or NULL */
1823     char* password;
1824     /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */
1825     int type;
1826     /* the period in seconds to limit the maximum connections */
1827     int maxConnsTime;
1828     /* the maximum connections during maxConnsTime */
1829     int maxConns;
1830     /** the required wait time in seconds after a successful UE initiated
1831      * disconnect of a given PDN connection before the device can send
1832      * a new PDN connection request for that given PDN
1833      */
1834     int waitTime;
1835     /* true to enable the profile, 0 to disable, 1 to enable */
1836     int enabled;
1837 } RIL_DataProfileInfo;
1838
1839 typedef struct {
1840     /* id of the data profile */
1841     int profileId;
1842     /* the APN to connect to */
1843     char* apn;
1844     /** one of the PDP_type values in TS 27.007 section 10.1.1.
1845      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
1846      */
1847     char* protocol;
1848     /** one of the PDP_type values in TS 27.007 section 10.1.1 used on roaming network.
1849      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
1850      */
1851     char *roamingProtocol;
1852     /** authentication protocol used for this PDP context
1853      * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
1854      */
1855     int authType;
1856     /* the username for APN, or NULL */
1857     char* user;
1858     /* the password for APN, or NULL */
1859     char* password;
1860     /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */
1861     int type;
1862     /* the period in seconds to limit the maximum connections */
1863     int maxConnsTime;
1864     /* the maximum connections during maxConnsTime */
1865     int maxConns;
1866     /** the required wait time in seconds after a successful UE initiated
1867      * disconnect of a given PDN connection before the device can send
1868      * a new PDN connection request for that given PDN
1869      */
1870     int waitTime;
1871     /* true to enable the profile, 0 to disable, 1 to enable */
1872     int enabled;
1873     /* supported APN types bitmask. See RIL_ApnTypes for the value of each bit. */
1874     int supportedTypesBitmask;
1875     /** the bearer bitmask. See RIL_RadioAccessFamily for the value of each bit. */
1876     int bearerBitmask;
1877     /** maximum transmission unit (MTU) size in bytes */
1878     int mtu;
1879     /** the MVNO type: possible values are "imsi", "gid", "spn" */
1880     char *mvnoType;
1881     /** MVNO match data. Can be anything defined by the carrier. For example,
1882      *        SPN like: "A MOBILE", "BEN NL", etc...
1883      *        IMSI like: "302720x94", "2060188", etc...
1884      *        GID like: "4E", "33", etc...
1885      */
1886     char *mvnoMatchData;
1887 } RIL_DataProfileInfo_v15;
1888
1889 /* Tx Power Levels */
1890 #define RIL_NUM_TX_POWER_LEVELS     5
1891
1892 /**
1893  * Aggregate modem activity information
1894  */
1895 typedef struct {
1896
1897   /* total time (in ms) when modem is in a low power or
1898    * sleep state
1899    */
1900   uint32_t sleep_mode_time_ms;
1901
1902   /* total time (in ms) when modem is awake but neither
1903    * the transmitter nor receiver are active/awake */
1904   uint32_t idle_mode_time_ms;
1905
1906   /* total time (in ms) during which the transmitter is active/awake,
1907    * subdivided by manufacturer-defined device-specific
1908    * contiguous increasing ranges of transmit power between
1909    * 0 and the transmitter's maximum transmit power.
1910    */
1911   uint32_t tx_mode_time_ms[RIL_NUM_TX_POWER_LEVELS];
1912
1913   /* total time (in ms) for which receiver is active/awake and
1914    * the transmitter is inactive */
1915   uint32_t rx_mode_time_ms;
1916 } RIL_ActivityStatsInfo;
1917
1918 typedef enum {
1919     RIL_APN_TYPE_UNKNOWN      = 0x0,          // Unknown
1920     RIL_APN_TYPE_DEFAULT      = 0x1,          // APN type for default data traffic
1921     RIL_APN_TYPE_MMS          = 0x2,          // APN type for MMS traffic
1922     RIL_APN_TYPE_SUPL         = 0x4,          // APN type for SUPL assisted GPS
1923     RIL_APN_TYPE_DUN          = 0x8,          // APN type for DUN traffic
1924     RIL_APN_TYPE_HIPRI        = 0x10,         // APN type for HiPri traffic
1925     RIL_APN_TYPE_FOTA         = 0x20,         // APN type for FOTA
1926     RIL_APN_TYPE_IMS          = 0x40,         // APN type for IMS
1927     RIL_APN_TYPE_CBS          = 0x80,         // APN type for CBS
1928     RIL_APN_TYPE_IA           = 0x100,        // APN type for IA Initial Attach APN
1929     RIL_APN_TYPE_EMERGENCY    = 0x200,        // APN type for Emergency PDN. This is not an IA apn,
1930                                               // but is used for access to carrier services in an
1931                                               // emergency call situation.
1932     RIL_APN_TYPE_ALL          = 0xFFFFFFFF    // All APN types
1933 } RIL_ApnTypes;
1934
1935 typedef enum {
1936     RIL_DST_POWER_SAVE_MODE,        // Device power save mode (provided by PowerManager)
1937                                     // Non-zero value indicates the device is in power save mode.
1938     RIL_DST_CHARGING_STATE,         // Device charging state (provided by BatteryManager)
1939                                     // Non-zero value indicates the device is charging.
1940     RIL_DST_LOW_DATA_EXPECTED       // Low data expected mode. Non-zero value indicates low data
1941                                     // traffic is expected, for example, when the device is idle
1942                                     // (e.g. not doing tethering in the background). Note
1943                                     // this doesn't mean no data is expected.
1944 } RIL_DeviceStateType;
1945
1946 typedef enum {
1947     RIL_UR_SIGNAL_STRENGTH            = 0x01, // When this bit is set, modem should always send the
1948                                               // signal strength update through
1949                                               // RIL_UNSOL_SIGNAL_STRENGTH, otherwise suppress it.
1950     RIL_UR_FULL_NETWORK_STATE         = 0x02, // When this bit is set, modem should always send
1951                                               // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
1952                                               // when any field in
1953                                               // RIL_REQUEST_VOICE_REGISTRATION_STATE or
1954                                               // RIL_REQUEST_DATA_REGISTRATION_STATE changes. When
1955                                               // this bit is not set, modem should suppress
1956                                               // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
1957                                               // only when insignificant fields change
1958                                               // (e.g. cell info).
1959                                               // Modem should continue sending
1960                                               // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
1961                                               // when significant fields are updated even when this
1962                                               // bit is not set. The following fields are
1963                                               // considered significant, registration state and
1964                                               // radio technology.
1965     RIL_UR_DATA_CALL_DORMANCY_CHANGED = 0x04  // When this bit is set, modem should send the data
1966                                               // call list changed unsolicited response
1967                                               // RIL_UNSOL_DATA_CALL_LIST_CHANGED whenever any
1968                                               // field in RIL_Data_Call_Response changes.
1969                                               // Otherwise modem should suppress the unsolicited
1970                                               // response when the only changed field is 'active'
1971                                               // (for data dormancy). For all other fields change,
1972                                               // modem should continue sending
1973                                               // RIL_UNSOL_DATA_CALL_LIST_CHANGED regardless this
1974                                               // bit is set or not.
1975 } RIL_UnsolicitedResponseFilter;
1976
1977 /**
1978  * RIL_REQUEST_GET_SIM_STATUS
1979  *
1980  * Requests status of the SIM interface and the SIM card
1981  *
1982  * "data" is NULL
1983  *
1984  * "response" is const RIL_CardStatus_v6 *
1985  *
1986  * Valid errors:
1987  *  Must never fail
1988  */
1989 #define RIL_REQUEST_GET_SIM_STATUS 1
1990
1991 /**
1992  * RIL_REQUEST_ENTER_SIM_PIN
1993  *
1994  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
1995  *
1996  * "data" is const char **
1997  * ((const char **)data)[0] is PIN value
1998  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1999  *
2000  * "response" is int *
2001  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2002  *
2003  * Valid errors:
2004  *
2005  * SUCCESS
2006  * RADIO_NOT_AVAILABLE (radio resetting)
2007  * GENERIC_FAILURE
2008  * PASSWORD_INCORRECT
2009  */
2010
2011 #define RIL_REQUEST_ENTER_SIM_PIN 2
2012
2013 /**
2014  * RIL_REQUEST_ENTER_SIM_PUK
2015  *
2016  * Supplies SIM PUK and new PIN.
2017  *
2018  * "data" is const char **
2019  * ((const char **)data)[0] is PUK value
2020  * ((const char **)data)[1] is new PIN value
2021  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2022  *
2023  * "response" is int *
2024  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2025  *
2026  * Valid errors:
2027  *
2028  *  SUCCESS
2029  *  RADIO_NOT_AVAILABLE (radio resetting)
2030  *  GENERIC_FAILURE
2031  *  PASSWORD_INCORRECT
2032  *     (PUK is invalid)
2033  */
2034
2035 #define RIL_REQUEST_ENTER_SIM_PUK 3
2036
2037 /**
2038  * RIL_REQUEST_ENTER_SIM_PIN2
2039  *
2040  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
2041  * returned as a a failure from a previous operation.
2042  *
2043  * "data" is const char **
2044  * ((const char **)data)[0] is PIN2 value
2045  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2046  *
2047  * "response" is int *
2048  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2049  *
2050  * Valid errors:
2051  *
2052  *  SUCCESS
2053  *  RADIO_NOT_AVAILABLE (radio resetting)
2054  *  GENERIC_FAILURE
2055  *  PASSWORD_INCORRECT
2056  */
2057
2058 #define RIL_REQUEST_ENTER_SIM_PIN2 4
2059
2060 /**
2061  * RIL_REQUEST_ENTER_SIM_PUK2
2062  *
2063  * Supplies SIM PUK2 and new PIN2.
2064  *
2065  * "data" is const char **
2066  * ((const char **)data)[0] is PUK2 value
2067  * ((const char **)data)[1] is new PIN2 value
2068  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2069  *
2070  * "response" is int *
2071  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2072  *
2073  * Valid errors:
2074  *
2075  *  SUCCESS
2076  *  RADIO_NOT_AVAILABLE (radio resetting)
2077  *  GENERIC_FAILURE
2078  *  PASSWORD_INCORRECT
2079  *     (PUK2 is invalid)
2080  */
2081
2082 #define RIL_REQUEST_ENTER_SIM_PUK2 5
2083
2084 /**
2085  * RIL_REQUEST_CHANGE_SIM_PIN
2086  *
2087  * Supplies old SIM PIN and new PIN.
2088  *
2089  * "data" is const char **
2090  * ((const char **)data)[0] is old PIN value
2091  * ((const char **)data)[1] is new PIN value
2092  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2093  *
2094  * "response" is int *
2095  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2096  *
2097  * Valid errors:
2098  *
2099  *  SUCCESS
2100  *  RADIO_NOT_AVAILABLE (radio resetting)
2101  *  GENERIC_FAILURE
2102  *  PASSWORD_INCORRECT
2103  *     (old PIN is invalid)
2104  *
2105  */
2106
2107 #define RIL_REQUEST_CHANGE_SIM_PIN 6
2108
2109
2110 /**
2111  * RIL_REQUEST_CHANGE_SIM_PIN2
2112  *
2113  * Supplies old SIM PIN2 and new PIN2.
2114  *
2115  * "data" is const char **
2116  * ((const char **)data)[0] is old PIN2 value
2117  * ((const char **)data)[1] is new PIN2 value
2118  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2119  *
2120  * "response" is int *
2121  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2122  *
2123  * Valid errors:
2124  *
2125  *  SUCCESS
2126  *  RADIO_NOT_AVAILABLE (radio resetting)
2127  *  GENERIC_FAILURE
2128  *  PASSWORD_INCORRECT
2129  *     (old PIN2 is invalid)
2130  *
2131  */
2132
2133 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
2134
2135 /**
2136  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
2137  *
2138  * Requests that network personlization be deactivated
2139  *
2140  * "data" is const char **
2141  * ((const char **)(data))[0]] is network depersonlization code
2142  *
2143  * "response" is int *
2144  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2145  *
2146  * Valid errors:
2147  *
2148  *  SUCCESS
2149  *  RADIO_NOT_AVAILABLE (radio resetting)
2150  *  GENERIC_FAILURE
2151  *  PASSWORD_INCORRECT
2152  *     (code is invalid)
2153  */
2154
2155 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
2156
2157 /**
2158  * RIL_REQUEST_GET_CURRENT_CALLS
2159  *
2160  * Requests current call list
2161  *
2162  * "data" is NULL
2163  *
2164  * "response" must be a "const RIL_Call **"
2165  *
2166  * Valid errors:
2167  *
2168  *  SUCCESS
2169  *  RADIO_NOT_AVAILABLE (radio resetting)
2170  *  NO_MEMORY
2171  *  GENERIC_FAILURE
2172  *      (request will be made again in a few hundred msec)
2173  */
2174
2175 #define RIL_REQUEST_GET_CURRENT_CALLS 9
2176
2177
2178 /**
2179  * RIL_REQUEST_DIAL
2180  *
2181  * Initiate voice call
2182  *
2183  * "data" is const RIL_Dial *
2184  * "response" is NULL
2185  *
2186  * This method is never used for supplementary service codes
2187  *
2188  * Valid errors:
2189  *  SUCCESS
2190  *  RADIO_NOT_AVAILABLE (radio resetting)
2191  *  DIAL_MODIFIED_TO_USSD
2192  *  DIAL_MODIFIED_TO_SS
2193  *  DIAL_MODIFIED_TO_DIAL
2194  *  INVALID_ARGUMENTS
2195  *  NO_MEMORY
2196  *  INVALID_STATE
2197  *  NO_RESOURCES
2198  *  INTERNAL_ERR
2199  *  FDN_CHECK_FAILURE
2200  *  MODEM_ERR
2201  *  NO_SUBSCRIPTION
2202  *  NO_NETWORK_FOUND
2203  *  INVALID_CALL_ID
2204  *  DEVICE_IN_USE
2205  *  MODE_NOT_SUPPORTED
2206  *  ABORTED
2207  *  GENERIC_FAILURE
2208  */
2209 #define RIL_REQUEST_DIAL 10
2210
2211 /**
2212  * RIL_REQUEST_GET_IMSI
2213  *
2214  * Get the SIM IMSI
2215  *
2216  * Only valid when radio state is "RADIO_STATE_ON"
2217  *
2218  * "data" is const char **
2219  * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2220  * "response" is a const char * containing the IMSI
2221  *
2222  * Valid errors:
2223  *  SUCCESS
2224  *  RADIO_NOT_AVAILABLE (radio resetting)
2225  *  GENERIC_FAILURE
2226  */
2227
2228 #define RIL_REQUEST_GET_IMSI 11
2229
2230 /**
2231  * RIL_REQUEST_HANGUP
2232  *
2233  * Hang up a specific line (like AT+CHLD=1x)
2234  *
2235  * After this HANGUP request returns, RIL should show the connection is NOT
2236  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
2237  *
2238  * "data" is an int *
2239  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
2240  *
2241  * "response" is NULL
2242  *
2243  * Valid errors:
2244  *  SUCCESS
2245  *  RADIO_NOT_AVAILABLE (radio resetting)
2246  *  INVALID_ARGUMENTS
2247  *  NO_MEMORY
2248  *  INVALID_STATE
2249  *  MODEM_ERR
2250  *  INTERNAL_ERR
2251  *  NO_MEMORY
2252  *  INVALID_CALL_ID
2253  *  INVALID_ARGUMENTS
2254  *  GENERIC_FAILURE
2255  */
2256
2257 #define RIL_REQUEST_HANGUP 12
2258
2259 /**
2260  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
2261  *
2262  * Hang up waiting or held (like AT+CHLD=0)
2263  *
2264  * After this HANGUP request returns, RIL should show the connection is NOT
2265  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
2266  *
2267  * "data" is NULL
2268  * "response" is NULL
2269  *
2270  * Valid errors:
2271  *  SUCCESS
2272  *  RADIO_NOT_AVAILABLE (radio resetting)
2273  *  INVALID_STATE
2274  *  NO_MEMORY
2275  *  MODEM_ERR
2276  *  INTERNAL_ERR
2277  *  NO_MEMORY
2278  *  INVALID_CALL_ID
2279  *  NO_RESOURCES
2280  *  OPERATION_NOT_ALLOWED
2281  *  INVALID_ARGUMENTS
2282  *  GENERIC_FAILURE
2283  */
2284
2285 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
2286
2287 /**
2288  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
2289  *
2290  * Hang up waiting or held (like AT+CHLD=1)
2291  *
2292  * After this HANGUP request returns, RIL should show the connection is NOT
2293  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
2294  *
2295  * "data" is NULL
2296  * "response" is NULL
2297  *
2298  * Valid errors:
2299  *  SUCCESS
2300  *  RADIO_NOT_AVAILABLE (radio resetting)
2301  *  INVALID_STATE
2302  *  NO_MEMORY
2303  *  MODEM_ERR
2304  *  INTERNAL_ERR
2305  *  INVALID_CALL_ID
2306  *  OPERATION_NOT_ALLOWED
2307  *  INVALID_ARGUMENTS
2308  *  NO_RESOURCES
2309  *  GENERIC_FAILURE
2310  */
2311
2312 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
2313
2314 /**
2315  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
2316  *
2317  * Switch waiting or holding call and active call (like AT+CHLD=2)
2318  *
2319  * State transitions should be is follows:
2320  *
2321  * If call 1 is waiting and call 2 is active, then if this re
2322  *
2323  *   BEFORE                               AFTER
2324  * Call 1   Call 2                 Call 1       Call 2
2325  * ACTIVE   HOLDING                HOLDING     ACTIVE
2326  * ACTIVE   WAITING                HOLDING     ACTIVE
2327  * HOLDING  WAITING                HOLDING     ACTIVE
2328  * ACTIVE   IDLE                   HOLDING     IDLE
2329  * IDLE     IDLE                   IDLE        IDLE
2330  *
2331  * "data" is NULL
2332  * "response" is NULL
2333  *
2334  * Valid errors:
2335  *  SUCCESS
2336  *  RADIO_NOT_AVAILABLE (radio resetting)
2337  *  INVALID_STATE
2338  *  NO_MEMORY
2339  *  MODEM_ERR
2340  *  INTERNAL_ERR
2341  *  INVALID_STATE
2342  *  INVALID_ARGUMENTS
2343  *  INVALID_CALL_ID
2344  *  OPERATION_NOT_ALLOWED
2345  *  GENERIC_FAILURE
2346  */
2347
2348 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
2349 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
2350
2351 /**
2352  * RIL_REQUEST_CONFERENCE
2353  *
2354  * Conference holding and active (like AT+CHLD=3)
2355
2356  * "data" is NULL
2357  * "response" is NULL
2358  *
2359  * Valid errors:
2360  *  SUCCESS
2361  *  RADIO_NOT_AVAILABLE (radio resetting)
2362  *  NO_MEMORY
2363  *  MODEM_ERR
2364  *  INTERNAL_ERR
2365  *  INVALID_STATE
2366  *  INVALID_CALL_ID
2367  *  INVALID_ARGUMENTS
2368  *  OPERATION_NOT_ALLOWED
2369  *  GENERIC_FAILURE
2370  */
2371 #define RIL_REQUEST_CONFERENCE 16
2372
2373 /**
2374  * RIL_REQUEST_UDUB
2375  *
2376  * Send UDUB (user determined used busy) to ringing or
2377  * waiting call answer)(RIL_BasicRequest r);
2378  *
2379  * "data" is NULL
2380  * "response" is NULL
2381  *
2382  * Valid errors:
2383  *  SUCCESS
2384  *  RADIO_NOT_AVAILABLE (radio resetting)
2385  *  INVALID_STATE
2386  *  NO_RESOURCES
2387  *  NO_MEMORY
2388  *  MODEM_ERR
2389  *  INTERNAL_ERR
2390  *  INVALID_CALL_ID
2391  *  OPERATION_NOT_ALLOWED
2392  *  INVALID_ARGUMENTS
2393  *  GENERIC_FAILURE
2394  */
2395 #define RIL_REQUEST_UDUB 17
2396
2397 /**
2398  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
2399  *
2400  * Requests the failure cause code for the most recently terminated call
2401  *
2402  * "data" is NULL
2403  * "response" is a "int *"
2404  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
2405  * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
2406  * failure reasons are derived from the possible call failure scenarios
2407  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
2408  *
2409  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
2410  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
2411  *
2412  * If the implementation does not have access to the exact cause codes,
2413  * then it should return one of the values listed in RIL_LastCallFailCause,
2414  * as the UI layer needs to distinguish these cases for tone generation or
2415  * error notification.
2416  *
2417  * Valid errors:
2418  *  SUCCESS
2419  *  RADIO_NOT_AVAILABLE
2420  *  NO_MEMORY
2421  *  GENERIC_FAILURE
2422  *
2423  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
2424  */
2425 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
2426
2427 /**
2428  * RIL_REQUEST_SIGNAL_STRENGTH
2429  *
2430  * Requests current signal strength and associated information
2431  *
2432  * Must succeed if radio is on.
2433  *
2434  * "data" is NULL
2435  *
2436  * "response" is a const RIL_SignalStrength *
2437  *
2438  * Valid errors:
2439  *  SUCCESS
2440  *  RADIO_NOT_AVAILABLE
2441  */
2442 #define RIL_REQUEST_SIGNAL_STRENGTH 19
2443
2444 /**
2445  * RIL_REQUEST_VOICE_REGISTRATION_STATE
2446  *
2447  * Request current registration state
2448  *
2449  * "data" is NULL
2450  * "response" is a const RIL_VoiceRegistrationStateResponse *
2451  *
2452  * Valid errors:
2453  *  SUCCESS
2454  *  RADIO_NOT_AVAILABLE
2455  *  GENERIC_FAILURE
2456  */
2457 #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
2458
2459 /**
2460  * RIL_REQUEST_DATA_REGISTRATION_STATE
2461  *
2462  * Request current DATA registration state
2463  *
2464  * "data" is NULL
2465  * "response" is a const RIL_DataRegistrationStateResponse *
2466  *
2467  * Valid errors:
2468  *  SUCCESS
2469  *  RADIO_NOT_AVAILABLE
2470  *  GENERIC_FAILURE
2471  */
2472 #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
2473
2474 /**
2475  * RIL_REQUEST_OPERATOR
2476  *
2477  * Request current operator ONS or EONS
2478  *
2479  * "data" is NULL
2480  * "response" is a "const char **"
2481  * ((const char **)response)[0] is long alpha ONS or EONS
2482  *                                  or NULL if unregistered
2483  *
2484  * ((const char **)response)[1] is short alpha ONS or EONS
2485  *                                  or NULL if unregistered
2486  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
2487  *                                  or NULL if unregistered
2488  *
2489  * Valid errors:
2490  *  SUCCESS
2491  *  RADIO_NOT_AVAILABLE
2492  *  GENERIC_FAILURE
2493  */
2494 #define RIL_REQUEST_OPERATOR 22
2495
2496 /**
2497  * RIL_REQUEST_RADIO_POWER
2498  *
2499  * Toggle radio on and off (for "airplane" mode)
2500  * If the radio is is turned off/on the radio modem subsystem
2501  * is expected return to an initialized state. For instance,
2502  * any voice and data calls will be terminated and all associated
2503  * lists emptied.
2504  *
2505  * "data" is int *
2506  * ((int *)data)[0] is > 0 for "Radio On"
2507  * ((int *)data)[0] is == 0 for "Radio Off"
2508  *
2509  * "response" is NULL
2510  *
2511  * Turn radio on if "on" > 0
2512  * Turn radio off if "on" == 0
2513  *
2514  * Valid errors:
2515  *  SUCCESS
2516  *  RADIO_NOT_AVAILABLE
2517  *  OPERATION_NOT_ALLOWED
2518  *  GENERIC_FAILURE
2519  */
2520 #define RIL_REQUEST_RADIO_POWER 23
2521
2522 /**
2523  * RIL_REQUEST_DTMF
2524  *
2525  * Send a DTMF tone
2526  *
2527  * If the implementation is currently playing a tone requested via
2528  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
2529  * should be played instead
2530  *
2531  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
2532  * "response" is NULL
2533  *
2534  * FIXME should this block/mute microphone?
2535  * How does this interact with local DTMF feedback?
2536  *
2537  * Valid errors:
2538  *  SUCCESS
2539  *  RADIO_NOT_AVAILABLE
2540  *  INVALID_ARGUMENTS
2541  *  NO_RESOURCES
2542  *  NO_MEMORY
2543  *  MODEM_ERR
2544  *  INTERNAL_ERR
2545  *  INVALID_CALL_ID
2546  *  GENERIC_FAILURE
2547  *
2548  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
2549  *
2550  */
2551 #define RIL_REQUEST_DTMF 24
2552
2553 /**
2554  * RIL_REQUEST_SEND_SMS
2555  *
2556  * Send an SMS message
2557  *
2558  * "data" is const char **
2559  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
2560  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
2561  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
2562  *      less the SMSC address
2563  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
2564  *
2565  * "response" is a const RIL_SMS_Response *
2566  *
2567  * Based on the return error, caller decides to resend if sending sms
2568  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
2569  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
2570  *
2571  * Valid errors:
2572  *  SUCCESS
2573  *  RADIO_NOT_AVAILABLE
2574  *  SMS_SEND_FAIL_RETRY
2575  *  FDN_CHECK_FAILURE
2576  *  NETWORK_REJECT
2577  *  INVALID_STATE
2578  *  INVALID_ARGUMENTS
2579  *  NO_MEMORY
2580  *  REQUEST_RATE_LIMITED
2581  *  INVALID_SMS_FORMAT
2582  *  SYSTEM_ERR
2583  *  ENCODING_ERR
2584  *  INVALID_SMSC_ADDRESS
2585  *  MODEM_ERR
2586  *  NETWORK_ERR
2587  *  MODE_NOT_SUPPORTED
2588  *  GENERIC_FAILURE
2589  *
2590  * FIXME how do we specify TP-Message-Reference if we need to resend?
2591  */
2592 #define RIL_REQUEST_SEND_SMS 25
2593
2594
2595 /**
2596  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
2597  *
2598  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
2599  * except that more messages are expected to be sent soon. If possible,
2600  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
2601  *
2602  * "data" is const char **
2603  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
2604  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
2605  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
2606  *      less the SMSC address
2607  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
2608  *
2609  * "response" is a const RIL_SMS_Response *
2610  *
2611  * Based on the return error, caller decides to resend if sending sms
2612  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
2613  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
2614  *
2615  * Valid errors:
2616  *  SUCCESS
2617  *  RADIO_NOT_AVAILABLE
2618  *  SMS_SEND_FAIL_RETRY
2619  *  NETWORK_REJECT
2620  *  INVALID_STATE
2621  *  INVALID_ARGUMENTS
2622  *  NO_MEMORY
2623  *  INVALID_SMS_FORMAT
2624  *  SYSTEM_ERR
2625  *  REQUEST_RATE_LIMITED
2626  *  FDN_CHECK_FAILURE
2627  *  MODEM_ERR
2628  *  NETWORK_ERR
2629  *  ENCODING_ERR
2630  *  INVALID_SMSC_ADDRESS
2631  *  MODE_NOT_SUPPORTED
2632  *  GENERIC_FAILURE
2633  *
2634  */
2635 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
2636
2637
2638 /**
2639  * RIL_REQUEST_SETUP_DATA_CALL
2640  *
2641  * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
2642  * return success it is added to the list of data calls and a
2643  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
2644  * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
2645  * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
2646  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
2647  *
2648  * The RIL is expected to:
2649  *  - Create one data call context.
2650  *  - Create and configure a dedicated interface for the context
2651  *  - The interface must be point to point.
2652  *  - The interface is configured with one or more addresses and
2653  *    is capable of sending and receiving packets. The prefix length
2654  *    of the addresses must be /32 for IPv4 and /128 for IPv6.
2655  *  - Must NOT change the linux routing table.
2656  *  - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
2657  *    number of simultaneous data call contexts.
2658  *
2659  * "data" is a const char **
2660  * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
2661  *                          for values above 2 this is RIL_RadioTechnology + 2.
2662  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
2663  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
2664  *                          override the one in the profile. NULL indicates no APN overrride.
2665  * ((const char **)data)[3] is the username for APN, or NULL
2666  * ((const char **)data)[4] is the password for APN, or NULL
2667  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
2668  *                          0 => PAP and CHAP is never performed.
2669  *                          1 => PAP may be performed; CHAP is never performed.
2670  *                          2 => CHAP may be performed; PAP is never performed.
2671  *                          3 => PAP / CHAP may be performed - baseband dependent.
2672  * ((const char **)data)[6] is the non-roaming/home connection type to request. Must be one of the
2673  *                          PDP_type values in TS 27.007 section 10.1.1.
2674  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
2675  * ((const char **)data)[7] is the roaming connection type to request. Must be one of the
2676  *                          PDP_type values in TS 27.007 section 10.1.1.
2677  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
2678  * ((const char **)data)[8] is the bitmask of APN type in decimal string format. The
2679  *                          bitmask will encapsulate the following values:
2680  *                          ia,mms,agps,supl,hipri,fota,dun,ims,default.
2681  * ((const char **)data)[9] is the bearer bitmask in decimal string format. Each bit is a
2682  *                          RIL_RadioAccessFamily. "0" or NULL indicates all RATs.
2683  * ((const char **)data)[10] is the boolean in string format indicating the APN setting was
2684  *                           sent to the modem through RIL_REQUEST_SET_DATA_PROFILE earlier.
2685  * ((const char **)data)[11] is the mtu size in bytes of the mobile interface to which
2686  *                           the apn is connected.
2687  * ((const char **)data)[12] is the MVNO type:
2688  *                           possible values are "imsi", "gid", "spn".
2689  * ((const char **)data)[13] is MVNO match data in string. Can be anything defined by the carrier.
2690  *                           For example,
2691  *                           SPN like: "A MOBILE", "BEN NL", etc...
2692  *                           IMSI like: "302720x94", "2060188", etc...
2693  *                           GID like: "4E", "33", etc...
2694  * ((const char **)data)[14] is the boolean string indicating data roaming is allowed or not. "1"
2695  *                           indicates data roaming is enabled by the user, "0" indicates disabled.
2696  *
2697  * "response" is a RIL_Data_Call_Response_v11
2698  *
2699  * FIXME may need way to configure QoS settings
2700  *
2701  * Valid errors:
2702  *  SUCCESS should be returned on both success and failure of setup with
2703  *  the RIL_Data_Call_Response_v6.status containing the actual status.
2704  *  For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
2705  *
2706  *  Other errors could include:
2707  *    RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
2708  *    OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED.
2709  *
2710  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
2711  */
2712 #define RIL_REQUEST_SETUP_DATA_CALL 27
2713
2714
2715 /**
2716  * RIL_REQUEST_SIM_IO
2717  *
2718  * Request SIM I/O operation.
2719  * This is similar to the TS 27.007 "restricted SIM" operation
2720  * where it assumes all of the EF selection will be done by the
2721  * callee.
2722  *
2723  * "data" is a const RIL_SIM_IO_v6 *
2724  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
2725  * or may specify a PIN2 for operations that require a PIN2 (eg
2726  * updating FDN records)
2727  *
2728  * "response" is a const RIL_SIM_IO_Response *
2729  *
2730  * Arguments and responses that are unused for certain
2731  * values of "command" should be ignored or set to NULL
2732  *
2733  * Valid errors:
2734  *  SUCCESS
2735  *  RADIO_NOT_AVAILABLE
2736  *  GENERIC_FAILURE
2737  *  SIM_PIN2
2738  *  SIM_PUK2
2739  */
2740 #define RIL_REQUEST_SIM_IO 28
2741
2742 /**
2743  * RIL_REQUEST_SEND_USSD
2744  *
2745  * Send a USSD message
2746  *
2747  * If a USSD session already exists, the message should be sent in the
2748  * context of that session. Otherwise, a new session should be created.
2749  *
2750  * The network reply should be reported via RIL_UNSOL_ON_USSD
2751  *
2752  * Only one USSD session may exist at a time, and the session is assumed
2753  * to exist until:
2754  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
2755  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
2756  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
2757  *
2758  * "data" is a const char * containing the USSD request in UTF-8 format
2759  * "response" is NULL
2760  *
2761  * Valid errors:
2762  *  SUCCESS
2763  *  RADIO_NOT_AVAILABLE
2764  *  FDN_CHECK_FAILURE
2765  *  USSD_MODIFIED_TO_DIAL
2766  *  USSD_MODIFIED_TO_SS
2767  *  USSD_MODIFIED_TO_USSD
2768  *  SIM_BUSY
2769  *  OPERATION_NOT_ALLOWED
2770  *  INVALID_ARGUMENTS
2771  *  NO_MEMORY
2772  *  MODEM_ERR
2773  *  INTERNAL_ERR
2774  *  ABORTED
2775  *  SYSTEM_ERR
2776  *  INVALID_STATE
2777  *  GENERIC_FAILURE
2778  *
2779  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
2780  */
2781
2782 #define RIL_REQUEST_SEND_USSD 29
2783
2784 /**
2785  * RIL_REQUEST_CANCEL_USSD
2786  *
2787  * Cancel the current USSD session if one exists
2788  *
2789  * "data" is null
2790  * "response" is NULL
2791  *
2792  * Valid errors:
2793  *  SUCCESS
2794  *  RADIO_NOT_AVAILABLE
2795  *  SIM_BUSY
2796  *  OPERATION_NOT_ALLOWED
2797  *  MODEM_ERR
2798  *  INTERNAL_ERR
2799  *  NO_MEMORY
2800  *  INVALID_STATE
2801  *  GENERIC_FAILURE
2802  */
2803
2804 #define RIL_REQUEST_CANCEL_USSD 30
2805
2806 /**
2807  * RIL_REQUEST_GET_CLIR
2808  *
2809  * Gets current CLIR status
2810  * "data" is NULL
2811  * "response" is int *
2812  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
2813  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
2814  *
2815  * Valid errors:
2816  *  SUCCESS
2817  *  RADIO_NOT_AVAILABLE
2818  *  SS_MODIFIED_TO_DIAL
2819  *  SS_MODIFIED_TO_USSD
2820  *  SS_MODIFIED_TO_SS
2821  *  NO_MEMORY
2822  *  MODEM_ERR
2823  *  INTERNAL_ERR
2824  *  FDN_CHECK_FAILURE
2825  *  SYSTEM_ERR
2826  *  GENERIC_FAILURE
2827  */
2828 #define RIL_REQUEST_GET_CLIR 31
2829
2830 /**
2831  * RIL_REQUEST_SET_CLIR
2832  *
2833  * "data" is int *
2834  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
2835  *
2836  * "response" is NULL
2837  *
2838  * Valid errors:
2839  *  SUCCESS
2840  *  RADIO_NOT_AVAILABLE
2841  *  SS_MODIFIED_TO_DIAL
2842  *  SS_MODIFIED_TO_USSD
2843  *  SS_MODIFIED_TO_SS
2844  *  INVALID_ARGUMENTS
2845  *  SYSTEM_ERR
2846  *  GENERIC_FAILURE
2847  */
2848 #define RIL_REQUEST_SET_CLIR 32
2849
2850 /**
2851  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
2852  *
2853  * "data" is const RIL_CallForwardInfo *
2854  *
2855  * "response" is const RIL_CallForwardInfo **
2856  * "response" points to an array of RIL_CallForwardInfo *'s, one for
2857  * each distinct registered phone number.
2858  *
2859  * For example, if data is forwarded to +18005551212 and voice is forwarded
2860  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
2861  *
2862  * If, however, both data and voice are forwarded to +18005551212, then
2863  * a single RIL_CallForwardInfo can be returned with the service class
2864  * set to "data + voice = 3")
2865  *
2866  * Valid errors:
2867  *  SUCCESS
2868  *  RADIO_NOT_AVAILABLE
2869  *  SS_MODIFIED_TO_DIAL
2870  *  SS_MODIFIED_TO_USSD
2871  *  SS_MODIFIED_TO_SS
2872  *  INVALID_ARGUMENTS
2873  *  NO_MEMORY
2874  *  SYSTEM_ERR
2875  *  MODEM_ERR
2876  *  INTERNAL_ERR
2877  *  NO_MEMORY
2878  *  FDN_CHECK_FAILURE
2879  *  GENERIC_FAILURE
2880  */
2881 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
2882
2883
2884 /**
2885  * RIL_REQUEST_SET_CALL_FORWARD
2886  *
2887  * Configure call forward rule
2888  *
2889  * "data" is const RIL_CallForwardInfo *
2890  * "response" is NULL
2891  *
2892  * Valid errors:
2893  *  SUCCESS
2894  *  RADIO_NOT_AVAILABLE
2895  *  SS_MODIFIED_TO_DIAL
2896  *  SS_MODIFIED_TO_USSD
2897  *  SS_MODIFIED_TO_SS
2898  *  INVALID_ARGUMENTS
2899  *  NO_MEMORY
2900  *  SYSTEM_ERR
2901  *  MODEM_ERR
2902  *  INTERNAL_ERR
2903  *  INVALID_STATE
2904  *  FDN_CHECK_FAILURE
2905  *  GENERIC_FAILURE
2906  */
2907 #define RIL_REQUEST_SET_CALL_FORWARD 34
2908
2909
2910 /**
2911  * RIL_REQUEST_QUERY_CALL_WAITING
2912  *
2913  * Query current call waiting state
2914  *
2915  * "data" is const int *
2916  * ((const int *)data)[0] is the TS 27.007 service class to query.
2917  * "response" is a const int *
2918  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
2919  *
2920  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
2921  * must follow, with the TS 27.007 service class bit vector of services
2922  * for which call waiting is enabled.
2923  *
2924  * For example, if ((const int *)response)[0]  is 1 and
2925  * ((const int *)response)[1] is 3, then call waiting is enabled for data
2926  * and voice and disabled for everything else
2927  *
2928  * Valid errors:
2929  *  SUCCESS
2930  *  RADIO_NOT_AVAILABLE
2931  *  SS_MODIFIED_TO_DIAL
2932  *  SS_MODIFIED_TO_USSD
2933  *  SS_MODIFIED_TO_SS
2934  *  NO_MEMORY
2935  *  MODEM_ERR
2936  *  INTERNAL_ERR
2937  *  NO_MEMORY
2938  *  FDN_CHECK_FAILURE
2939  *  INVALID_ARGUMENTS
2940  *  GENERIC_FAILURE
2941  */
2942 #define RIL_REQUEST_QUERY_CALL_WAITING 35
2943
2944
2945 /**
2946  * RIL_REQUEST_SET_CALL_WAITING
2947  *
2948  * Configure current call waiting state
2949  *
2950  * "data" is const int *
2951  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
2952  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
2953  *                           services to modify
2954  * "response" is NULL
2955  *
2956  * Valid errors:
2957  *  SUCCESS
2958  *  RADIO_NOT_AVAILABLE
2959  *  SS_MODIFIED_TO_DIAL
2960  *  SS_MODIFIED_TO_USSD
2961  *  SS_MODIFIED_TO_SS
2962  *  INVALID_ARGUMENTS
2963  *  NO_MEMORY
2964  *  MODEM_ERR
2965  *  INTERNAL_ERR
2966  *  INVALID_STATE
2967  *  FDN_CHECK_FAILURE
2968  *  GENERIC_FAILURE
2969  */
2970 #define RIL_REQUEST_SET_CALL_WAITING 36
2971
2972 /**
2973  * RIL_REQUEST_SMS_ACKNOWLEDGE
2974  *
2975  * Acknowledge successful or failed receipt of SMS previously indicated
2976  * via RIL_UNSOL_RESPONSE_NEW_SMS
2977  *
2978  * "data" is int *
2979  * ((int *)data)[0] is 1 on successful receipt
2980  *                  (basically, AT+CNMA=1 from TS 27.005
2981  *                  is 0 on failed receipt
2982  *                  (basically, AT+CNMA=2 from TS 27.005)
2983  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
2984  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
2985  *                  capacity exceeded) and 0xFF (unspecified error) are
2986  *                  reported.
2987  *
2988  * "response" is NULL
2989  *
2990  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
2991  *
2992  * Valid errors:
2993  *  SUCCESS
2994  *  RADIO_NOT_AVAILABLE
2995  *  GENERIC_FAILURE
2996  */
2997 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
2998
2999 /**
3000  * RIL_REQUEST_GET_IMEI - DEPRECATED
3001  *
3002  * Get the device IMEI, including check digit
3003  *
3004  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
3005  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
3006  *
3007  * "data" is NULL
3008  * "response" is a const char * containing the IMEI
3009  *
3010  * Valid errors:
3011  *  SUCCESS
3012  *  RADIO_NOT_AVAILABLE (radio resetting)
3013  *  GENERIC_FAILURE
3014  */
3015
3016 #define RIL_REQUEST_GET_IMEI 38
3017
3018 /**
3019  * RIL_REQUEST_GET_IMEISV - DEPRECATED
3020  *
3021  * Get the device IMEISV, which should be two decimal digits
3022  *
3023  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
3024  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
3025  *
3026  * "data" is NULL
3027  * "response" is a const char * containing the IMEISV
3028  *
3029  * Valid errors:
3030  *  SUCCESS
3031  *  RADIO_NOT_AVAILABLE (radio resetting)
3032  *  GENERIC_FAILURE
3033  */
3034
3035 #define RIL_REQUEST_GET_IMEISV 39
3036
3037
3038 /**
3039  * RIL_REQUEST_ANSWER
3040  *
3041  * Answer incoming call
3042  *
3043  * Will not be called for WAITING calls.
3044  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
3045  * instead
3046  *
3047  * "data" is NULL
3048  * "response" is NULL
3049  *
3050  * Valid errors:
3051  *  SUCCESS
3052  *  RADIO_NOT_AVAILABLE (radio resetting)
3053  *  INVALID_STATE
3054  *  NO_MEMORY
3055  *  SYSTEM_ERR
3056  *  MODEM_ERR
3057  *  INTERNAL_ERR
3058  *  INVALID_CALL_ID
3059  *  GENERIC_FAILURE
3060  */
3061
3062 #define RIL_REQUEST_ANSWER 40
3063
3064 /**
3065  * RIL_REQUEST_DEACTIVATE_DATA_CALL
3066  *
3067  * Deactivate packet data connection and remove from the
3068  * data call list if SUCCESS is returned. Any other return
3069  * values should also try to remove the call from the list,
3070  * but that may not be possible. In any event a
3071  * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
3072  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
3073  * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
3074  *
3075  * "data" is const char **
3076  * ((char**)data)[0] indicating CID
3077  * ((char**)data)[1] indicating Disconnect Reason
3078  *                   0 => No specific reason specified
3079  *                   1 => Radio shutdown requested
3080  *
3081  * "response" is NULL
3082  *
3083  * Valid errors:
3084  *  SUCCESS
3085  *  RADIO_NOT_AVAILABLE
3086  *  GENERIC_FAILURE
3087  *
3088  * See also: RIL_REQUEST_SETUP_DATA_CALL
3089  */
3090 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
3091
3092 /**
3093  * RIL_REQUEST_QUERY_FACILITY_LOCK
3094  *
3095  * Query the status of a facility lock state
3096  *
3097  * "data" is const char **
3098  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
3099  *                      (eg "AO" for BAOC, "SC" for SIM lock)
3100  * ((const char **)data)[1] is the password, or "" if not required
3101  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
3102  *                           services to query
3103  * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
3104  *                            This is only applicable in the case of Fixed Dialing Numbers
3105  *                            (FDN) requests.
3106  *
3107  * "response" is an int *
3108  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
3109  *                           services for which the specified barring facility
3110  *                           is active. "0" means "disabled for all"
3111  *
3112  *
3113  * Valid errors:
3114  *  SUCCESS
3115  *  RADIO_NOT_AVAILABLE
3116  *  SS_MODIFIED_TO_DIAL
3117  *  SS_MODIFIED_TO_USSD
3118  *  SS_MODIFIED_TO_SS
3119  *  INVALID_ARGUMENTS
3120  *  NO_MEMORY
3121  *  INTERNAL_ERR
3122  *  SYSTEM_ERR
3123  *  MODEM_ERR
3124  *  FDN_CHECK_FAILURE
3125  *  GENERIC_FAILURE
3126  *
3127  */
3128 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
3129
3130 /**
3131  * RIL_REQUEST_SET_FACILITY_LOCK
3132  *
3133  * Enable/disable one facility lock
3134  *
3135  * "data" is const char **
3136  *
3137  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
3138  * (eg "AO" for BAOC)
3139  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
3140  * ((const char **)data)[2] = password
3141  * ((const char **)data)[3] = string representation of decimal TS 27.007
3142  *                            service class bit vector. Eg, the string
3143  *                            "1" means "set this facility for voice services"
3144  * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
3145  *                            This is only applicable in the case of Fixed Dialing Numbers
3146  *                            (FDN) requests.
3147  *
3148  * "response" is int *
3149  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
3150  *
3151  * Valid errors:
3152  *  SUCCESS
3153  *  RADIO_NOT_AVAILABLE
3154  *  SS_MODIFIED_TO_DIAL
3155  *  SS_MODIFIED_TO_USSD
3156  *  SS_MODIFIED_TO_SS
3157  *  INVALID_ARGUMENTS
3158  *  INTERNAL_ERR
3159  *  NO_MEMORY
3160  *  MODEM_ERR
3161  *  INVALID_STATE
3162  *  FDN_CHECK_FAILURE
3163  *  GENERIC_FAILURE
3164  *
3165  */
3166 #define RIL_REQUEST_SET_FACILITY_LOCK 43
3167
3168 /**
3169  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
3170  *
3171  * Change call barring facility password
3172  *
3173  * "data" is const char **
3174  *
3175  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
3176  * (eg "AO" for BAOC)
3177  * ((const char **)data)[1] = old password
3178  * ((const char **)data)[2] = new password
3179  *
3180  * "response" is NULL
3181  *
3182  * Valid errors:
3183  *  SUCCESS
3184  *  RADIO_NOT_AVAILABLE
3185  *  SS_MODIFIED_TO_DIAL
3186  *  SS_MODIFIED_TO_USSD
3187  *  SS_MODIFIED_TO_SS
3188  *  INVALID_ARGUMENTS
3189  *  NO_MEMORY
3190  *  MODEM_ERR
3191  *  INTERNAL_ERR
3192  *  SYSTEM_ERR
3193  *  FDN_CHECK_FAILURE
3194  *  GENERIC_FAILURE
3195  *
3196  */
3197 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
3198
3199 /**
3200  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
3201  *
3202  * Query current network selectin mode
3203  *
3204  * "data" is NULL
3205  *
3206  * "response" is int *
3207  * ((const int *)response)[0] is
3208  *     0 for automatic selection
3209  *     1 for manual selection
3210  *
3211  * Valid errors:
3212  *  SUCCESS
3213  *  RADIO_NOT_AVAILABLE
3214  *  GENERIC_FAILURE
3215  *
3216  */
3217 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
3218
3219 /**
3220  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
3221  *
3222  * Specify that the network should be selected automatically
3223  *
3224  * "data" is NULL
3225  * "response" is NULL
3226  *
3227  * This request must not respond until the new operator is selected
3228  * and registered
3229  *
3230  * Valid errors:
3231  *  SUCCESS
3232  *  RADIO_NOT_AVAILABLE
3233  *  ILLEGAL_SIM_OR_ME
3234  *  OPERATION_NOT_ALLOWED
3235  *  GENERIC_FAILURE
3236  *
3237  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
3238  *       no retries needed, such as illegal SIM or ME.
3239  *       Returns GENERIC_FAILURE for all other causes that might be
3240  *       fixed by retries.
3241  *
3242  */
3243 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
3244
3245 /**
3246  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
3247  *
3248  * Manually select a specified network.
3249  *
3250  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
3251  * "response" is NULL
3252  *
3253  * This request must not respond until the new operator is selected
3254  * and registered
3255  *
3256  * Valid errors:
3257  *  SUCCESS
3258  *  RADIO_NOT_AVAILABLE
3259  *  ILLEGAL_SIM_OR_ME
3260  *  OPERATION_NOT_ALLOWED
3261  *  GENERIC_FAILURE
3262  *
3263  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
3264  *       no retries needed, such as illegal SIM or ME.
3265  *       Returns GENERIC_FAILURE for all other causes that might be
3266  *       fixed by retries.
3267  *
3268  */
3269 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
3270
3271 /**
3272  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
3273  *
3274  * Scans for available networks
3275  *
3276  * "data" is NULL
3277  * "response" is const char ** that should be an array of n*4 strings, where
3278  *    n is the number of available networks
3279  * For each available network:
3280  *
3281  * ((const char **)response)[n+0] is long alpha ONS or EONS
3282  * ((const char **)response)[n+1] is short alpha ONS or EONS
3283  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
3284  * ((const char **)response)[n+3] is a string value of the status:
3285  *           "unknown"
3286  *           "available"
3287  *           "current"
3288  *           "forbidden"
3289  *
3290  * Valid errors:
3291  *  SUCCESS
3292  *  RADIO_NOT_AVAILABLE
3293  *  OPERATION_NOT_ALLOWED
3294  *  ABORTED
3295  *  DEVICE_IN_USE
3296  *  INTERNAL_ERR
3297  *  NO_MEMORY
3298  *  MODEM_ERR
3299  *
3300  */
3301 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
3302
3303 /**
3304  * RIL_REQUEST_DTMF_START
3305  *
3306  * Start playing a DTMF tone. Continue playing DTMF tone until
3307  * RIL_REQUEST_DTMF_STOP is received
3308  *
3309  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
3310  * it should cancel the previous tone and play the new one.
3311  *
3312  * "data" is a char *
3313  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
3314  * "response" is NULL
3315  *
3316  * Valid errors:
3317  *  SUCCESS
3318  *  RADIO_NOT_AVAILABLE
3319  *  INVALID_ARGUMENTS
3320  *  NO_RESOURCES
3321  *  NO_MEMORY
3322  *  SYSTEM_ERR
3323  *  MODEM_ERR
3324  *  INTERNAL_ERR
3325  *  INVALID_CALL_ID
3326  *  GENERIC_FAILURE
3327  *
3328  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
3329  */
3330 #define RIL_REQUEST_DTMF_START 49
3331
3332 /**
3333  * RIL_REQUEST_DTMF_STOP
3334  *
3335  * Stop playing a currently playing DTMF tone.
3336  *
3337  * "data" is NULL
3338  * "response" is NULL
3339  *
3340  * Valid errors:
3341  *  SUCCESS
3342  *  RADIO_NOT_AVAILABLE
3343  *  OPERATION_NOT_ALLOWED
3344  *  NO_RESOURCES
3345  *  NO_MEMORY
3346  *  INVALID_ARGUMENTS
3347  *  SYSTEM_ERR
3348  *  MODEM_ERR
3349  *  INTERNAL_ERR
3350  *  INVALID_CALL_ID
3351  *  GENERIC_FAILURE
3352  *
3353  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
3354  */
3355 #define RIL_REQUEST_DTMF_STOP 50
3356
3357 /**
3358  * RIL_REQUEST_BASEBAND_VERSION
3359  *
3360  * Return string value indicating baseband version, eg
3361  * response from AT+CGMR
3362  *
3363  * "data" is NULL
3364  * "response" is const char * containing version string for log reporting
3365  *
3366  * Valid errors:
3367  *  SUCCESS
3368  *  RADIO_NOT_AVAILABLE
3369  *  EMPTY_RECORD
3370  *  GENERIC_FAILURE
3371  *
3372  */
3373 #define RIL_REQUEST_BASEBAND_VERSION 51
3374
3375 /**
3376  * RIL_REQUEST_SEPARATE_CONNECTION
3377  *
3378  * Separate a party from a multiparty call placing the multiparty call
3379  * (less the specified party) on hold and leaving the specified party
3380  * as the only other member of the current (active) call
3381  *
3382  * Like AT+CHLD=2x
3383  *
3384  * See TS 22.084 1.3.8.2 (iii)
3385  * TS 22.030 6.5.5 "Entering "2X followed by send"
3386  * TS 27.007 "AT+CHLD=2x"
3387  *
3388  * "data" is an int *
3389  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
3390  *
3391  * "response" is NULL
3392  *
3393  * Valid errors:
3394  *  SUCCESS
3395  *  RADIO_NOT_AVAILABLE (radio resetting)
3396  *  INVALID_ARGUMENTS
3397  *  INVALID_STATE
3398  *  NO_RESOURCES
3399  *  NO_MEMORY
3400  *  SYSTEM_ERR
3401  *  MODEM_ERR
3402  *  INTERNAL_ERR
3403  *  INVALID_CALL_ID
3404  *  INVALID_STATE
3405  *  OPERATION_NOT_ALLOWED
3406  *  GENERIC_FAILURE
3407  */
3408 #define RIL_REQUEST_SEPARATE_CONNECTION 52
3409
3410
3411 /**
3412  * RIL_REQUEST_SET_MUTE
3413  *
3414  * Turn on or off uplink (microphone) mute.
3415  *
3416  * Will only be sent while voice call is active.
3417  * Will always be reset to "disable mute" when a new voice call is initiated
3418  *
3419  * "data" is an int *
3420  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
3421  *
3422  * "response" is NULL
3423  *
3424  * Valid errors:
3425  *  SUCCESS
3426  *  RADIO_NOT_AVAILABLE (radio resetting)
3427  *  INVALID_ARGUMENTS
3428  *  NO_MEMORY
3429  *  REQUEST_RATE_LIMITED
3430  *  GENERIC_FAILURE
3431  */
3432
3433 #define RIL_REQUEST_SET_MUTE 53
3434
3435 /**
3436  * RIL_REQUEST_GET_MUTE
3437  *
3438  * Queries the current state of the uplink mute setting
3439  *
3440  * "data" is NULL
3441  * "response" is an int *
3442  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
3443  *
3444  * Valid errors:
3445  *  SUCCESS
3446  *  RADIO_NOT_AVAILABLE (radio resetting)
3447  *  SS_MODIFIED_TO_DIAL
3448  *  SS_MODIFIED_TO_USSD
3449  *  SS_MODIFIED_TO_SS
3450  *  NO_MEMORY
3451  *  REQUEST_RATE_LIMITED
3452  *  GENERIC_FAILURE
3453  */
3454
3455 #define RIL_REQUEST_GET_MUTE 54
3456
3457 /**
3458  * RIL_REQUEST_QUERY_CLIP
3459  *
3460  * Queries the status of the CLIP supplementary service
3461  *
3462  * (for MMI code "*#30#")
3463  *
3464  * "data" is NULL
3465  * "response" is an int *
3466  * (int *)response)[0] is 1 for "CLIP provisioned"
3467  *                           and 0 for "CLIP not provisioned"
3468  *                           and 2 for "unknown, e.g. no network etc"
3469  *
3470  * Valid errors:
3471  *  SUCCESS
3472  *  RADIO_NOT_AVAILABLE (radio resetting)
3473  *  NO_MEMORY
3474  *  SYSTEM_ERR
3475  *  MODEM_ERR
3476  *  INTERNAL_ERR
3477  *  FDN_CHECK_FAILURE
3478  *  GENERIC_FAILURE
3479  */
3480
3481 #define RIL_REQUEST_QUERY_CLIP 55
3482
3483 /**
3484  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
3485  * field in RIL_Data_Call_Response_v6.
3486  *
3487  * Requests the failure cause code for the most recently failed PDP
3488  * context or CDMA data connection active
3489  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
3490  *
3491  * "data" is NULL
3492  *
3493  * "response" is a "int *"
3494  * ((int *)response)[0] is an integer cause code defined in TS 24.008
3495  *   section 6.1.3.1.3 or close approximation
3496  *
3497  * If the implementation does not have access to the exact cause codes,
3498  * then it should return one of the values listed in
3499  * RIL_DataCallFailCause, as the UI layer needs to distinguish these
3500  * cases for error notification
3501  * and potential retries.
3502  *
3503  * Valid errors:
3504  *  SUCCESS
3505  *  RADIO_NOT_AVAILABLE
3506  *  GENERIC_FAILURE
3507  *
3508  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
3509  *
3510  * Deprecated use the status field in RIL_Data_Call_Response_v6.
3511  */
3512
3513 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
3514
3515 /**
3516  * RIL_REQUEST_DATA_CALL_LIST
3517  *
3518  * Returns the data call list. An entry is added when a
3519  * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
3520  * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
3521  * when RIL_REQUEST_RADIO_POWER off/on is issued.
3522  *
3523  * "data" is NULL
3524  * "response" is an array of RIL_Data_Call_Response_v6
3525  *
3526  * Valid errors:
3527  *  SUCCESS
3528  *  RADIO_NOT_AVAILABLE (radio resetting)
3529  *  GENERIC_FAILURE
3530  *
3531  * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
3532  */
3533
3534 #define RIL_REQUEST_DATA_CALL_LIST 57
3535
3536 /**
3537  * RIL_REQUEST_RESET_RADIO - DEPRECATED
3538  *
3539  * Request a radio reset. The RIL implementation may postpone
3540  * the reset until after this request is responded to if the baseband
3541  * is presently busy.
3542  *
3543  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
3544  *
3545  * "data" is NULL
3546  * "response" is NULL
3547  *
3548  * Valid errors:
3549  *  SUCCESS
3550  *  RADIO_NOT_AVAILABLE (radio resetting)
3551  *  GENERIC_FAILURE
3552  *  REQUEST_NOT_SUPPORTED
3553  */
3554
3555 #define RIL_REQUEST_RESET_RADIO 58
3556
3557 /**
3558  * RIL_REQUEST_OEM_HOOK_RAW
3559  *
3560  * This request reserved for OEM-specific uses. It passes raw byte arrays
3561  * back and forth.
3562  *
3563  * It can be invoked on the Java side from
3564  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
3565  *
3566  * "data" is a char * of bytes copied from the byte[] data argument in java
3567  * "response" is a char * of bytes that will returned via the
3568  * caller's "response" Message here:
3569  * (byte[])(((AsyncResult)response.obj).result)
3570  *
3571  * An error response here will result in
3572  * (((AsyncResult)response.obj).result) == null and
3573  * (((AsyncResult)response.obj).exception) being an instance of
3574  * com.android.internal.telephony.gsm.CommandException
3575  *
3576  * Valid errors:
3577  *  All
3578  */
3579
3580 #define RIL_REQUEST_OEM_HOOK_RAW 59
3581
3582 /**
3583  * RIL_REQUEST_OEM_HOOK_STRINGS
3584  *
3585  * This request reserved for OEM-specific uses. It passes strings
3586  * back and forth.
3587  *
3588  * It can be invoked on the Java side from
3589  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
3590  *
3591  * "data" is a const char **, representing an array of null-terminated UTF-8
3592  * strings copied from the "String[] strings" argument to
3593  * invokeOemRilRequestStrings()
3594  *
3595  * "response" is a const char **, representing an array of null-terminated UTF-8
3596  * stings that will be returned via the caller's response message here:
3597  *
3598  * (String[])(((AsyncResult)response.obj).result)
3599  *
3600  * An error response here will result in
3601  * (((AsyncResult)response.obj).result) == null and
3602  * (((AsyncResult)response.obj).exception) being an instance of
3603  * com.android.internal.telephony.gsm.CommandException
3604  *
3605  * Valid errors:
3606  *  All
3607  */
3608
3609 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
3610
3611 /**
3612  * RIL_REQUEST_SCREEN_STATE - DEPRECATED
3613  *
3614  * Indicates the current state of the screen.  When the screen is off, the
3615  * RIL should notify the baseband to suppress certain notifications (eg,
3616  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
3617  * in an effort to conserve power.  These notifications should resume when the
3618  * screen is on.
3619  *
3620  * Note this request is deprecated. Use RIL_REQUEST_SEND_DEVICE_STATE to report the device state
3621  * to the modem and use RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER to turn on/off unsolicited
3622  * response from the modem in different scenarios.
3623  *
3624  * "data" is int *
3625  * ((int *)data)[0] is == 1 for "Screen On"
3626  * ((int *)data)[0] is == 0 for "Screen Off"
3627  *
3628  * "response" is NULL
3629  *
3630  * Valid errors:
3631  *  SUCCESS
3632  *  GENERIC_FAILURE
3633  */
3634 #define RIL_REQUEST_SCREEN_STATE 61
3635
3636
3637 /**
3638  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
3639  *
3640  * Enables/disables supplementary service related notifications
3641  * from the network.
3642  *
3643  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
3644  *
3645  * "data" is int *
3646  * ((int *)data)[0] is == 1 for notifications enabled
3647  * ((int *)data)[0] is == 0 for notifications disabled
3648  *
3649  * "response" is NULL
3650  *
3651  * Valid errors:
3652  *  SUCCESS
3653  *  RADIO_NOT_AVAILABLE
3654  *  SIM_BUSY
3655  *  INVALID_ARGUMENTS
3656  *  NO_MEMORY
3657  *  SYSTEM_ERR
3658  *  MODEM_ERR
3659  *  INTERNAL_ERR
3660  *  GENERIC_FAILURE
3661  *
3662  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
3663  */
3664 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
3665
3666 /**
3667  * RIL_REQUEST_WRITE_SMS_TO_SIM
3668  *
3669  * Stores a SMS message to SIM memory.
3670  *
3671  * "data" is RIL_SMS_WriteArgs *
3672  *
3673  * "response" is int *
3674  * ((const int *)response)[0] is the record index where the message is stored.
3675  *
3676  * Valid errors:
3677  *  SUCCESS
3678  *  SIM_FULL
3679  *  INVALID_ARGUMENTS
3680  *  INVALID_SMS_FORMAT
3681  *  INTERNAL_ERR
3682  *  MODEM_ERR
3683  *  ENCODING_ERR
3684  *  NO_MEMORY
3685  *  NO_RESOURCES
3686  *  INVALID_MODEM_STATE
3687  *  MODE_NOT_SUPPORTED
3688  *  INVALID_SMSC_ADDRESS
3689  *  GENERIC_FAILURE
3690  *
3691  */
3692 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
3693
3694 /**
3695  * RIL_REQUEST_DELETE_SMS_ON_SIM
3696  *
3697  * Deletes a SMS message from SIM memory.
3698  *
3699  * "data" is int  *
3700  * ((int *)data)[0] is the record index of the message to delete.
3701  *
3702  * "response" is NULL
3703  *
3704  * Valid errors:
3705  *  SUCCESS
3706  *  SIM_FULL
3707  *  INVALID_ARGUMENTS
3708  *  NO_MEMORY
3709  *  REQUEST_RATE_LIMITED
3710  *  SYSTEM_ERR
3711  *  MODEM_ERR
3712  *  NO_SUCH_ENTRY
3713  *  GENERIC_FAILURE
3714  *
3715  */
3716 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
3717
3718 /**
3719  * RIL_REQUEST_SET_BAND_MODE
3720  *
3721  * Assign a specified band for RF configuration.
3722  *
3723  * "data" is int *
3724  * ((int *)data)[0] is a RIL_RadioBandMode
3725  *
3726  * "response" is NULL
3727  *
3728  * Valid errors:
3729  *  SUCCESS
3730  *  RADIO_NOT_AVAILABLE
3731  *  OPERATION_NOT_ALLOWED
3732  *  GENERIC_FAILURE
3733  *
3734  * See also: RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
3735  */
3736 #define RIL_REQUEST_SET_BAND_MODE 65
3737
3738 /**
3739  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
3740  *
3741  * Query the list of band mode supported by RF.
3742  *
3743  * "data" is NULL
3744  *
3745  * "response" is int *
3746  * "response" points to an array of int's, the int[0] is the size of array;
3747  * subsequent values are a list of RIL_RadioBandMode listing supported modes.
3748  *
3749  * Valid errors:
3750  *  SUCCESS
3751  *  RADIO_NOT_AVAILABLE
3752  *  GENERIC_FAILURE
3753  *
3754  * See also: RIL_REQUEST_SET_BAND_MODE
3755  */
3756 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
3757
3758 /**
3759  * RIL_REQUEST_STK_GET_PROFILE
3760  *
3761  * Requests the profile of SIM tool kit.
3762  * The profile indicates the SAT/USAT features supported by ME.
3763  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
3764  *
3765  * "data" is NULL
3766  *
3767  * "response" is a const char * containing SAT/USAT profile
3768  * in hexadecimal format string starting with first byte of terminal profile
3769  *
3770  * Valid errors:
3771  *  RIL_E_SUCCESS
3772  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3773  *  RIL_E_GENERIC_FAILURE
3774  */
3775 #define RIL_REQUEST_STK_GET_PROFILE 67
3776
3777 /**
3778  * RIL_REQUEST_STK_SET_PROFILE
3779  *
3780  * Download the STK terminal profile as part of SIM initialization
3781  * procedure
3782  *
3783  * "data" is a const char * containing SAT/USAT profile
3784  * in hexadecimal format string starting with first byte of terminal profile
3785  *
3786  * "response" is NULL
3787  *
3788  * Valid errors:
3789  *  RIL_E_SUCCESS
3790  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3791  *  RIL_E_GENERIC_FAILURE
3792  */
3793 #define RIL_REQUEST_STK_SET_PROFILE 68
3794
3795 /**
3796  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
3797  *
3798  * Requests to send a SAT/USAT envelope command to SIM.
3799  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
3800  *
3801  * "data" is a const char * containing SAT/USAT command
3802  * in hexadecimal format string starting with command tag
3803  *
3804  * "response" is a const char * containing SAT/USAT response
3805  * in hexadecimal format string starting with first byte of response
3806  * (May be NULL)
3807  *
3808  * Valid errors:
3809  *  RIL_E_SUCCESS
3810  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3811  *  SIM_BUSY
3812  *  OPERATION_NOT_ALLOWED
3813  *  RIL_E_GENERIC_FAILURE
3814  */
3815 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
3816
3817 /**
3818  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
3819  *
3820  * Requests to send a terminal response to SIM for a received
3821  * proactive command
3822  *
3823  * "data" is a const char * containing SAT/USAT response
3824  * in hexadecimal format string starting with first byte of response data
3825  *
3826  * "response" is NULL
3827  *
3828  * Valid errors:
3829  *  RIL_E_SUCCESS
3830  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3831  *  RIL_E_OPERATION_NOT_ALLOWED
3832  *  RIL_E_GENERIC_FAILURE
3833  */
3834 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
3835
3836 /**
3837  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
3838  *
3839  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
3840  * been initialized by ME already. (We could see the call has been in the 'call
3841  * list') So, STK application needs to accept/reject the call according as user
3842  * operations.
3843  *
3844  * "data" is int *
3845  * ((int *)data)[0] is > 0 for "accept" the call setup
3846  * ((int *)data)[0] is == 0 for "reject" the call setup
3847  *
3848  * "response" is NULL
3849  *
3850  * Valid errors:
3851  *  RIL_E_SUCCESS
3852  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3853  *  RIL_E_OPERATION_NOT_ALLOWED
3854  *  RIL_E_GENERIC_FAILURE
3855  */
3856 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
3857
3858 /**
3859  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
3860  *
3861  * Connects the two calls and disconnects the subscriber from both calls.
3862  *
3863  * "data" is NULL
3864  * "response" is NULL
3865  *
3866  * Valid errors:
3867  *  SUCCESS
3868  *  RADIO_NOT_AVAILABLE (radio resetting)
3869  *  INVALID_STATE
3870  *  NO_RESOURCES
3871  *  NO_MEMORY
3872  *  INVALID_ARGUMENTS
3873  *  SYSTEM_ERR
3874  *  MODEM_ERR
3875  *  INTERNAL_ERR
3876  *  INVALID_CALL_ID
3877  *  INVALID_STATE
3878  *  OPERATION_NOT_ALLOWED
3879  *  GENERIC_FAILURE
3880  */
3881 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
3882
3883 /**
3884  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
3885  *
3886  * Requests to set the preferred network type for searching and registering
3887  * (CS/PS domain, RAT, and operation mode)
3888  *
3889  * "data" is int * which is RIL_PreferredNetworkType
3890  *
3891  * "response" is NULL
3892  *
3893  * Valid errors:
3894  *  SUCCESS
3895  *  RADIO_NOT_AVAILABLE (radio resetting)
3896  *  GENERIC_FAILURE
3897  *  OPERATION_NOT_ALLOWED
3898  *  MODE_NOT_SUPPORTED
3899  */
3900 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
3901
3902 /**
3903  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
3904  *
3905  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
3906  * for searching and registering
3907  *
3908  * "data" is NULL
3909  *
3910  * "response" is int *
3911  * ((int *)reponse)[0] is == RIL_PreferredNetworkType
3912  *
3913  * Valid errors:
3914  *  SUCCESS
3915  *  RADIO_NOT_AVAILABLE
3916  *  GENERIC_FAILURE
3917  *
3918  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
3919  */
3920 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
3921
3922 /**
3923  * RIL_REQUEST_NEIGHBORING_CELL_IDS
3924  *
3925  * Request neighboring cell id in GSM network
3926  *
3927  * "data" is NULL
3928  * "response" must be a " const RIL_NeighboringCell** "
3929  *
3930  * Valid errors:
3931  *  SUCCESS
3932  *  RADIO_NOT_AVAILABLE
3933  *  GENERIC_FAILURE
3934  */
3935 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
3936
3937 /**
3938  * RIL_REQUEST_SET_LOCATION_UPDATES
3939  *
3940  * Enables/disables network state change notifications due to changes in
3941  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
3942  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
3943  *
3944  * Note:  The RIL implementation should default to "updates enabled"
3945  * when the screen is on and "updates disabled" when the screen is off.
3946  *
3947  * "data" is int *
3948  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
3949  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
3950  *
3951  * "response" is NULL
3952  *
3953  * Valid errors:
3954  *  SUCCESS
3955  *  RADIO_NOT_AVAILABLE
3956  *  GENERIC_FAILURE
3957  *
3958  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
3959  */
3960 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
3961
3962 /**
3963  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
3964  *
3965  * Request to set the location where the CDMA subscription shall
3966  * be retrieved
3967  *
3968  * "data" is int *
3969  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3970  *
3971  * "response" is NULL
3972  *
3973  * Valid errors:
3974  *  SUCCESS
3975  *  RADIO_NOT_AVAILABLE
3976  *  GENERIC_FAILURE
3977  *  SIM_ABSENT
3978  *  SUBSCRIPTION_NOT_AVAILABLE
3979  *
3980  * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
3981  */
3982 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
3983
3984 /**
3985  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
3986  *
3987  * Request to set the roaming preferences in CDMA
3988  *
3989  * "data" is int *
3990  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
3991  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
3992  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
3993  *
3994  * "response" is NULL
3995  *
3996  * Valid errors:
3997  *  SUCCESS
3998  *  RADIO_NOT_AVAILABLE
3999  *  GENERIC_FAILURE
4000  */
4001 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
4002
4003 /**
4004  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
4005  *
4006  * Request the actual setting of the roaming preferences in CDMA in the modem
4007  *
4008  * "data" is NULL
4009  *
4010  * "response" is int *
4011  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
4012  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
4013  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
4014  *
4015  * "response" is NULL
4016  *
4017  * Valid errors:
4018  *  SUCCESS
4019  *  RADIO_NOT_AVAILABLE
4020  *  GENERIC_FAILURE
4021  */
4022 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
4023
4024 /**
4025  * RIL_REQUEST_SET_TTY_MODE
4026  *
4027  * Request to set the TTY mode
4028  *
4029  * "data" is int *
4030  * ((int *)data)[0] is == 0 for TTY off
4031  * ((int *)data)[0] is == 1 for TTY Full
4032  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
4033  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
4034  *
4035  * "response" is NULL
4036  *
4037  * Valid errors:
4038  *  SUCCESS
4039  *  RADIO_NOT_AVAILABLE
4040  *  INVALID_ARGUMENTS
4041  *  MODEM_ERR
4042  *  INTERNAL_ERR
4043  *  NO_MEMOR
4044  *  INVALID_ARGUMENTS
4045  *  MODEM_ERR
4046  *  INTERNAL_ERR
4047  *  NO_MEMORYY
4048  *  GENERIC_FAILURE
4049  */
4050 #define RIL_REQUEST_SET_TTY_MODE 80
4051
4052 /**
4053  * RIL_REQUEST_QUERY_TTY_MODE
4054  *
4055  * Request the setting of TTY mode
4056  *
4057  * "data" is NULL
4058  *
4059  * "response" is int *
4060  * ((int *)response)[0] is == 0 for TTY off
4061  * ((int *)response)[0] is == 1 for TTY Full
4062  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
4063  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
4064  *
4065  * "response" is NULL
4066  *
4067  * Valid errors:
4068  *  SUCCESS
4069  *  RADIO_NOT_AVAILABLE
4070  *  MODEM_ERR
4071  *  INTERNAL_ERR
4072  *  NO_MEMORY
4073  *  INVALID_ARGUMENTS
4074  *  GENERIC_FAILURE
4075  */
4076 #define RIL_REQUEST_QUERY_TTY_MODE 81
4077
4078 /**
4079  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
4080  *
4081  * Request to set the preferred voice privacy mode used in voice
4082  * scrambling
4083  *
4084  * "data" is int *
4085  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
4086  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
4087  *
4088  * "response" is NULL
4089  *
4090  * Valid errors:
4091  *  SUCCESS
4092  *  RADIO_NOT_AVAILABLE
4093  *  INVALID_ARGUMENTS
4094  *  SYSTEM_ERR
4095  *  MODEM_ERR
4096  *  INTERNAL_ERR
4097  *  NO_MEMORY
4098  *  INVALID_CALL_ID
4099  *  GENERIC_FAILURE
4100  */
4101 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
4102
4103 /**
4104  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
4105  *
4106  * Request the setting of preferred voice privacy mode
4107  *
4108  * "data" is NULL
4109  *
4110  * "response" is int *
4111  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
4112  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
4113  *
4114  * "response" is NULL
4115  *
4116  * Valid errors:
4117  *  SUCCESS
4118  *  RADIO_NOT_AVAILABLE
4119  *  MODEM_ERR
4120  *  INTERNAL_ERR
4121  *  NO_MEMORY
4122  *  INVALID_ARGUMENTS
4123  *  GENERIC_FAILURE
4124  */
4125 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
4126
4127 /**
4128  * RIL_REQUEST_CDMA_FLASH
4129  *
4130  * Send FLASH
4131  *
4132  * "data" is const char *
4133  * ((const char *)data)[0] is a FLASH string
4134  *
4135  * "response" is NULL
4136  *
4137  * Valid errors:
4138  *  SUCCESS
4139  *  RADIO_NOT_AVAILABLE
4140  *  INVALID_ARGUMENTS
4141  *  NO_MEMORY
4142  *  SYSTEM_ERR
4143  *  MODEM_ERR
4144  *  INTERNAL_ERR
4145  *  INVALID_CALL_ID
4146  *  INVALID_STATE
4147  *  GENERIC_FAILURE
4148  *
4149  */
4150 #define RIL_REQUEST_CDMA_FLASH 84
4151
4152 /**
4153  * RIL_REQUEST_CDMA_BURST_DTMF
4154  *
4155  * Send DTMF string
4156  *
4157  * "data" is const char **
4158  * ((const char **)data)[0] is a DTMF string
4159  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
4160  *                          default
4161  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
4162  *                          default
4163  *
4164  * "response" is NULL
4165  *
4166  * Valid errors:
4167  *  SUCCESS
4168  *  RADIO_NOT_AVAILABLE
4169  *  INVALID_ARGUMENTS
4170  *  NO_MEMORY
4171  *  SYSTEM_ERR
4172  *  MODEM_ERR
4173  *  INTERNAL_ERR
4174  *  INVALID_CALL_ID
4175  *  GENERIC_FAILURE
4176  *
4177  */
4178 #define RIL_REQUEST_CDMA_BURST_DTMF 85
4179
4180 /**
4181  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
4182  *
4183  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
4184  * If the checksum is valid the 20 digit AKEY is written to NV,
4185  * replacing the existing AKEY no matter what it was before.
4186  *
4187  * "data" is const char *
4188  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
4189  *                         where the last 6 digits are a checksum of the
4190  *                         first 20, as specified in TR45.AHAG
4191  *                         "Common Cryptographic Algorithms, Revision D.1
4192  *                         Section 2.2"
4193  *
4194  * "response" is NULL
4195  *
4196  * Valid errors:
4197  *  SUCCESS
4198  *  RADIO_NOT_AVAILABLE
4199  *  GENERIC_FAILURE
4200  *
4201  */
4202 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
4203
4204 /**
4205  * RIL_REQUEST_CDMA_SEND_SMS
4206  *
4207  * Send a CDMA SMS message
4208  *
4209  * "data" is const RIL_CDMA_SMS_Message *
4210  *
4211  * "response" is a const RIL_SMS_Response *
4212  *
4213  * Based on the return error, caller decides to resend if sending sms
4214  * fails. The CDMA error class is derived as follows,
4215  * SUCCESS is error class 0 (no error)
4216  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
4217  * and GENERIC_FAILURE is error class 3 (permanent and no retry)
4218  *
4219  * Valid errors:
4220  *  SUCCESS
4221  *  RADIO_NOT_AVAILABLE
4222  *  SMS_SEND_FAIL_RETRY
4223  *  NETWORK_REJECT
4224  *  INVALID_STATE
4225  *  INVALID_ARGUMENTS
4226  *  NO_MEMORY
4227  *  REQUEST_RATE_LIMITED
4228  *  INVALID_SMS_FORMAT
4229  *  SYSTEM_ERR
4230  *  FDN_CHECK_FAILURE
4231  *  MODEM_ERR
4232  *  NETWORK_ERR
4233  *  ENCODING_ERR
4234  *  INVALID_SMSC_ADDRESS
4235  *  MODE_NOT_SUPPORTED
4236  *  GENERIC_FAILURE
4237  *
4238  */
4239 #define RIL_REQUEST_CDMA_SEND_SMS 87
4240
4241 /**
4242  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
4243  *
4244  * Acknowledge the success or failure in the receipt of SMS
4245  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
4246  *
4247  * "data" is const RIL_CDMA_SMS_Ack *
4248  *
4249  * "response" is NULL
4250  *
4251  * Valid errors:
4252  *  SUCCESS
4253  *  RADIO_NOT_AVAILABLE
4254  *  INVALID_ARGUMENTS
4255  *  NO_SMS_TO_ACK
4256  *  INVALID_STATE
4257  *  NO_MEMORY
4258  *  REQUEST_RATE_LIMITED
4259  *  SYSTEM_ERR
4260  *  MODEM_ERR
4261  *  INVALID_STATE
4262  *  MODE_NOT_SUPPORTED
4263  *  NETWORK_NOT_READY
4264  *  INVALID_MODEM_STATE
4265  *  GENERIC_FAILURE
4266  *
4267  */
4268 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
4269
4270 /**
4271  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
4272  *
4273  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
4274  *
4275  * "data" is NULL
4276  *
4277  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
4278  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
4279  *
4280  * Valid errors:
4281  *  SUCCESS
4282  *  RADIO_NOT_AVAILABLE
4283  *  INVALID_STATE
4284  *  NO_MEMORY
4285  *  REQUEST_RATE_LIMITED
4286  *  SYSTEM_ERR
4287  *  NO_RESOURCES
4288  *  MODEM_ERR
4289  *  SYSTEM_ERR
4290  *  GENERIC_FAILURE
4291  *
4292  */
4293 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
4294
4295 /**
4296  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
4297  *
4298  * Set GSM/WCDMA Cell Broadcast SMS config
4299  *
4300  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
4301  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
4302  *
4303  * "response" is NULL
4304  *
4305  * Valid errors:
4306  *  SUCCESS
4307  *  RADIO_NOT_AVAILABLE
4308  *  INVALID_STATE
4309  *  INVALID_ARGUMENTS
4310  *  NO_MEMORY
4311  *  SYSTEM_ERR
4312  *  REQUEST_RATE_LIMITED
4313  *  MODEM_ERR
4314  *  SYSTEM_ERR
4315  *  GENERIC_FAILURE
4316  *
4317  */
4318 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
4319
4320 /**
4321  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
4322  *
4323 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
4324  *
4325  * "data" is const int *
4326  * (const int *)data[0] indicates to activate or turn off the
4327  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
4328  *                       0 - Activate, 1 - Turn off
4329  *
4330  * "response" is NULL
4331  *
4332  * Valid errors:
4333  *  SUCCESS
4334  *  RADIO_NOT_AVAILABLE
4335  *  INVALID_STATE
4336  *  INVALID_ARGUMENTS
4337  *  NO_MEMORY
4338  *  SYSTEM_ERR
4339  *  REQUEST_RATE_LIMITED
4340  *  MODEM_ERR
4341  *  GENERIC_FAILURE
4342  *
4343  */
4344 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
4345
4346 /**
4347  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
4348  *
4349  * Request the setting of CDMA Broadcast SMS config
4350  *
4351  * "data" is NULL
4352  *
4353  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
4354  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
4355  *
4356  * Valid errors:
4357  *  SUCCESS
4358  *  RADIO_NOT_AVAILABLE
4359  *  INVALID_STATE
4360  *  NO_MEMORY
4361  *  REQUEST_RATE_LIMITED
4362  *  SYSTEM_ERR
4363  *  NO_RESOURCES
4364  *  MODEM_ERR
4365  *  SYSTEM_ERR
4366  *  GENERIC_FAILURE
4367  *
4368  */
4369 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
4370
4371 /**
4372  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
4373  *
4374  * Set CDMA Broadcast SMS config
4375  *
4376  * "data" is a const RIL_CDMA_BroadcastSmsConfigInfo **
4377  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
4378  *
4379  * "response" is NULL
4380  *
4381  * Valid errors:
4382  *  SUCCESS
4383  *  RADIO_NOT_AVAILABLE
4384  *  INVALID_STATE
4385  *  INVALID_ARGUMENTS
4386  *  NO_MEMORY
4387  *  SYSTEM_ERR
4388  *  REQUEST_RATE_LIMITED
4389  *  MODEM_ERR
4390  *  SYSTEM_ERR
4391  *  GENERIC_FAILURE
4392  *
4393  */
4394 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
4395
4396 /**
4397  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
4398  *
4399  * Enable or disable the reception of CDMA Broadcast SMS
4400  *
4401  * "data" is const int *
4402  * (const int *)data[0] indicates to activate or turn off the
4403  * reception of CDMA Broadcast SMS, 0-1,
4404  *                       0 - Activate, 1 - Turn off
4405  *
4406  * "response" is NULL
4407  *
4408  * Valid errors:
4409  *  SUCCESS
4410  *  RADIO_NOT_AVAILABLE
4411  *  INVALID_STATE
4412  *  INVALID_ARGUMENTS
4413  *  NO_MEMORY
4414  *  SYSTEM_ERR
4415  *  REQUEST_RATE_LIMITED
4416  *  MODEM_ERR
4417  *  GENERIC_FAILURE
4418  *
4419  */
4420 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
4421
4422 /**
4423  * RIL_REQUEST_CDMA_SUBSCRIPTION
4424  *
4425  * Request the device MDN / H_SID / H_NID.
4426  *
4427  * The request is only allowed when CDMA subscription is available.  When CDMA
4428  * subscription is changed, application layer should re-issue the request to
4429  * update the subscription information.
4430  *
4431  * If a NULL value is returned for any of the device id, it means that error
4432  * accessing the device.
4433  *
4434  * "response" is const char **
4435  * ((const char **)response)[0] is MDN if CDMA subscription is available
4436  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
4437  *                              CDMA subscription is available, in decimal format
4438  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
4439  *                              CDMA subscription is available, in decimal format
4440  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
4441  * ((const char **)response)[4] is PRL version if CDMA subscription is available
4442  *
4443  * Valid errors:
4444  *  SUCCESS
4445  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
4446  */
4447
4448 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
4449
4450 /**
4451  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
4452  *
4453  * Stores a CDMA SMS message to RUIM memory.
4454  *
4455  * "data" is RIL_CDMA_SMS_WriteArgs *
4456  *
4457  * "response" is int *
4458  * ((const int *)response)[0] is the record index where the message is stored.
4459  *
4460  * Valid errors:
4461  *  SUCCESS
4462  *  RADIO_NOT_AVAILABLE
4463  *  SIM_FULL
4464  *  INVALID_ARGUMENTS
4465  *  INVALID_SMS_FORMAT
4466  *  INTERNAL_ERR
4467  *  MODEM_ERR
4468  *  ENCODING_ERR
4469  *  NO_MEMORY
4470  *  NO_RESOURCES
4471  *  INVALID_MODEM_STATE
4472  *  MODE_NOT_SUPPORTED
4473  *  INVALID_SMSC_ADDRESS
4474  *  GENERIC_FAILURE
4475  *
4476  */
4477 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
4478
4479 /**
4480  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
4481  *
4482  * Deletes a CDMA SMS message from RUIM memory.
4483  *
4484  * "data" is int  *
4485  * ((int *)data)[0] is the record index of the message to delete.
4486  *
4487  * "response" is NULL
4488  *
4489  * Valid errors:
4490  *  SUCCESS
4491  *  RADIO_NOT_AVAILABLE
4492  *  INVALID_ARGUMENTS
4493  *  NO_MEMORY
4494  *  REQUEST_RATE_LIMITED
4495  *  SYSTEM_ERR
4496  *  MODEM_ERR
4497  *  NO_SUCH_ENTRY
4498  *  GENERIC_FAILURE
4499  *
4500  */
4501 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
4502
4503 /**
4504  * RIL_REQUEST_DEVICE_IDENTITY
4505  *
4506  * Request the device ESN / MEID / IMEI / IMEISV.
4507  *
4508  * The request is always allowed and contains GSM and CDMA device identity;
4509  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
4510  * RIL_REQUEST_GET_IMEISV.
4511  *
4512  * If a NULL value is returned for any of the device id, it means that error
4513  * accessing the device.
4514  *
4515  * When CDMA subscription is changed the ESN/MEID may change.  The application
4516  * layer should re-issue the request to update the device identity in this case.
4517  *
4518  * "response" is const char **
4519  * ((const char **)response)[0] is IMEI if GSM subscription is available
4520  * ((const char **)response)[1] is IMEISV if GSM subscription is available
4521  * ((const char **)response)[2] is ESN if CDMA subscription is available
4522  * ((const char **)response)[3] is MEID if CDMA subscription is available
4523  *
4524  * Valid errors:
4525  *  SUCCESS
4526  *  RADIO_NOT_AVAILABLE
4527  *  GENERIC_FAILURE
4528  */
4529 #define RIL_REQUEST_DEVICE_IDENTITY 98
4530
4531 /**
4532  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
4533  *
4534  * Request the radio's system selection module to exit emergency
4535  * callback mode.  RIL will not respond with SUCCESS until the modem has
4536  * completely exited from Emergency Callback Mode.
4537  *
4538  * "data" is NULL
4539  *
4540  * "response" is NULL
4541  *
4542  * Valid errors:
4543  *  SUCCESS
4544  *  RADIO_NOT_AVAILABLE
4545  *  OPERATION_NOT_ALLOWED
4546  *  GENERIC_FAILURE
4547  *
4548  */
4549 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
4550
4551 /**
4552  * RIL_REQUEST_GET_SMSC_ADDRESS
4553  *
4554  * Queries the default Short Message Service Center address on the device.
4555  *
4556  * "data" is NULL
4557  *
4558  * "response" is const char * containing the SMSC address.
4559  *
4560  * Valid errors:
4561  *  SUCCESS
4562  *  RADIO_NOT_AVAILABLE
4563  *  NO_MEMORY
4564  *  REQUEST_RATE_LIMITED
4565  *  SYSTEM_ERR
4566  *  INTERNAL_ERR
4567  *  MODEM_ERR
4568  *  INVALID_ARGUMENTS
4569  *  INVALID_MODEM_STATE
4570  *  NOT_PROVISIONED
4571  *  GENERIC_FAILURE
4572  *
4573  */
4574 #define RIL_REQUEST_GET_SMSC_ADDRESS 100
4575
4576 /**
4577  * RIL_REQUEST_SET_SMSC_ADDRESS
4578  *
4579  * Sets the default Short Message Service Center address on the device.
4580  *
4581  * "data" is const char * containing the SMSC address.
4582  *
4583  * "response" is NULL
4584  *
4585  * Valid errors:
4586  *  SUCCESS
4587  *  RADIO_NOT_AVAILABLE
4588  *  INVALID_ARGUMENTS
4589  *  INVALID_SMS_FORMAT
4590  *  NO_MEMORY
4591  *  SYSTEM_ERR
4592  *  REQUEST_RATE_LIMITED
4593  *  MODEM_ERR
4594  *  NO_RESOURCES
4595  *  GENERIC_FAILURE
4596  *
4597  */
4598 #define RIL_REQUEST_SET_SMSC_ADDRESS 101
4599
4600 /**
4601  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
4602  *
4603  * Indicates whether there is storage available for new SMS messages.
4604  *
4605  * "data" is int *
4606  * ((int *)data)[0] is 1 if memory is available for storing new messages
4607  *                  is 0 if memory capacity is exceeded
4608  *
4609  * "response" is NULL
4610  *
4611  * Valid errors:
4612  *  SUCCESS
4613  *  RADIO_NOT_AVAILABLE
4614  *  INVALID_ARGUMENTS
4615  *  NO_MEMORY
4616  *  INVALID_STATE
4617  *  SYSTEM_ERR
4618  *  REQUEST_RATE_LIMITED
4619  *  MODEM_ERR
4620  *  GENERIC_FAILURE
4621  *
4622  */
4623 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
4624
4625 /**
4626  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
4627  *
4628  * Indicates that the StkSerivce is running and is
4629  * ready to receive RIL_UNSOL_STK_XXXXX commands.
4630  *
4631  * "data" is NULL
4632  * "response" is NULL
4633  *
4634  * Valid errors:
4635  *  SUCCESS
4636  *  RADIO_NOT_AVAILABLE
4637  *  GENERIC_FAILURE
4638  *
4639  */
4640 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
4641
4642 /**
4643  * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
4644  *
4645  * Request to query the location where the CDMA subscription shall
4646  * be retrieved
4647  *
4648  * "data" is NULL
4649  *
4650  * "response" is int *
4651  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
4652  *
4653  * Valid errors:
4654  *  SUCCESS
4655  *  RADIO_NOT_AVAILABLE
4656  *  GENERIC_FAILURE
4657  *  SUBSCRIPTION_NOT_AVAILABLE
4658  *
4659  * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
4660  */
4661 #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
4662
4663 /**
4664  * RIL_REQUEST_ISIM_AUTHENTICATION
4665  *
4666  * Request the ISIM application on the UICC to perform AKA
4667  * challenge/response algorithm for IMS authentication
4668  *
4669  * "data" is a const char * containing the challenge string in Base64 format
4670  * "response" is a const char * containing the response in Base64 format
4671  *
4672  * Valid errors:
4673  *  SUCCESS
4674  *  RADIO_NOT_AVAILABLE
4675  *  GENERIC_FAILURE
4676  */
4677 #define RIL_REQUEST_ISIM_AUTHENTICATION 105
4678
4679 /**
4680  * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
4681  *
4682  * Acknowledge successful or failed receipt of SMS previously indicated
4683  * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
4684  * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
4685  *
4686  * "data" is const char **
4687  * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
4688  *                          is "0" on failed receipt (send RP-ERROR)
4689  * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
4690  *
4691  * "response" is NULL
4692  *
4693  * Valid errors:
4694  *  SUCCESS
4695  *  RADIO_NOT_AVAILABLE
4696  *  GENERIC_FAILURE
4697  */
4698 #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
4699
4700 /**
4701  * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
4702  *
4703  * Requests to send a SAT/USAT envelope command to SIM.
4704  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
4705  *
4706  * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
4707  * the SW1 and SW2 status bytes from the UICC response are returned along with
4708  * the response data, using the same structure as RIL_REQUEST_SIM_IO.
4709  *
4710  * The RIL implementation shall perform the normal processing of a '91XX'
4711  * response in SW1/SW2 to retrieve the pending proactive command and send it
4712  * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
4713  *
4714  * "data" is a const char * containing the SAT/USAT command
4715  * in hexadecimal format starting with command tag
4716  *
4717  * "response" is a const RIL_SIM_IO_Response *
4718  *
4719  * Valid errors:
4720  *  RIL_E_SUCCESS
4721  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
4722  *  SIM_BUSY
4723  *  OPERATION_NOT_ALLOWED
4724  *  RIL_E_GENERIC_FAILURE
4725  */
4726 #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
4727
4728 /**
4729  * RIL_REQUEST_VOICE_RADIO_TECH
4730  *
4731  * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
4732  * when radio state is RADIO_STATE_ON
4733  *
4734  * "data" is NULL
4735  * "response" is int *
4736  * ((int *) response)[0] is of type const RIL_RadioTechnology
4737  *
4738  * Valid errors:
4739  *  SUCCESS
4740  *  RADIO_NOT_AVAILABLE
4741  *  GENERIC_FAILURE
4742  */
4743 #define RIL_REQUEST_VOICE_RADIO_TECH 108
4744
4745 /**
4746  * RIL_REQUEST_GET_CELL_INFO_LIST
4747  *
4748  * Request all of the current cell information known to the radio. The radio
4749  * must a list of all current cells, including the neighboring cells. If for a particular
4750  * cell information isn't known then the appropriate unknown value will be returned.
4751  * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST.
4752  *
4753  * "data" is NULL
4754  *
4755  * "response" is an array of  RIL_CellInfo_v12.
4756  */
4757 #define RIL_REQUEST_GET_CELL_INFO_LIST 109
4758
4759 /**
4760  * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
4761  *
4762  * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked.
4763  * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
4764  * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
4765  * a RIL_UNSOL_CELL_INFO_LIST.
4766  *
4767  * "data" is int *
4768  * ((int *)data)[0] is minimum time in milliseconds
4769  *
4770  * "response" is NULL
4771  *
4772  * Valid errors:
4773  *  SUCCESS
4774  *  RADIO_NOT_AVAILABLE
4775  *  GENERIC_FAILURE
4776  */
4777 #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110
4778
4779 /**
4780  * RIL_REQUEST_SET_INITIAL_ATTACH_APN
4781  *
4782  * Set an apn to initial attach network
4783  *
4784  * "data" is a const char **
4785  * ((const char **)data)[0] is the APN to connect if radio technology is LTE
4786  * ((const char **)data)[1] is the connection type to request must be one of the
4787  *                          PDP_type values in TS 27.007 section 10.1.1.
4788  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
4789  * ((const char **)data)[2] is the PAP / CHAP auth type. Values:
4790  *                          0 => PAP and CHAP is never performed.
4791  *                          1 => PAP may be performed; CHAP is never performed.
4792  *                          2 => CHAP may be performed; PAP is never performed.
4793  *                          3 => PAP / CHAP may be performed - baseband dependent.
4794  * ((const char **)data)[3] is the username for APN, or NULL
4795  * ((const char **)data)[4] is the password for APN, or NULL
4796  *
4797  * "response" is NULL
4798  *
4799  * Valid errors:
4800  *  SUCCESS
4801  *  RADIO_NOT_AVAILABLE (radio resetting)
4802  *  GENERIC_FAILURE
4803  *  SUBSCRIPTION_NOT_AVAILABLE
4804  */
4805 #define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111
4806
4807 /**
4808  * RIL_REQUEST_IMS_REGISTRATION_STATE
4809  *
4810  * This message is DEPRECATED and shall be removed in a future release (target: 2018);
4811  * instead, provide IMS registration status via an IMS Service.
4812  *
4813  * Request current IMS registration state
4814  *
4815  * "data" is NULL
4816  *
4817  * "response" is int *
4818  * ((int *)response)[0] is registration state:
4819  *              0 - Not registered
4820  *              1 - Registered
4821  *
4822  * If ((int*)response)[0] is = 1, then ((int *) response)[1]
4823  * must follow with IMS SMS format:
4824  *
4825  * ((int *) response)[1] is of type RIL_RadioTechnologyFamily
4826  *
4827  * Valid errors:
4828  *  SUCCESS
4829  *  RADIO_NOT_AVAILABLE
4830  *  GENERIC_FAILURE
4831  */
4832 #define RIL_REQUEST_IMS_REGISTRATION_STATE 112
4833
4834 /**
4835  * RIL_REQUEST_IMS_SEND_SMS
4836  *
4837  * Send a SMS message over IMS
4838  *
4839  * "data" is const RIL_IMS_SMS_Message *
4840  *
4841  * "response" is a const RIL_SMS_Response *
4842  *
4843  * Based on the return error, caller decides to resend if sending sms
4844  * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
4845  * In case of retry, data is encoded based on Voice Technology available.
4846  *
4847  * Valid errors:
4848  *  SUCCESS
4849  *  RADIO_NOT_AVAILABLE
4850  *  SMS_SEND_FAIL_RETRY
4851  *  FDN_CHECK_FAILURE
4852  *  NETWORK_REJECT
4853  *  INVALID_ARGUMENTS
4854  *  INVALID_STATE
4855  *  NO_MEMORY
4856  *  INVALID_SMS_FORMAT
4857  *  SYSTEM_ERR
4858  *  REQUEST_RATE_LIMITED
4859  *  MODEM_ERR
4860  *  NETWORK_ERR
4861  *  ENCODING_ERR
4862  *  INVALID_SMSC_ADDRESS
4863  *  MODE_NOT_SUPPORTED
4864  *  GENERIC_FAILURE
4865  *
4866  */
4867 #define RIL_REQUEST_IMS_SEND_SMS 113
4868
4869 /**
4870  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC
4871  *
4872  * Request APDU exchange on the basic channel. This command reflects TS 27.007
4873  * "generic SIM access" operation (+CSIM). The modem must ensure proper function
4874  * of GSM/CDMA, and filter commands appropriately. It should filter
4875  * channel management and SELECT by DF name commands.
4876  *
4877  * "data" is a const RIL_SIM_APDU *
4878  * "sessionid" field should be ignored.
4879  *
4880  * "response" is a const RIL_SIM_IO_Response *
4881  *
4882  * Valid errors:
4883  *  SUCCESS
4884  *  RADIO_NOT_AVAILABLE
4885  *  GENERIC_FAILURE
4886  */
4887 #define RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC 114
4888
4889 /**
4890  * RIL_REQUEST_SIM_OPEN_CHANNEL
4891  *
4892  * Open a new logical channel and select the given application. This command
4893  * reflects TS 27.007 "open logical channel" operation (+CCHO).
4894  *
4895  * "data" is const char * and set to AID value, See ETSI 102.221 and 101.220.
4896  *
4897  * "response" is int *
4898  * ((int *)data)[0] contains the session id of the logical channel.
4899  * ((int *)data)[1] onwards may optionally contain the select response for the
4900  *     open channel command with one byte per integer.
4901  *
4902  * Valid errors:
4903  *  SUCCESS
4904  *  RADIO_NOT_AVAILABLE
4905  *  GENERIC_FAILURE
4906  *  MISSING_RESOURCE
4907  *  NO_SUCH_ELEMENT
4908  */
4909 #define RIL_REQUEST_SIM_OPEN_CHANNEL 115
4910
4911 /**
4912  * RIL_REQUEST_SIM_CLOSE_CHANNEL
4913  *
4914  * Close a previously opened logical channel. This command reflects TS 27.007
4915  * "close logical channel" operation (+CCHC).
4916  *
4917  * "data" is int *
4918  * ((int *)data)[0] is the session id of logical the channel to close.
4919  *
4920  * "response" is NULL
4921  *
4922  * Valid errors:
4923  *  SUCCESS
4924  *  RADIO_NOT_AVAILABLE
4925  *  GENERIC_FAILURE
4926  */
4927 #define RIL_REQUEST_SIM_CLOSE_CHANNEL 116
4928
4929 /**
4930  * RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL
4931  *
4932  * Exchange APDUs with a UICC over a previously opened logical channel. This
4933  * command reflects TS 27.007 "generic logical channel access" operation
4934  * (+CGLA). The modem should filter channel management and SELECT by DF name
4935  * commands.
4936  *
4937  * "data" is a const RIL_SIM_APDU*
4938  *
4939  * "response" is a const RIL_SIM_IO_Response *
4940  *
4941  * Valid errors:
4942  *  SUCCESS
4943  *  RADIO_NOT_AVAILABLE
4944  *  GENERIC_FAILURE
4945  */
4946 #define RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL 117
4947
4948 /**
4949  * RIL_REQUEST_NV_READ_ITEM
4950  *
4951  * Read one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
4952  * This is used for device configuration by some CDMA operators.
4953  *
4954  * "data" is a const RIL_NV_ReadItem *
4955  *
4956  * "response" is const char * containing the contents of the NV item
4957  *
4958  * Valid errors:
4959  *  SUCCESS
4960  *  RADIO_NOT_AVAILABLE
4961  *  GENERIC_FAILURE
4962  */
4963 #define RIL_REQUEST_NV_READ_ITEM 118
4964
4965 /**
4966  * RIL_REQUEST_NV_WRITE_ITEM
4967  *
4968  * Write one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
4969  * This is used for device configuration by some CDMA operators.
4970  *
4971  * "data" is a const RIL_NV_WriteItem *
4972  *
4973  * "response" is NULL
4974  *
4975  * Valid errors:
4976  *  SUCCESS
4977  *  RADIO_NOT_AVAILABLE
4978  *  GENERIC_FAILURE
4979  */
4980 #define RIL_REQUEST_NV_WRITE_ITEM 119
4981
4982 /**
4983  * RIL_REQUEST_NV_WRITE_CDMA_PRL
4984  *
4985  * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
4986  * This is used for device configuration by some CDMA operators.
4987  *
4988  * "data" is a const char * containing the PRL as a byte array
4989  *
4990  * "response" is NULL
4991  *
4992  * Valid errors:
4993  *  SUCCESS
4994  *  RADIO_NOT_AVAILABLE
4995  *  GENERIC_FAILURE
4996  */
4997 #define RIL_REQUEST_NV_WRITE_CDMA_PRL 120
4998
4999 /**
5000  * RIL_REQUEST_NV_RESET_CONFIG
5001  *
5002  * Reset the radio NV configuration to the factory state.
5003  * This is used for device configuration by some CDMA operators.
5004  *
5005  * "data" is int *
5006  * ((int *)data)[0] is 1 to reload all NV items
5007  * ((int *)data)[0] is 2 for erase NV reset (SCRTN)
5008  * ((int *)data)[0] is 3 for factory reset (RTN)
5009  *
5010  * "response" is NULL
5011  *
5012  * Valid errors:
5013  *  SUCCESS
5014  *  RADIO_NOT_AVAILABLE
5015  *  GENERIC_FAILURE
5016  */
5017 #define RIL_REQUEST_NV_RESET_CONFIG 121
5018
5019  /** RIL_REQUEST_SET_UICC_SUBSCRIPTION
5020  * FIXME This API needs to have more documentation.
5021  *
5022  * Selection/de-selection of a subscription from a SIM card
5023  * "data" is const  RIL_SelectUiccSub*
5024
5025  *
5026  * "response" is NULL
5027  *
5028  *  Valid errors:
5029  *  SUCCESS
5030  *  RADIO_NOT_AVAILABLE (radio resetting)
5031  *  GENERIC_FAILURE
5032  *  SUBSCRIPTION_NOT_SUPPORTED
5033  *
5034  */
5035 #define RIL_REQUEST_SET_UICC_SUBSCRIPTION  122
5036
5037 /**
5038  *  RIL_REQUEST_ALLOW_DATA
5039  *
5040  *  Tells the modem whether data calls are allowed or not
5041  *
5042  * "data" is int *
5043  * FIXME slotId and aid will be added.
5044  * ((int *)data)[0] is == 0 to allow data calls
5045  * ((int *)data)[0] is == 1 to disallow data calls
5046  *
5047  * "response" is NULL
5048  *
5049  *  Valid errors:
5050  *
5051  *  SUCCESS
5052  *  RADIO_NOT_AVAILABLE (radio resetting)
5053  *  GENERIC_FAILURE
5054  *
5055  */
5056 #define RIL_REQUEST_ALLOW_DATA  123
5057
5058 /**
5059  * RIL_REQUEST_GET_HARDWARE_CONFIG
5060  *
5061  * Request all of the current hardware (modem and sim) associated
5062  * with the RIL.
5063  *
5064  * "data" is NULL
5065  *
5066  * "response" is an array of  RIL_HardwareConfig.
5067  */
5068 #define RIL_REQUEST_GET_HARDWARE_CONFIG 124
5069
5070 /**
5071  * RIL_REQUEST_SIM_AUTHENTICATION
5072  *
5073  * Returns the response of SIM Authentication through RIL to a
5074  * challenge request.
5075  *
5076  * "data" Base64 encoded string containing challenge:
5077  *      int   authContext;          P2 value of authentication command, see P2 parameter in
5078  *                                  3GPP TS 31.102 7.1.2
5079  *      char *authData;             the challenge string in Base64 format, see 3GPP
5080  *                                  TS 31.102 7.1.2
5081  *      char *aid;                  AID value, See ETSI 102.221 8.1 and 101.220 4,
5082  *                                  NULL if no value
5083  *
5084  * "response" Base64 encoded strings containing response:
5085  *      int   sw1;                  Status bytes per 3GPP TS 31.102 section 7.3
5086  *      int   sw2;
5087  *      char *simResponse;          Response in Base64 format, see 3GPP TS 31.102 7.1.2
5088  */
5089 #define RIL_REQUEST_SIM_AUTHENTICATION 125
5090
5091 /**
5092  * RIL_REQUEST_GET_DC_RT_INFO
5093  *
5094  * The request is DEPRECATED, use RIL_REQUEST_GET_ACTIVITY_INFO
5095  * Requests the Data Connection Real Time Info
5096  *
5097  * "data" is NULL
5098  *
5099  * "response" is the most recent RIL_DcRtInfo
5100  *
5101  * Valid errors:
5102  *  SUCCESS
5103  *  RADIO_NOT_AVAILABLE
5104  *  GENERIC_FAILURE
5105  *
5106  * See also: RIL_UNSOL_DC_RT_INFO_CHANGED
5107  */
5108 #define RIL_REQUEST_GET_DC_RT_INFO 126
5109
5110 /**
5111  * RIL_REQUEST_SET_DC_RT_INFO_RATE
5112  *
5113  * The request is DEPRECATED
5114  * This is the minimum number of milliseconds between successive
5115  * RIL_UNSOL_DC_RT_INFO_CHANGED messages and defines the highest rate
5116  * at which RIL_UNSOL_DC_RT_INFO_CHANGED's will be sent. A value of
5117  * 0 means send as fast as possible.
5118  *
5119  * "data" The number of milliseconds as an int
5120  *
5121  * "response" is null
5122  *
5123  * Valid errors:
5124  *  SUCCESS must not fail
5125  */
5126 #define RIL_REQUEST_SET_DC_RT_INFO_RATE 127
5127
5128 /**
5129  * RIL_REQUEST_SET_DATA_PROFILE
5130  *
5131  * Set data profile in modem
5132  * Modem should erase existed profiles from framework, and apply new profiles
5133  * "data" is a const RIL_DataProfileInfo **
5134  * "datalen" is count * sizeof(const RIL_DataProfileInfo *)
5135  * "response" is NULL
5136  *
5137  * Valid errors:
5138  *  SUCCESS
5139  *  RADIO_NOT_AVAILABLE (radio resetting)
5140  *  GENERIC_FAILURE
5141  *  SUBSCRIPTION_NOT_AVAILABLE
5142  */
5143 #define RIL_REQUEST_SET_DATA_PROFILE 128
5144
5145 /**
5146  * RIL_REQUEST_SHUTDOWN
5147  *
5148  * Device is shutting down. All further commands are ignored
5149  * and RADIO_NOT_AVAILABLE must be returned.
5150  *
5151  * "data" is null
5152  * "response" is NULL
5153  *
5154  * Valid errors:
5155  *  SUCCESS
5156  *  RADIO_NOT_AVAILABLE
5157  *  OPERATION_NOT_ALLOWED
5158  *  GENERIC_FAILURE
5159  */
5160 #define RIL_REQUEST_SHUTDOWN 129
5161
5162 /**
5163  * RIL_REQUEST_GET_RADIO_CAPABILITY
5164  *
5165  * Used to get phone radio capablility.
5166  *
5167  * "data" is the RIL_RadioCapability structure
5168  *
5169  * Valid errors:
5170  *  SUCCESS
5171  *  RADIO_NOT_AVAILABLE
5172  *  OPERATION_NOT_ALLOWED
5173  *  GENERIC_FAILURE
5174  */
5175 #define RIL_REQUEST_GET_RADIO_CAPABILITY 130
5176
5177 /**
5178  * RIL_REQUEST_SET_RADIO_CAPABILITY
5179  *
5180  * Used to set the phones radio capability. Be VERY careful
5181  * using this request as it may cause some vendor modems to reset. Because
5182  * of the possible modem reset any RIL commands after this one may not be
5183  * processed.
5184  *
5185  * "data" is the RIL_RadioCapability structure
5186  *
5187  * "response" is the RIL_RadioCapability structure, used to feedback return status
5188  *
5189  * Valid errors:
5190  *  SUCCESS means a RIL_UNSOL_RADIO_CAPABILITY will be sent within 30 seconds.
5191  *  RADIO_NOT_AVAILABLE
5192  *  OPERATION_NOT_ALLOWED
5193  *  GENERIC_FAILURE
5194  */
5195 #define RIL_REQUEST_SET_RADIO_CAPABILITY 131
5196
5197 /**
5198  * RIL_REQUEST_START_LCE
5199  *
5200  * Start Link Capacity Estimate (LCE) service if supported by the radio.
5201  *
5202  * "data" is const int *
5203  * ((const int*)data)[0] specifies the desired reporting interval (ms).
5204  * ((const int*)data)[1] specifies the LCE service mode. 1: PULL; 0: PUSH.
5205  *
5206  * "response" is the RIL_LceStatusInfo.
5207  *
5208  * Valid errors:
5209  * SUCCESS
5210  * RADIO_NOT_AVAILABLE
5211  * LCE_NOT_SUPPORTED
5212  */
5213 #define RIL_REQUEST_START_LCE 132
5214
5215 /**
5216  * RIL_REQUEST_STOP_LCE
5217  *
5218  * Stop Link Capacity Estimate (LCE) service, the STOP operation should be
5219  * idempotent for the radio modem.
5220  *
5221  * "response" is the RIL_LceStatusInfo.
5222  *
5223  * Valid errors:
5224  * SUCCESS
5225  * RADIO_NOT_AVAILABLE
5226  * LCE_NOT_SUPPORTED
5227  */
5228 #define RIL_REQUEST_STOP_LCE 133
5229
5230 /**
5231  * RIL_REQUEST_PULL_LCEDATA
5232  *
5233  * Pull LCE service for capacity information.
5234  *
5235  * "response" is the RIL_LceDataInfo.
5236  *
5237  * Valid errors:
5238  * SUCCESS
5239  * RADIO_NOT_AVAILABLE
5240  * LCE_NOT_SUPPORTED
5241  */
5242 #define RIL_REQUEST_PULL_LCEDATA 134
5243
5244 /**
5245  * RIL_REQUEST_GET_ACTIVITY_INFO
5246  *
5247  * Get modem activity information for power consumption estimation.
5248  *
5249  * Request clear-on-read statistics information that is used for
5250  * estimating the per-millisecond power consumption of the cellular
5251  * modem.
5252  *
5253  * "data" is null
5254  * "response" is const RIL_ActivityStatsInfo *
5255  *
5256  * Valid errors:
5257  *
5258  * SUCCESS
5259  * RADIO_NOT_AVAILABLE (radio resetting)
5260  * GENERIC_FAILURE
5261  */
5262 #define RIL_REQUEST_GET_ACTIVITY_INFO 135
5263
5264 /**
5265  * RIL_REQUEST_SET_CARRIER_RESTRICTIONS
5266  *
5267  * Set carrier restrictions for this sim slot. Expected modem behavior:
5268  *  If never receives this command
5269  *  - Must allow all carriers
5270  *  Receives this command with data being NULL
5271  *  - Must allow all carriers. If a previously allowed SIM is present, modem must not reload
5272  *    the SIM. If a previously disallowed SIM is present, reload the SIM and notify Android.
5273  *  Receives this command with a list of carriers
5274  *  - Only allow specified carriers, persist across power cycles and FDR. If a present SIM
5275  *    is in the allowed list, modem must not reload the SIM. If a present SIM is *not* in
5276  *    the allowed list, modem must detach from the registered network and only keep emergency
5277  *    service, and notify Android SIM refresh reset with new SIM state being
5278  *    RIL_CARDSTATE_RESTRICTED. Emergency service must be enabled.
5279  *
5280  * "data" is const RIL_CarrierRestrictions *
5281  * A list of allowed carriers and possibly a list of excluded carriers.
5282  * If data is NULL, means to clear previous carrier restrictions and allow all carriers
5283  *
5284  * "response" is int *
5285  * ((int *)data)[0] contains the number of allowed carriers which have been set correctly.
5286  * On success, it should match the length of list data->allowed_carriers.
5287  * If data is NULL, the value must be 0.
5288  *
5289  * Valid errors:
5290  *  RIL_E_SUCCESS
5291  *  RIL_E_INVALID_ARGUMENTS
5292  *  RIL_E_RADIO_NOT_AVAILABLE
5293  *  RIL_E_REQUEST_NOT_SUPPORTED
5294  */
5295 #define RIL_REQUEST_SET_CARRIER_RESTRICTIONS 136
5296
5297 /**
5298  * RIL_REQUEST_GET_CARRIER_RESTRICTIONS
5299  *
5300  * Get carrier restrictions for this sim slot. Expected modem behavior:
5301  *  Return list of allowed carriers, or null if all carriers are allowed.
5302  *
5303  * "data" is NULL
5304  *
5305  * "response" is const RIL_CarrierRestrictions *.
5306  * If response is NULL, it means all carriers are allowed.
5307  *
5308  * Valid errors:
5309  *  RIL_E_SUCCESS
5310  *  RIL_E_RADIO_NOT_AVAILABLE
5311  *  RIL_E_REQUEST_NOT_SUPPORTED
5312  */
5313 #define RIL_REQUEST_GET_CARRIER_RESTRICTIONS 137
5314
5315 /**
5316  * RIL_REQUEST_SEND_DEVICE_STATE
5317  *
5318  * Send the updated device state.
5319  * Modem can perform power saving based on the provided device state.
5320  * "data" is const int *
5321  * ((const int*)data)[0] A RIL_DeviceStateType that specifies the device state type.
5322  * ((const int*)data)[1] Specifies the state. See RIL_DeviceStateType for the definition of each
5323  *                       type.
5324  *
5325  * "datalen" is count * sizeof(const RIL_DeviceState *)
5326  * "response" is NULL
5327  *
5328  * Valid errors:
5329  *  SUCCESS
5330  *  RADIO_NOT_AVAILABLE (radio resetting)
5331  */
5332 #define RIL_REQUEST_SEND_DEVICE_STATE 138
5333
5334 /**
5335  * RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER
5336  *
5337  * Set the unsolicited response filter
5338  * This is used to prevent unnecessary application processor
5339  * wake up for power saving purposes by suppressing the
5340  * unsolicited responses in certain scenarios.
5341  *
5342  * "data" is an int *
5343  *
5344  * ((int *)data)[0] is a 32-bit bitmask of RIL_UnsolicitedResponseFilter
5345  *
5346  * "response" is NULL
5347  *
5348  * Valid errors:
5349  *  SUCCESS
5350  *  INVALID_ARGUMENTS (e.g. the requested filter doesn't exist)
5351  *  RADIO_NOT_AVAILABLE (radio resetting)
5352  */
5353 #define RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER 139
5354
5355  /**
5356   * RIL_REQUEST_SET_SIM_CARD_POWER
5357   *
5358   * Set SIM card power up or down
5359   *
5360   * Request is equivalent to inserting and removing the card, with
5361   * an additional effect where the ability to detect card removal/insertion
5362   * is disabled when the SIM card is powered down.
5363   *
5364   * This will generate RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
5365   * as if the SIM had been inserted or removed.
5366   *
5367   * "data" is int *
5368   * ((int *)data)[0] is 1 for "SIM POWER UP"
5369   * ((int *)data)[0] is 0 for "SIM POWER DOWN"
5370   *
5371   * "response" is NULL
5372   *
5373   * Valid errors:
5374   *  SUCCESS
5375   *  RADIO_NOT_AVAILABLE
5376   *  REQUEST_NOT_SUPPORTED
5377   *  SIM_ABSENT
5378   *  INVALID_ARGUMENTS
5379   */
5380 #define RIL_REQUEST_SET_SIM_CARD_POWER 140
5381 /***********************************************************************/
5382
5383 /**
5384  * RIL_RESPONSE_ACKNOWLEDGEMENT
5385  *
5386  * This is used by Asynchronous solicited messages and Unsolicited messages
5387  * to acknowledge the receipt of those messages in RIL.java so that the ack
5388  * can be used to let ril.cpp to release wakelock.
5389  *
5390  * Valid errors
5391  * SUCCESS
5392  * RADIO_NOT_AVAILABLE
5393  */
5394
5395 #define RIL_RESPONSE_ACKNOWLEDGEMENT 800
5396
5397 /***********************************************************************/
5398
5399
5400 #define RIL_UNSOL_RESPONSE_BASE 1000
5401
5402 /**
5403  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
5404  *
5405  * Indicate when value of RIL_RadioState has changed.
5406  *
5407  * Callee will invoke RIL_RadioStateRequest method on main thread
5408  *
5409  * "data" is NULL
5410  */
5411
5412 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
5413
5414
5415 /**
5416  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
5417  *
5418  * Indicate when call state has changed
5419  *
5420  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
5421  *
5422  * "data" is NULL
5423  *
5424  * Response should be invoked on, for example,
5425  * "RING", "BUSY", "NO CARRIER", and also call state
5426  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
5427  *
5428  * Redundent or extraneous invocations are tolerated
5429  */
5430 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
5431
5432
5433 /**
5434  * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
5435  *
5436  * Called when the voice network state changed
5437  *
5438  * Callee will invoke the following requests on main thread:
5439  *
5440  * RIL_REQUEST_VOICE_REGISTRATION_STATE
5441  * RIL_REQUEST_OPERATOR
5442  *
5443  * "data" is NULL
5444  *
5445  * FIXME should this happen when SIM records are loaded? (eg, for
5446  * EONS)
5447  */
5448 #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
5449
5450 /**
5451  * RIL_UNSOL_RESPONSE_NEW_SMS
5452  *
5453  * Called when new SMS is received.
5454  *
5455  * "data" is const char *
5456  * This is a pointer to a string containing the PDU of an SMS-DELIVER
5457  * as an ascii string of hex digits. The PDU starts with the SMSC address
5458  * per TS 27.005 (+CMT:)
5459  *
5460  * Callee will subsequently confirm the receipt of thei SMS with a
5461  * RIL_REQUEST_SMS_ACKNOWLEDGE
5462  *
5463  * No new RIL_UNSOL_RESPONSE_NEW_SMS
5464  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
5465  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
5466  */
5467
5468 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
5469
5470 /**
5471  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
5472  *
5473  * Called when new SMS Status Report is received.
5474  *
5475  * "data" is const char *
5476  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
5477  * as an ascii string of hex digits. The PDU starts with the SMSC address
5478  * per TS 27.005 (+CDS:).
5479  *
5480  * Callee will subsequently confirm the receipt of the SMS with a
5481  * RIL_REQUEST_SMS_ACKNOWLEDGE
5482  *
5483  * No new RIL_UNSOL_RESPONSE_NEW_SMS
5484  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
5485  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
5486  */
5487
5488 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
5489
5490 /**
5491  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
5492  *
5493  * Called when new SMS has been stored on SIM card
5494  *
5495  * "data" is const int *
5496  * ((const int *)data)[0] contains the slot index on the SIM that contains
5497  * the new message
5498  */
5499
5500 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
5501
5502 /**
5503  * RIL_UNSOL_ON_USSD
5504  *
5505  * Called when a new USSD message is received.
5506  *
5507  * "data" is const char **
5508  * ((const char **)data)[0] points to a type code, which is
5509  *  one of these string values:
5510  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
5511  *      "1"   USSD-Request -- text in ((const char **)data)[1]
5512  *      "2"   Session terminated by network
5513  *      "3"   other local client (eg, SIM Toolkit) has responded
5514  *      "4"   Operation not supported
5515  *      "5"   Network timeout
5516  *
5517  * The USSD session is assumed to persist if the type code is "1", otherwise
5518  * the current session (if any) is assumed to have terminated.
5519  *
5520  * ((const char **)data)[1] points to a message string if applicable, which
5521  * should always be in UTF-8.
5522  */
5523 #define RIL_UNSOL_ON_USSD 1006
5524 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
5525
5526 /**
5527  * RIL_UNSOL_ON_USSD_REQUEST
5528  *
5529  * Obsolete. Send via RIL_UNSOL_ON_USSD
5530  */
5531 #define RIL_UNSOL_ON_USSD_REQUEST 1007
5532
5533 /**
5534  * RIL_UNSOL_NITZ_TIME_RECEIVED
5535  *
5536  * Called when radio has received a NITZ time message
5537  *
5538  * "data" is const char * pointing to NITZ time string
5539  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
5540  */
5541 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
5542
5543 /**
5544  * RIL_UNSOL_SIGNAL_STRENGTH
5545  *
5546  * Radio may report signal strength rather han have it polled.
5547  *
5548  * "data" is a const RIL_SignalStrength *
5549  */
5550 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
5551
5552
5553 /**
5554  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
5555  *
5556  * "data" is an array of RIL_Data_Call_Response_v6 identical to that
5557  * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
5558  * of current data contexts including new contexts that have been
5559  * activated. A data call is only removed from this list when the
5560  * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
5561  * is powered off/on.
5562  *
5563  * See also: RIL_REQUEST_DATA_CALL_LIST
5564  */
5565
5566 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
5567
5568 /**
5569  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
5570  *
5571  * Reports supplementary service related notification from the network.
5572  *
5573  * "data" is a const RIL_SuppSvcNotification *
5574  *
5575  */
5576
5577 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
5578
5579 /**
5580  * RIL_UNSOL_STK_SESSION_END
5581  *
5582  * Indicate when STK session is terminated by SIM.
5583  *
5584  * "data" is NULL
5585  */
5586 #define RIL_UNSOL_STK_SESSION_END 1012
5587
5588 /**
5589  * RIL_UNSOL_STK_PROACTIVE_COMMAND
5590  *
5591  * Indicate when SIM issue a STK proactive command to applications
5592  *
5593  * "data" is a const char * containing SAT/USAT proactive command
5594  * in hexadecimal format string starting with command tag
5595  *
5596  */
5597 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
5598
5599 /**
5600  * RIL_UNSOL_STK_EVENT_NOTIFY
5601  *
5602  * Indicate when SIM notifies applcations some event happens.
5603  * Generally, application does not need to have any feedback to
5604  * SIM but shall be able to indicate appropriate messages to users.
5605  *
5606  * "data" is a const char * containing SAT/USAT commands or responses
5607  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
5608  * starting with first byte of response data or command tag
5609  *
5610  */
5611 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
5612
5613 /**
5614  * RIL_UNSOL_STK_CALL_SETUP
5615  *
5616  * Indicate when SIM wants application to setup a voice call.
5617  *
5618  * "data" is const int *
5619  * ((const int *)data)[0] contains timeout value (in milliseconds)
5620  */
5621 #define RIL_UNSOL_STK_CALL_SETUP 1015
5622
5623 /**
5624  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
5625  *
5626  * Indicates that SMS storage on the SIM is full.  Sent when the network
5627  * attempts to deliver a new SMS message.  Messages cannot be saved on the
5628  * SIM until space is freed.  In particular, incoming Class 2 messages
5629  * cannot be stored.
5630  *
5631  * "data" is null
5632  *
5633  */
5634 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
5635
5636 /**
5637  * RIL_UNSOL_SIM_REFRESH
5638  *
5639  * Indicates that file(s) on the SIM have been updated, or the SIM
5640  * has been reinitialized.
5641  *
5642  * In the case where RIL is version 6 or older:
5643  * "data" is an int *
5644  * ((int *)data)[0] is a RIL_SimRefreshResult.
5645  * ((int *)data)[1] is the EFID of the updated file if the result is
5646  * SIM_FILE_UPDATE or NULL for any other result.
5647  *
5648  * In the case where RIL is version 7:
5649  * "data" is a RIL_SimRefreshResponse_v7 *
5650  *
5651  * Note: If the SIM state changes as a result of the SIM refresh (eg,
5652  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
5653  * should be sent.
5654  */
5655 #define RIL_UNSOL_SIM_REFRESH 1017
5656
5657 /**
5658  * RIL_UNSOL_CALL_RING
5659  *
5660  * Ring indication for an incoming call (eg, RING or CRING event).
5661  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
5662  * of a call and sending multiple is optional. If the system property
5663  * ro.telephony.call_ring.multiple is false then the upper layers
5664  * will generate the multiple events internally. Otherwise the vendor
5665  * ril must generate multiple RIL_UNSOL_CALL_RING if
5666  * ro.telephony.call_ring.multiple is true or if it is absent.
5667  *
5668  * The rate of these events is controlled by ro.telephony.call_ring.delay
5669  * and has a default value of 3000 (3 seconds) if absent.
5670  *
5671  * "data" is null for GSM
5672  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
5673  */
5674 #define RIL_UNSOL_CALL_RING 1018
5675
5676 /**
5677  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
5678  *
5679  * Indicates that SIM state changes.
5680  *
5681  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
5682
5683  * "data" is null
5684  */
5685 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
5686
5687 /**
5688  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
5689  *
5690  * Called when new CDMA SMS is received
5691  *
5692  * "data" is const RIL_CDMA_SMS_Message *
5693  *
5694  * Callee will subsequently confirm the receipt of the SMS with
5695  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
5696  *
5697  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
5698  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
5699  *
5700  */
5701 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
5702
5703 /**
5704  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
5705  *
5706  * Called when new Broadcast SMS is received
5707  *
5708  * "data" can be one of the following:
5709  * If received from GSM network, "data" is const char of 88 bytes
5710  * which indicates each page of a CBS Message sent to the MS by the
5711  * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
5712  * If received from UMTS network, "data" is const char of 90 up to 1252
5713  * bytes which contain between 1 and 15 CBS Message pages sent as one
5714  * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
5715  *
5716  */
5717 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
5718
5719 /**
5720  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
5721  *
5722  * Indicates that SMS storage on the RUIM is full.  Messages
5723  * cannot be saved on the RUIM until space is freed.
5724  *
5725  * "data" is null
5726  *
5727  */
5728 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
5729
5730 /**
5731  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
5732  *
5733  * Indicates a restricted state change (eg, for Domain Specific Access Control).
5734  *
5735  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
5736  *
5737  * "data" is an int *
5738  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
5739  */
5740 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
5741
5742 /**
5743  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
5744  *
5745  * Indicates that the radio system selection module has
5746  * autonomously entered emergency callback mode.
5747  *
5748  * "data" is null
5749  *
5750  */
5751 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
5752
5753 /**
5754  * RIL_UNSOL_CDMA_CALL_WAITING
5755  *
5756  * Called when CDMA radio receives a call waiting indication.
5757  *
5758  * "data" is const RIL_CDMA_CallWaiting *
5759  *
5760  */
5761 #define RIL_UNSOL_CDMA_CALL_WAITING 1025
5762
5763 /**
5764  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
5765  *
5766  * Called when CDMA radio receives an update of the progress of an
5767  * OTASP/OTAPA call.
5768  *
5769  * "data" is const int *
5770  *  For CDMA this is an integer OTASP/OTAPA status listed in
5771  *  RIL_CDMA_OTA_ProvisionStatus.
5772  *
5773  */
5774 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
5775
5776 /**
5777  * RIL_UNSOL_CDMA_INFO_REC
5778  *
5779  * Called when CDMA radio receives one or more info recs.
5780  *
5781  * "data" is const RIL_CDMA_InformationRecords *
5782  *
5783  */
5784 #define RIL_UNSOL_CDMA_INFO_REC 1027
5785
5786 /**
5787  * RIL_UNSOL_OEM_HOOK_RAW
5788  *
5789  * This is for OEM specific use.
5790  *
5791  * "data" is a byte[]
5792  */
5793 #define RIL_UNSOL_OEM_HOOK_RAW 1028
5794
5795 /**
5796  * RIL_UNSOL_RINGBACK_TONE
5797  *
5798  * Indicates that nework doesn't have in-band information,  need to
5799  * play out-band tone.
5800  *
5801  * "data" is an int *
5802  * ((int *)data)[0] == 0 for stop play ringback tone.
5803  * ((int *)data)[0] == 1 for start play ringback tone.
5804  */
5805 #define RIL_UNSOL_RINGBACK_TONE 1029
5806
5807 /**
5808  * RIL_UNSOL_RESEND_INCALL_MUTE
5809  *
5810  * Indicates that framework/application need reset the uplink mute state.
5811  *
5812  * There may be situations where the mute state becomes out of sync
5813  * between the application and device in some GSM infrastructures.
5814  *
5815  * "data" is null
5816  */
5817 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
5818
5819 /**
5820  * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
5821  *
5822  * Called when CDMA subscription source changed.
5823  *
5824  * "data" is int *
5825  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
5826  */
5827 #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
5828
5829 /**
5830  * RIL_UNSOL_CDMA_PRL_CHANGED
5831  *
5832  * Called when PRL (preferred roaming list) changes.
5833  *
5834  * "data" is int *
5835  * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
5836  */
5837 #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
5838
5839 /**
5840  * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
5841  *
5842  * Called when Emergency Callback Mode Ends
5843  *
5844  * Indicates that the radio system selection module has
5845  * proactively exited emergency callback mode.
5846  *
5847  * "data" is NULL
5848  *
5849  */
5850 #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
5851
5852 /**
5853  * RIL_UNSOL_RIL_CONNECTED
5854  *
5855  * Called the ril connects and returns the version
5856  *
5857  * "data" is int *
5858  * ((int *)data)[0] is RIL_VERSION
5859  */
5860 #define RIL_UNSOL_RIL_CONNECTED 1034
5861
5862 /**
5863  * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
5864  *
5865  * Indicates that voice technology has changed. Contains new radio technology
5866  * as a data in the message.
5867  *
5868  * "data" is int *
5869  * ((int *)data)[0] is of type const RIL_RadioTechnology
5870  *
5871  */
5872 #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
5873
5874 /**
5875  * RIL_UNSOL_CELL_INFO_LIST
5876  *
5877  * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned
5878  * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE.
5879  *
5880  * "data" is NULL
5881  *
5882  * "response" is an array of RIL_CellInfo_v12.
5883  */
5884 #define RIL_UNSOL_CELL_INFO_LIST 1036
5885
5886 /**
5887  * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED
5888  *
5889  * This message is DEPRECATED and shall be removed in a future release (target: 2018);
5890  * instead, provide IMS registration status via an IMS Service.
5891  *
5892  * Called when IMS registration state has changed
5893  *
5894  * To get IMS registration state and IMS SMS format, callee needs to invoke the
5895  * following request on main thread:
5896  *
5897  * RIL_REQUEST_IMS_REGISTRATION_STATE
5898  *
5899  * "data" is NULL
5900  *
5901  */
5902 #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037
5903
5904 /**
5905  * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED
5906  *
5907  * Indicated when there is a change in subscription status.
5908  * This event will be sent in the following scenarios
5909  *  - subscription readiness at modem, which was selected by telephony layer
5910  *  - when subscription is deactivated by modem due to UICC card removal
5911  *  - When network invalidates the subscription i.e. attach reject due to authentication reject
5912  *
5913  * "data" is const int *
5914  * ((const int *)data)[0] == 0 for Subscription Deactivated
5915  * ((const int *)data)[0] == 1 for Subscription Activated
5916  *
5917  */
5918 #define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1038
5919
5920 /**
5921  * RIL_UNSOL_SRVCC_STATE_NOTIFY
5922  *
5923  * Called when Single Radio Voice Call Continuity(SRVCC)
5924  * progress state has changed
5925  *
5926  * "data" is int *
5927  * ((int *)data)[0] is of type const RIL_SrvccState
5928  *
5929  */
5930
5931 #define RIL_UNSOL_SRVCC_STATE_NOTIFY 1039
5932
5933 /**
5934  * RIL_UNSOL_HARDWARE_CONFIG_CHANGED
5935  *
5936  * Called when the hardware configuration associated with the RILd changes
5937  *
5938  * "data" is an array of RIL_HardwareConfig
5939  *
5940  */
5941 #define RIL_UNSOL_HARDWARE_CONFIG_CHANGED 1040
5942
5943 /**
5944  * RIL_UNSOL_DC_RT_INFO_CHANGED
5945  *
5946  * The message is DEPRECATED, use RIL_REQUEST_GET_ACTIVITY_INFO
5947  * Sent when the DC_RT_STATE changes but the time
5948  * between these messages must not be less than the
5949  * value set by RIL_REQUEST_SET_DC_RT_RATE.
5950  *
5951  * "data" is the most recent RIL_DcRtInfo
5952  *
5953  */
5954 #define RIL_UNSOL_DC_RT_INFO_CHANGED 1041
5955
5956 /**
5957  * RIL_UNSOL_RADIO_CAPABILITY
5958  *
5959  * Sent when RIL_REQUEST_SET_RADIO_CAPABILITY completes.
5960  * Returns the phone radio capability exactly as
5961  * RIL_REQUEST_GET_RADIO_CAPABILITY and should be the
5962  * same set as sent by RIL_REQUEST_SET_RADIO_CAPABILITY.
5963  *
5964  * "data" is the RIL_RadioCapability structure
5965  */
5966 #define RIL_UNSOL_RADIO_CAPABILITY 1042
5967
5968 /*
5969  * RIL_UNSOL_ON_SS
5970  *
5971  * Called when SS response is received when DIAL/USSD/SS is changed to SS by
5972  * call control.
5973  *
5974  * "data" is const RIL_StkCcUnsolSsResponse *
5975  *
5976  */
5977 #define RIL_UNSOL_ON_SS 1043
5978
5979 /**
5980  * RIL_UNSOL_STK_CC_ALPHA_NOTIFY
5981  *
5982  * Called when there is an ALPHA from UICC during Call Control.
5983  *
5984  * "data" is const char * containing ALPHA string from UICC in UTF-8 format.
5985  *
5986  */
5987 #define RIL_UNSOL_STK_CC_ALPHA_NOTIFY 1044
5988
5989 /**
5990  * RIL_UNSOL_LCEDATA_RECV
5991  *
5992  * Called when there is an incoming Link Capacity Estimate (LCE) info report.
5993  *
5994  * "data" is the RIL_LceDataInfo structure.
5995  *
5996  */
5997 #define RIL_UNSOL_LCEDATA_RECV 1045
5998
5999  /**
6000   * RIL_UNSOL_PCO_DATA
6001   *
6002   * Called when there is new Carrier PCO data received for a data call.  Ideally
6003   * only new data will be forwarded, though this is not required.  Multiple
6004   * boxes of carrier PCO data for a given call should result in a series of
6005   * RIL_UNSOL_PCO_DATA calls.
6006   *
6007   * "data" is the RIL_PCO_Data structure.
6008   *
6009   */
6010 #define RIL_UNSOL_PCO_DATA 1046
6011
6012 /***********************************************************************/
6013
6014
6015 #if defined(ANDROID_MULTI_SIM)
6016 /**
6017  * RIL_Request Function pointer
6018  *
6019  * @param request is one of RIL_REQUEST_*
6020  * @param data is pointer to data defined for that RIL_REQUEST_*
6021  *        data is owned by caller, and should not be modified or freed by callee
6022  *        structures passed as data may contain pointers to non-contiguous memory
6023  * @param t should be used in subsequent call to RIL_onResponse
6024  * @param datalen is the length of "data" which is defined as other argument. It may or may
6025  *        not be equal to sizeof(data). Refer to the documentation of individual structures
6026  *        to find if pointers listed in the structure are contiguous and counted in the datalen
6027  *        length or not.
6028  *        (Eg: RIL_IMS_SMS_Message where we don't have datalen equal to sizeof(data))
6029  *
6030  */
6031 typedef void (*RIL_RequestFunc) (int request, void *data,
6032                                     size_t datalen, RIL_Token t, RIL_SOCKET_ID socket_id);
6033
6034 /**
6035  * This function should return the current radio state synchronously
6036  */
6037 typedef RIL_RadioState (*RIL_RadioStateRequest)(RIL_SOCKET_ID socket_id);
6038
6039 #else
6040 /* Backward compatible */
6041
6042 /**
6043  * RIL_Request Function pointer
6044  *
6045  * @param request is one of RIL_REQUEST_*
6046  * @param data is pointer to data defined for that RIL_REQUEST_*
6047  *        data is owned by caller, and should not be modified or freed by callee
6048  *        structures passed as data may contain pointers to non-contiguous memory
6049  * @param t should be used in subsequent call to RIL_onResponse
6050  * @param datalen is the length of "data" which is defined as other argument. It may or may
6051  *        not be equal to sizeof(data). Refer to the documentation of individual structures
6052  *        to find if pointers listed in the structure are contiguous and counted in the datalen
6053  *        length or not.
6054  *        (Eg: RIL_IMS_SMS_Message where we don't have datalen equal to sizeof(data))
6055  *
6056  */
6057 typedef void (*RIL_RequestFunc) (int request, void *data,
6058                                     size_t datalen, RIL_Token t);
6059
6060 /**
6061  * This function should return the current radio state synchronously
6062  */
6063 typedef RIL_RadioState (*RIL_RadioStateRequest)();
6064
6065 #endif
6066
6067
6068 /**
6069  * This function returns "1" if the specified RIL_REQUEST code is
6070  * supported and 0 if it is not
6071  *
6072  * @param requestCode is one of RIL_REQUEST codes
6073  */
6074
6075 typedef int (*RIL_Supports)(int requestCode);
6076
6077 /**
6078  * This function is called from a separate thread--not the
6079  * thread that calls RIL_RequestFunc--and indicates that a pending
6080  * request should be cancelled.
6081  *
6082  * On cancel, the callee should do its best to abandon the request and
6083  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
6084  *
6085  * Subsequent calls to  RIL_onRequestComplete for this request with
6086  * other results will be tolerated but ignored. (That is, it is valid
6087  * to ignore the cancellation request)
6088  *
6089  * RIL_Cancel calls should return immediately, and not wait for cancellation
6090  *
6091  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
6092  * interface
6093  *
6094  * @param t token wants to be canceled
6095  */
6096
6097 typedef void (*RIL_Cancel)(RIL_Token t);
6098
6099 typedef void (*RIL_TimedCallback) (void *param);
6100
6101 /**
6102  * Return a version string for your RIL implementation
6103  */
6104 typedef const char * (*RIL_GetVersion) (void);
6105
6106 typedef struct {
6107     int version;        /* set to RIL_VERSION */
6108     RIL_RequestFunc onRequest;
6109     RIL_RadioStateRequest onStateRequest;
6110     RIL_Supports supports;
6111     RIL_Cancel onCancel;
6112     RIL_GetVersion getVersion;
6113 } RIL_RadioFunctions;
6114
6115 typedef struct {
6116     char *apn;                  /* the APN to connect to */
6117     char *protocol;             /* one of the PDP_type values in TS 27.007 section 10.1.1 used on
6118                                    roaming network. For example, "IP", "IPV6", "IPV4V6", or "PPP".*/
6119     int authtype;               /* authentication protocol used for this PDP context
6120                                    (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) */
6121     char *username;             /* the username for APN, or NULL */
6122     char *password;             /* the password for APN, or NULL */
6123 } RIL_InitialAttachApn;
6124
6125 typedef struct {
6126     char *apn;                  /* the APN to connect to */
6127     char *protocol;             /* one of the PDP_type values in TS 27.007 section 10.1.1 used on
6128                                    home network. For example, "IP", "IPV6", "IPV4V6", or "PPP". */
6129     char *roamingProtocol;      /* one of the PDP_type values in TS 27.007 section 10.1.1 used on
6130                                    roaming network. For example, "IP", "IPV6", "IPV4V6", or "PPP".*/
6131     int authtype;               /* authentication protocol used for this PDP context
6132                                    (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) */
6133     char *username;             /* the username for APN, or NULL */
6134     char *password;             /* the password for APN, or NULL */
6135     int supportedTypesBitmask;  /* supported APN types bitmask. See RIL_ApnTypes for the value of
6136                                    each bit. */
6137     int bearerBitmask;          /* the bearer bitmask. See RIL_RadioAccessFamily for the value of
6138                                    each bit. */
6139     int modemCognitive;         /* indicating the APN setting was sent to the modem through
6140                                    setDataProfile earlier. */
6141     int mtu;                    /* maximum transmission unit (MTU) size in bytes */
6142     char *mvnoType;             /* the MVNO type: possible values are "imsi", "gid", "spn" */
6143     char *mvnoMatchData;        /* MVNO match data. Can be anything defined by the carrier.
6144                                    For example,
6145                                      SPN like: "A MOBILE", "BEN NL", etc...
6146                                      IMSI like: "302720x94", "2060188", etc...
6147                                      GID like: "4E", "33", etc... */
6148 } RIL_InitialAttachApn_v15;
6149
6150 typedef struct {
6151     int authContext;            /* P2 value of authentication command, see P2 parameter in
6152                                    3GPP TS 31.102 7.1.2 */
6153     char *authData;             /* the challenge string in Base64 format, see 3GPP
6154                                    TS 31.102 7.1.2 */
6155     char *aid;                  /* AID value, See ETSI 102.221 8.1 and 101.220 4,
6156                                    NULL if no value. */
6157 } RIL_SimAuthentication;
6158
6159 typedef struct {
6160     int cid;                    /* Context ID, uniquely identifies this call */
6161     char *bearer_proto;         /* One of the PDP_type values in TS 27.007 section 10.1.1.
6162                                    For example, "IP", "IPV6", "IPV4V6". */
6163     int pco_id;                 /* The protocol ID for this box.  Note that only IDs from
6164                                    FF00H - FFFFH are accepted.  If more than one is included
6165                                    from the network, multiple calls should be made to send all
6166                                    of them. */
6167     int contents_length;        /* The number of octets in the contents. */
6168     char *contents;             /* Carrier-defined content.  It is binary, opaque and
6169                                    loosely defined in LTE Layer 3 spec 24.008 */
6170 } RIL_PCO_Data;
6171
6172 #ifdef RIL_SHLIB
6173 struct RIL_Env {
6174     /**
6175      * "t" is parameter passed in on previous call to RIL_Notification
6176      * routine.
6177      *
6178      * If "e" != SUCCESS, then response can be null/is ignored
6179      *
6180      * "response" is owned by caller, and should not be modified or
6181      * freed by callee
6182      *
6183      * RIL_onRequestComplete will return as soon as possible
6184      */
6185     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
6186                            void *response, size_t responselen);
6187
6188 #if defined(ANDROID_MULTI_SIM)
6189     /**
6190      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
6191      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
6192      *
6193      * "data" is owned by caller, and should not be modified or freed by callee
6194      */
6195     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen, RIL_SOCKET_ID socket_id);
6196 #else
6197     /**
6198      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
6199      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
6200      *
6201      * "data" is owned by caller, and should not be modified or freed by callee
6202      */
6203     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen);
6204 #endif
6205     /**
6206      * Call user-specifed "callback" function on on the same thread that
6207      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
6208      * a relative time value at which the callback is invoked. If relativeTime is
6209      * NULL or points to a 0-filled structure, the callback will be invoked as
6210      * soon as possible
6211      */
6212
6213     void (*RequestTimedCallback) (RIL_TimedCallback callback,
6214                                    void *param, const struct timeval *relativeTime);
6215    /**
6216     * "t" is parameter passed in on previous call RIL_Notification routine
6217     *
6218     * RIL_onRequestAck will be called by vendor when an Async RIL request was received
6219     * by them and an ack needs to be sent back to java ril.
6220     */
6221     void (*OnRequestAck) (RIL_Token t);
6222 };
6223
6224
6225 /**
6226  *  RIL implementations must defined RIL_Init
6227  *  argc and argv will be command line arguments intended for the RIL implementation
6228  *  Return NULL on error
6229  *
6230  * @param env is environment point defined as RIL_Env
6231  * @param argc number of arguments
6232  * @param argv list fo arguments
6233  *
6234  */
6235 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
6236
6237 /**
6238  *  If BT SAP(SIM Access Profile) is supported, then RIL implementations must define RIL_SAP_Init
6239  *  for initializing RIL_RadioFunctions used for BT SAP communcations. It is called whenever RILD
6240  *  starts or modem restarts. Returns handlers for SAP related request that are made on SAP
6241  *  sepecific socket, analogous to the RIL_RadioFunctions returned by the call to RIL_Init
6242  *  and used on the general RIL socket.
6243  *  argc and argv will be command line arguments intended for the RIL implementation
6244  *  Return NULL on error.
6245  *
6246  * @param env is environment point defined as RIL_Env
6247  * @param argc number of arguments
6248  * @param argv list fo arguments
6249  *
6250  */
6251 const RIL_RadioFunctions *RIL_SAP_Init(const struct RIL_Env *env, int argc, char **argv);
6252
6253 #else /* RIL_SHLIB */
6254
6255 /**
6256  * Call this once at startup to register notification routine
6257  *
6258  * @param callbacks user-specifed callback function
6259  */
6260 void RIL_register (const RIL_RadioFunctions *callbacks);
6261
6262 void rilc_thread_pool();
6263
6264
6265 /**
6266  *
6267  * RIL_onRequestComplete will return as soon as possible
6268  *
6269  * @param t is parameter passed in on previous call to RIL_Notification
6270  *          routine.
6271  * @param e error code
6272  *          if "e" != SUCCESS, then response can be null/is ignored
6273  * @param response is owned by caller, and should not be modified or
6274  *                 freed by callee
6275  * @param responselen the length of response in byte
6276  */
6277 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
6278                            void *response, size_t responselen);
6279
6280 /**
6281  * RIL_onRequestAck will be called by vendor when an Async RIL request was received by them and
6282  * an ack needs to be sent back to java ril. This doesn't mark the end of the command or it's
6283  * results, just that the command was received and will take a while. After sending this Ack
6284  * its vendor's responsibility to make sure that AP is up whenever needed while command is
6285  * being processed.
6286  *
6287  * @param t is parameter passed in on previous call to RIL_Notification
6288  *          routine.
6289  */
6290 void RIL_onRequestAck(RIL_Token t);
6291
6292 #if defined(ANDROID_MULTI_SIM)
6293 /**
6294  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
6295  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
6296  *     "data" is owned by caller, and should not be modified or freed by callee
6297  * @param datalen the length of data in byte
6298  */
6299
6300 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
6301                                 size_t datalen, RIL_SOCKET_ID socket_id);
6302 #else
6303 /**
6304  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
6305  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
6306  *     "data" is owned by caller, and should not be modified or freed by callee
6307  * @param datalen the length of data in byte
6308  */
6309
6310 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
6311                                 size_t datalen);
6312 #endif
6313
6314 /**
6315  * Call user-specifed "callback" function on on the same thread that
6316  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
6317  * a relative time value at which the callback is invoked. If relativeTime is
6318  * NULL or points to a 0-filled structure, the callback will be invoked as
6319  * soon as possible
6320  *
6321  * @param callback user-specifed callback function
6322  * @param param parameter list
6323  * @param relativeTime a relative time value at which the callback is invoked
6324  */
6325
6326 void RIL_requestTimedCallback (RIL_TimedCallback callback,
6327                                void *param, const struct timeval *relativeTime);
6328
6329 #endif /* RIL_SHLIB */
6330
6331 #ifdef __cplusplus
6332 }
6333 #endif
6334
6335 #endif /*ANDROID_RIL_H*/