OSDN Git Service

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