OSDN Git Service

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