OSDN Git Service

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