OSDN Git Service

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