OSDN Git Service

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