OSDN Git Service

[DS] Radio Capability Support. New design of capability switch for L.
[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 #define RIL_VERSION 10     /* Current version */
50 #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
51
52 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
53 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
54
55 #define MAX_RILDS 3
56 #define MAX_SOCKET_NAME_LENGTH 6
57 #define MAX_CLIENT_ID_LENGTH 2
58 #define MAX_DEBUG_SOCKET_NAME_LENGTH 12
59 #define MAX_QEMU_PIPE_NAME_LENGTH  11
60 #define MAX_UUID_LENGTH 64
61
62
63 typedef void * RIL_Token;
64
65 typedef enum {
66     RIL_SOCKET_1,
67 #if (SIM_COUNT >= 2)
68     RIL_SOCKET_2,
69 #if (SIM_COUNT >= 3)
70     RIL_SOCKET_3,
71 #endif
72 #if (SIM_COUNT >= 4)
73     RIL_SOCKET_4,
74 #endif
75 #endif
76     RIL_SOCKET_NUM
77 } RIL_SOCKET_ID;
78
79
80 typedef enum {
81     RIL_E_SUCCESS = 0,
82     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
83     RIL_E_GENERIC_FAILURE = 2,
84     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
85     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
86     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
87     RIL_E_REQUEST_NOT_SUPPORTED = 6,
88     RIL_E_CANCELLED = 7,
89     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
90                                                    call on a Class C GPRS device */
91     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
92                                                    registers in network */
93     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
94     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
95                                                    shall be retrieved because of SIM or RUIM
96                                                    card absent */
97     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
98                                                    location */
99     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
100     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
101     RIL_E_ILLEGAL_SIM_OR_ME = 15,               /* network selection failed due to
102                                                    illegal SIM or ME */
103     RIL_E_MISSING_RESOURCE = 16,                /* no logical channel available */
104     RIL_E_NO_SUCH_ELEMENT = 17,                 /* application not found on SIM */
105 } RIL_Errno;
106
107 typedef enum {
108     RIL_CALL_ACTIVE = 0,
109     RIL_CALL_HOLDING = 1,
110     RIL_CALL_DIALING = 2,    /* MO call only */
111     RIL_CALL_ALERTING = 3,   /* MO call only */
112     RIL_CALL_INCOMING = 4,   /* MT call only */
113     RIL_CALL_WAITING = 5     /* MT call only */
114 } RIL_CallState;
115
116 typedef enum {
117     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
118     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
119     /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
120     RADIO_STATE_SIM_NOT_READY = 2,         /* Radio is on, but the SIM interface is not ready */
121     RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3,  /* SIM PIN locked, PUK required, network
122                                               personalization locked, or SIM absent */
123     RADIO_STATE_SIM_READY = 4,             /* Radio is on and SIM interface is available */
124     RADIO_STATE_RUIM_NOT_READY = 5,        /* Radio is on, but the RUIM interface is not ready */
125     RADIO_STATE_RUIM_READY = 6,            /* Radio is on and the RUIM interface is available */
126     RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
127                                               personalization locked, or RUIM absent */
128     RADIO_STATE_NV_NOT_READY = 8,          /* Radio is on, but the NV interface is not available */
129     RADIO_STATE_NV_READY = 9,              /* Radio is on and the NV interface is available */
130     RADIO_STATE_ON = 10                    /* Radio is on */
131 } RIL_RadioState;
132
133 typedef enum {
134     RADIO_TECH_UNKNOWN = 0,
135     RADIO_TECH_GPRS = 1,
136     RADIO_TECH_EDGE = 2,
137     RADIO_TECH_UMTS = 3,
138     RADIO_TECH_IS95A = 4,
139     RADIO_TECH_IS95B = 5,
140     RADIO_TECH_1xRTT =  6,
141     RADIO_TECH_EVDO_0 = 7,
142     RADIO_TECH_EVDO_A = 8,
143     RADIO_TECH_HSDPA = 9,
144     RADIO_TECH_HSUPA = 10,
145     RADIO_TECH_HSPA = 11,
146     RADIO_TECH_EVDO_B = 12,
147     RADIO_TECH_EHRPD = 13,
148     RADIO_TECH_LTE = 14,
149     RADIO_TECH_HSPAP = 15, // HSPA+
150     RADIO_TECH_GSM = 16, // Only supports voice
151     RADIO_TECH_TD_SCDMA = 17
152 } RIL_RadioTechnology;
153
154 typedef enum {
155     RAF_UNKNOWN =  (1 <<  RADIO_TECH_UNKNOWN),
156     RAF_GPRS = (1 << RADIO_TECH_GPRS),
157     RAF_EDGE = (1 << RADIO_TECH_EDGE),
158     RAF_UMTS = (1 << RADIO_TECH_UMTS),
159     RAF_IS95A = (1 << RADIO_TECH_IS95A),
160     RAF_IS95B = (1 << RADIO_TECH_IS95B),
161     RAF_1xRTT = (1 << RADIO_TECH_1xRTT),
162     RAF_EVDO_0 = (1 << RADIO_TECH_EVDO_0),
163     RAF_EVDO_A = (1 << RADIO_TECH_EVDO_A),
164     RAF_HSDPA = (1 << RADIO_TECH_HSDPA),
165     RAF_HSUPA = (1 << RADIO_TECH_HSUPA),
166     RAF_HSPA = (1 << RADIO_TECH_HSPA),
167     RAF_EVDO_B = (1 << RADIO_TECH_EVDO_B),
168     RAF_EHRPD = (1 << RADIO_TECH_EHRPD),
169     RAF_LTE = (1 << RADIO_TECH_LTE),
170     RAF_HSPAP = (1 << RADIO_TECH_HSPAP),
171     RAF_GSM = (1 << RADIO_TECH_GSM),
172     RAF_TD_SCDMA = (1 << RADIO_TECH_TD_SCDMA),
173 } RIL_RadioAccessFamily;
174
175 typedef enum {
176     RC_PHASE_CONFIGURED = 0,  // LM is configured is initial value and value after FINISH completes
177     RC_PHASE_START      = 1,  // START is sent before Apply and indicates that an APPLY will be
178                               // forthcoming with these same parameters
179     RC_PHASE_APPLY      = 2,  // APPLY is sent after all LM's receive START and returned
180                               // RIL_RadioCapability.status = 0, if any START's fail no
181                               // APPLY will be sent
182     RC_PHASE_UNSOL_RSP  = 3,  // UNSOL_RSP is sent with RIL_UNSOL_RADIO_CAPABILITY
183     RC_PHASE_FINISH     = 4   // FINISH is sent after all commands have completed. If an error
184                               // occurs in any previous command the RIL_RadioAccessesFamily and
185                               // logicalModemUuid fields will be the prior configuration thus
186                               // restoring the configuration to the previous value. An error
187                               // returned by this command will generally be ignored or may
188                               // cause that logical modem to be removed from service.
189 } RadioCapabilityPhase;
190
191 typedef enum {
192     RC_STATUS_NONE       = 0, // This parameter has no meaning with RC_PHASE_START,
193                               // RC_PHASE_APPLY
194     RC_STATUS_SUCCESS    = 1, // Tell modem the action transaction of set radio
195                               // capability was success with RC_PHASE_FINISH
196     RC_STATUS_FAIL       = 2, // Tell modem the action transaction of set radio
197                               // capability is fail with RC_PHASE_FINISH.
198 } RadioCapabilityStatus;
199
200 #define RIL_RADIO_CAPABILITY_VERSION 1
201 typedef struct {
202     int version;            // Version of structure, RIL_RADIO_CAPABILITY_VERSION
203     int session;            // Unique session value defined by framework returned in all "responses/unsol"
204     int phase;              // CONFIGURED, START, APPLY, FINISH
205     int rat;                // RIL_RadioAccessFamily for the radio
206     char logicalModemUuid[MAX_UUID_LENGTH]; // A UUID typically "com.xxxx.lmX where X is the logical modem.
207     int status;             // Return status and an input parameter for RC_PHASE_FINISH
208 } RIL_RadioCapability;
209
210 // Do we want to split Data from Voice and the use
211 // RIL_RadioTechnology for get/setPreferredVoice/Data ?
212 typedef enum {
213     PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
214     PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
215     PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
216     PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
217     PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
218     PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
219     PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
220     PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
221     PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
222     PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
223     PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
224     PREF_NET_TYPE_LTE_ONLY                 = 11, /* LTE only */
225     PREF_NET_TYPE_LTE_WCDMA                = 12  /* LTE/WCDMA */
226 } RIL_PreferredNetworkType;
227
228 /* Source for cdma subscription */
229 typedef enum {
230    CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
231    CDMA_SUBSCRIPTION_SOURCE_NV = 1
232 } RIL_CdmaSubscriptionSource;
233
234 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
235 typedef enum {
236     RIL_UUS_TYPE1_IMPLICIT = 0,
237     RIL_UUS_TYPE1_REQUIRED = 1,
238     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
239     RIL_UUS_TYPE2_REQUIRED = 3,
240     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
241     RIL_UUS_TYPE3_REQUIRED = 5,
242     RIL_UUS_TYPE3_NOT_REQUIRED = 6
243 } RIL_UUS_Type;
244
245 /* User-to-User Signaling Information data coding schemes. Possible values for
246  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
247  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
248 typedef enum {
249     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
250     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
251     RIL_UUS_DCS_X244 = 2,         /* X.244 */
252     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
253                                      convergence function */
254     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
255 } RIL_UUS_DCS;
256
257 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
258  * This data is passed in RIL_ExtensionRecord and rec contains this
259  * structure when type is RIL_UUS_INFO_EXT_REC */
260 typedef struct {
261   RIL_UUS_Type    uusType;    /* UUS Type */
262   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
263   int             uusLength;  /* Length of UUS Data */
264   char *          uusData;    /* UUS Data */
265 } RIL_UUS_Info;
266
267 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
268 typedef struct {
269   char isPresent;    /* non-zero if signal information record is present */
270   char signalType;   /* as defined 3.7.5.5-1 */
271   char alertPitch;   /* as defined 3.7.5.5-2 */
272   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
273 } RIL_CDMA_SignalInfoRecord;
274
275 typedef struct {
276     RIL_CallState   state;
277     int             index;      /* Connection Index for use with, eg, AT+CHLD */
278     int             toa;        /* type of address, eg 145 = intl */
279     char            isMpty;     /* nonzero if is mpty call */
280     char            isMT;       /* nonzero if call is mobile terminated */
281     char            als;        /* ALS line indicator if available
282                                    (0 = line 1) */
283     char            isVoice;    /* nonzero if this is is a voice call */
284     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
285     char *          number;     /* Remote party number */
286     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
287     char *          name;       /* Remote party name */
288     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
289     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
290 } RIL_Call;
291
292 /* Deprecated, use RIL_Data_Call_Response_v6 */
293 typedef struct {
294     int             cid;        /* Context ID, uniquely identifies this call */
295     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
296     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
297                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
298     char *          apn;        /* ignored */
299     char *          address;    /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
300 } RIL_Data_Call_Response_v4;
301
302 /*
303  * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
304  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
305  */
306 typedef struct {
307     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
308     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
309                                            back-off timer value RIL wants to override the one
310                                            pre-configured in FW.
311                                            The unit is miliseconds.
312                                            The value < 0 means no value is suggested.
313                                            The value 0 means retry should be done ASAP.
314                                            The value of INT_MAX(0x7fffffff) means no retry. */
315     int             cid;        /* Context ID, uniquely identifies this call */
316     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
317     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
318                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
319                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
320                                    such as "IP" or "IPV6" */
321     char *          ifname;     /* The network interface name */
322     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
323                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
324                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
325                                    one of each. If the prefix length is absent the addresses
326                                    are assumed to be point to point with IPv4 having a prefix
327                                    length of 32 and IPv6 128. */
328     char *          dnses;      /* A space-delimited list of DNS server addresses,
329                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
330                                    May be empty. */
331     char *          gateways;   /* A space-delimited list of default gateway addresses,
332                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
333                                    May be empty in which case the addresses represent point
334                                    to point connections. */
335 } RIL_Data_Call_Response_v6;
336
337 typedef struct {
338     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
339     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
340                                            back-off timer value RIL wants to override the one
341                                            pre-configured in FW.
342                                            The unit is miliseconds.
343                                            The value < 0 means no value is suggested.
344                                            The value 0 means retry should be done ASAP.
345                                            The value of INT_MAX(0x7fffffff) means no retry. */
346     int             cid;        /* Context ID, uniquely identifies this call */
347     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
348     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
349                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
350                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
351                                    such as "IP" or "IPV6" */
352     char *          ifname;     /* The network interface name */
353     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
354                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
355                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
356                                    one of each. If the prefix length is absent the addresses
357                                    are assumed to be point to point with IPv4 having a prefix
358                                    length of 32 and IPv6 128. */
359     char *          dnses;      /* A space-delimited list of DNS server addresses,
360                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
361                                    May be empty. */
362     char *          gateways;   /* A space-delimited list of default gateway addresses,
363                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
364                                    May be empty in which case the addresses represent point
365                                    to point connections. */
366     char *          pcscf;    /* the Proxy Call State Control Function address
367                                  via PCO(Protocol Configuration Option) for IMS client. */
368 } RIL_Data_Call_Response_v9; // FIXME: Change to v10
369
370 typedef enum {
371     RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
372     RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
373 } RIL_RadioTechnologyFamily;
374
375 typedef struct {
376     RIL_RadioTechnologyFamily tech;
377     unsigned char             retry;       /* 0 == not retry, nonzero == retry */
378     int                       messageRef;  /* Valid field if retry is set to nonzero.
379                                               Contains messageRef from RIL_SMS_Response
380                                               corresponding to failed MO SMS.
381                                             */
382
383     union {
384         /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */
385         RIL_CDMA_SMS_Message* cdmaMessage;
386
387         /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */
388         char**                gsmMessage;
389     } message;
390 } RIL_IMS_SMS_Message;
391
392 typedef struct {
393     int messageRef;   /* TP-Message-Reference for GSM,
394                          and BearerData MessageId for CDMA
395                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
396     char *ackPDU;     /* or NULL if n/a */
397     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
398                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
399                          -1 if unknown or not applicable*/
400 } RIL_SMS_Response;
401
402 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
403 typedef struct {
404     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
405                     /*      0 = "REC UNREAD"    */
406                     /*      1 = "REC READ"      */
407                     /*      2 = "STO UNSENT"    */
408                     /*      3 = "STO SENT"      */
409     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
410                        the TP-layer length is "strlen(pdu)/2". */
411     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
412                        (as expected by TS 27.005) or NULL for default SMSC */
413 } RIL_SMS_WriteArgs;
414
415 /** Used by RIL_REQUEST_DIAL */
416 typedef struct {
417     char * address;
418     int clir;
419             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
420              * clir == 0 on "use subscription default value"
421              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
422              * clir == 2 on "CLIR suppression" (allow CLI presentation)
423              */
424     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
425 } RIL_Dial;
426
427 typedef struct {
428     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
429     int fileid;     /* EF id */
430     char *path;     /* "pathid" from TS 27.007 +CRSM command.
431                        Path is in hex asciii format eg "7f205f70"
432                        Path must always be provided.
433                      */
434     int p1;
435     int p2;
436     int p3;
437     char *data;     /* May be NULL*/
438     char *pin2;     /* May be NULL*/
439 } RIL_SIM_IO_v5;
440
441 typedef struct {
442     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
443     int fileid;     /* EF id */
444     char *path;     /* "pathid" from TS 27.007 +CRSM command.
445                        Path is in hex asciii format eg "7f205f70"
446                        Path must always be provided.
447                      */
448     int p1;
449     int p2;
450     int p3;
451     char *data;     /* May be NULL*/
452     char *pin2;     /* May be NULL*/
453     char *aidPtr;   /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
454 } RIL_SIM_IO_v6;
455
456 /* Used by RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL and
457  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC. */
458 typedef struct {
459     int sessionid;  /* "sessionid" from TS 27.007 +CGLA command. Should be
460                        ignored for +CSIM command. */
461
462     /* Following fields are used to derive the APDU ("command" and "length"
463        values in TS 27.007 +CSIM and +CGLA commands). */
464     int cla;
465     int instruction;
466     int p1;
467     int p2;
468     int p3;         /* A negative P3 implies a 4 byte APDU. */
469     char *data;     /* May be NULL. In hex string format. */
470 } RIL_SIM_APDU;
471
472 typedef struct {
473     int sw1;
474     int sw2;
475     char *simResponse;  /* In hex string format ([a-fA-F0-9]*), except for SIM_AUTHENTICATION
476                            response for which it is in Base64 format, see 3GPP TS 31.102 7.1.2 */
477 } RIL_SIM_IO_Response;
478
479 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
480
481 typedef struct {
482     int             status;     /*
483                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
484                                  * status 1 = active, 0 = not active
485                                  *
486                                  * For RIL_REQUEST_SET_CALL_FORWARD:
487                                  * status is:
488                                  * 0 = disable
489                                  * 1 = enable
490                                  * 2 = interrogate
491                                  * 3 = registeration
492                                  * 4 = erasure
493                                  */
494
495     int             reason;      /* from TS 27.007 7.11 "reason" */
496     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
497                                     See table for Android mapping from
498                                     MMI service code
499                                     0 means user doesn't input class */
500     int             toa;         /* "type" from TS 27.007 7.11 */
501     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
502     int             timeSeconds; /* for CF no reply only */
503 }RIL_CallForwardInfo;
504
505 typedef struct {
506    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
507                         * Upper 16 bits is LAC and lower 16 bits
508                         * is CID (as described in TS 27.005)
509                         * Primary Scrambling Code (as described in TS 25.331)
510                         *         in 9 bits in UMTS
511                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
512                         */
513    int    rssi;        /* Received RSSI in GSM,
514                         * Level index of CPICH Received Signal Code Power in UMTS
515                         */
516 } RIL_NeighboringCell;
517
518 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
519 typedef enum {
520     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
521     CALL_FAIL_NORMAL = 16,
522     CALL_FAIL_BUSY = 17,
523     CALL_FAIL_CONGESTION = 34,
524     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
525     CALL_FAIL_CALL_BARRED = 240,
526     CALL_FAIL_FDN_BLOCKED = 241,
527     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
528     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
529     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
530     CALL_FAIL_CDMA_DROP = 1001,
531     CALL_FAIL_CDMA_INTERCEPT = 1002,
532     CALL_FAIL_CDMA_REORDER = 1003,
533     CALL_FAIL_CDMA_SO_REJECT = 1004,
534     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
535     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
536     CALL_FAIL_CDMA_PREEMPTED = 1007,
537     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
538                                             during emergency callback mode */
539     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
540     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
541 } RIL_LastCallFailCause;
542
543 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
544 typedef enum {
545     PDP_FAIL_NONE = 0, /* No error, connection ok */
546
547     /* an integer cause code defined in TS 24.008
548        section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
549        If the implementation does not have access to the exact cause codes,
550        then it should return one of the following values,
551        as the UI layer needs to distinguish these
552        cases for error notification and potential retries. */
553     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
554     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
555     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
556     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
557     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
558     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
559     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
560     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
561     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
562     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
563     PDP_FAIL_NSAPI_IN_USE = 0x23,                  /* no retry */
564     PDP_FAIL_REGULAR_DEACTIVATION = 0x24,          /* possibly restart radio,
565                                                       based on framework config */
566     PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,             /* no retry */
567     PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,             /* no retry */
568     PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
569     PDP_FAIL_PROTOCOL_ERRORS   = 0x6F,             /* no retry */
570
571     /* Not mentioned in the specification */
572     PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
573     PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
574
575    /* reasons for data call drop - network/modem disconnect */
576     PDP_FAIL_SIGNAL_LOST = -3,
577     PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
578                                              with parameters appropriate for new technology */
579     PDP_FAIL_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
580                                              powered off - no retry */
581     PDP_FAIL_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
582                                              mode was up on same APN/data profile - no retry until
583                                              tethered call is off */
584
585     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* retry silently */
586 } RIL_DataCallFailCause;
587
588 /* See RIL_REQUEST_SETUP_DATA_CALL */
589 typedef enum {
590     RIL_DATA_PROFILE_DEFAULT    = 0,
591     RIL_DATA_PROFILE_TETHERED   = 1,
592     RIL_DATA_PROFILE_IMS        = 2,
593     RIL_DATA_PROFILE_FOTA       = 3,
594     RIL_DATA_PROFILE_CBS        = 4,
595     RIL_DATA_PROFILE_OEM_BASE   = 1000,    /* Start of OEM-specific profiles */
596     RIL_DATA_PROFILE_INVALID    = 0xFFFFFFFF
597 } RIL_DataProfile;
598
599 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
600 typedef struct {
601     int     notificationType;   /*
602                                  * 0 = MO intermediate result code
603                                  * 1 = MT unsolicited result code
604                                  */
605     int     code;               /* See 27.007 7.17
606                                    "code1" for MO
607                                    "code2" for MT. */
608     int     index;              /* CUG index. See 27.007 7.17. */
609     int     type;               /* "type" from 27.007 7.17 (MT only). */
610     char *  number;             /* "number" from 27.007 7.17
611                                    (MT only, may be NULL). */
612 } RIL_SuppSvcNotification;
613
614 #define RIL_CARD_MAX_APPS     8
615
616 typedef enum {
617     RIL_CARDSTATE_ABSENT   = 0,
618     RIL_CARDSTATE_PRESENT  = 1,
619     RIL_CARDSTATE_ERROR    = 2
620 } RIL_CardState;
621
622 typedef enum {
623     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
624     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
625     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
626                                                         since each app can only have 1 active perso
627                                                         involved */
628     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
629     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
630     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
631     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
632     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
633     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
634     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
635     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
636     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
637     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
638     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
639     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
640     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
641     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
642     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
643     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
644     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
645     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
646     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
647     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
648     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
649     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
650 } RIL_PersoSubstate;
651
652 typedef enum {
653     RIL_APPSTATE_UNKNOWN               = 0,
654     RIL_APPSTATE_DETECTED              = 1,
655     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
656     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
657     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
658                                                when app_state is assigned to this value */
659     RIL_APPSTATE_READY                 = 5
660 } RIL_AppState;
661
662 typedef enum {
663     RIL_PINSTATE_UNKNOWN              = 0,
664     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
665     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
666     RIL_PINSTATE_DISABLED             = 3,
667     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
668     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
669 } RIL_PinState;
670
671 typedef enum {
672   RIL_APPTYPE_UNKNOWN = 0,
673   RIL_APPTYPE_SIM     = 1,
674   RIL_APPTYPE_USIM    = 2,
675   RIL_APPTYPE_RUIM    = 3,
676   RIL_APPTYPE_CSIM    = 4,
677   RIL_APPTYPE_ISIM    = 5
678 } RIL_AppType;
679
680 typedef struct
681 {
682   RIL_AppType      app_type;
683   RIL_AppState     app_state;
684   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
685                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
686   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
687                                        0x30, 0x30, 0x30 */
688   char             *app_label_ptr;  /* null terminated string */
689   int              pin1_replaced;   /* applicable to USIM, CSIM & ISIM */
690   RIL_PinState     pin1;
691   RIL_PinState     pin2;
692 } RIL_AppStatus;
693
694 /* Deprecated, use RIL_CardStatus_v6 */
695 typedef struct
696 {
697   RIL_CardState card_state;
698   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
699   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
700   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
701   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
702   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
703 } RIL_CardStatus_v5;
704
705 typedef struct
706 {
707   RIL_CardState card_state;
708   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
709   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
710   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
711   int           ims_subscription_app_index;      /* value < RIL_CARD_MAX_APPS, -1 if none */
712   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
713   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
714 } RIL_CardStatus_v6;
715
716 /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
717  *      or as part of RIL_SimRefreshResponse_v7
718  */
719 typedef enum {
720     /* A file on SIM has been updated.  data[1] contains the EFID. */
721     SIM_FILE_UPDATE = 0,
722     /* SIM initialized.  All files should be re-read. */
723     SIM_INIT = 1,
724     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
725     SIM_RESET = 2
726 } RIL_SimRefreshResult;
727
728 typedef struct {
729     RIL_SimRefreshResult result;
730     int                  ef_id; /* is the EFID of the updated file if the result is */
731                                 /* SIM_FILE_UPDATE or 0 for any other result. */
732     char *               aid;   /* is AID(application ID) of the card application */
733                                 /* See ETSI 102.221 8.1 and 101.220 4 */
734                                 /*     For SIM_FILE_UPDATE result it can be set to AID of */
735                                 /*         application in which updated EF resides or it can be */
736                                 /*         NULL if EF is outside of an application. */
737                                 /*     For SIM_INIT result this field is set to AID of */
738                                 /*         application that caused REFRESH */
739                                 /*     For SIM_RESET result it is NULL. */
740 } RIL_SimRefreshResponse_v7;
741
742 /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
743 typedef struct {
744     char *          number;             /* Remote party number */
745     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
746     char *          name;               /* Remote party name */
747     RIL_CDMA_SignalInfoRecord signalInfoRecord;
748 } RIL_CDMA_CallWaiting_v5;
749
750 typedef struct {
751     char *          number;             /* Remote party number */
752     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
753     char *          name;               /* Remote party name */
754     RIL_CDMA_SignalInfoRecord signalInfoRecord;
755     /* Number type/Number plan required to support International Call Waiting */
756     int             number_type;        /* 0=Unknown, 1=International, 2=National,
757                                            3=Network specific, 4=subscriber */
758     int             number_plan;        /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
759 } RIL_CDMA_CallWaiting_v6;
760
761 /**
762  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
763  *
764  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
765  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
766  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
767  * CBM message ID.
768  *
769  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
770  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
771  * and 9.4.4.2.3 for UMTS.
772  * All other values can be treated as empty CBM data coding scheme.
773  *
774  * selected 0 means message types specified in <fromServiceId, toServiceId>
775  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
776  *
777  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
778  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
779  */
780 typedef struct {
781     int fromServiceId;
782     int toServiceId;
783     int fromCodeScheme;
784     int toCodeScheme;
785     unsigned char selected;
786 } RIL_GSM_BroadcastSmsConfigInfo;
787
788 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
789 #define RIL_RESTRICTED_STATE_NONE           0x00
790 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
791 #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
792 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
793 #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
794 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
795 #define RIL_RESTRICTED_STATE_CS_ALL         0x04
796 /* Block packet data access due to restriction. */
797 #define RIL_RESTRICTED_STATE_PS_ALL         0x10
798
799 /* The status for an OTASP/OTAPA session */
800 typedef enum {
801     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
802     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
803     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
804     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
805     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
806     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
807     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
808     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
809     CDMA_OTA_PROVISION_STATUS_COMMITTED,
810     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
811     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
812     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
813 } RIL_CDMA_OTA_ProvisionStatus;
814
815 typedef struct {
816     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
817     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
818 } RIL_GW_SignalStrength;
819
820 typedef struct {
821     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
822     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
823 } RIL_SignalStrengthWcdma;
824
825 typedef struct {
826     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
827                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
828                * value will be 75.
829                */
830     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
831                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
832                * will be 125.
833                */
834 } RIL_CDMA_SignalStrength;
835
836
837 typedef struct {
838     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
839                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
840                * value will be 75.
841                */
842     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
843                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
844                * will be 125.
845                */
846     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
847 } RIL_EVDO_SignalStrength;
848
849 typedef struct {
850     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
851     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
852                           * Range: 44 to 140 dBm
853                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
854                           * Reference: 3GPP TS 36.133 9.1.4 */
855     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
856                           * Range: 20 to 3 dB.
857                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
858                           * Reference: 3GPP TS 36.133 9.1.7 */
859     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
860                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
861                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
862                           * Reference: 3GPP TS 36.101 8.1.1 */
863     int cqi;             /* The current Channel Quality Indicator.
864                           * Range: 0 to 15.
865                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
866                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
867 } RIL_LTE_SignalStrength;
868
869 typedef struct {
870     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
871     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
872                           * Range: 44 to 140 dBm
873                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
874                           * Reference: 3GPP TS 36.133 9.1.4 */
875     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
876                           * Range: 20 to 3 dB.
877                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
878                           * Reference: 3GPP TS 36.133 9.1.7 */
879     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
880                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
881                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
882                           * Reference: 3GPP TS 36.101 8.1.1 */
883     int cqi;             /* The current Channel Quality Indicator.
884                           * Range: 0 to 15.
885                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
886                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
887     int timingAdvance;   /* timing advance in micro seconds for a one way trip from cell to device.
888                           * Approximate distance can be calculated using 300m/us * timingAdvance.
889                           * Range: 0 to 0x7FFFFFFE
890                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
891                           * Reference: 3GPP 36.321 section 6.1.3.5
892                           * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */
893 } RIL_LTE_SignalStrength_v8;
894
895 typedef struct {
896     int rscp;    /* The Received Signal Code Power in dBm multipled by -1.
897                   * Range : 25 to 120
898                   * INT_MAX: 0x7FFFFFFF denotes invalid value.
899                   * Reference: 3GPP TS 25.123, section 9.1.1.1 */
900 } RIL_TD_SCDMA_SignalStrength;
901
902 /* Deprecated, use RIL_SignalStrength_v6 */
903 typedef struct {
904     RIL_GW_SignalStrength   GW_SignalStrength;
905     RIL_CDMA_SignalStrength CDMA_SignalStrength;
906     RIL_EVDO_SignalStrength EVDO_SignalStrength;
907 } RIL_SignalStrength_v5;
908
909 typedef struct {
910     RIL_GW_SignalStrength   GW_SignalStrength;
911     RIL_CDMA_SignalStrength CDMA_SignalStrength;
912     RIL_EVDO_SignalStrength EVDO_SignalStrength;
913     RIL_LTE_SignalStrength  LTE_SignalStrength;
914 } RIL_SignalStrength_v6;
915
916 typedef struct {
917     RIL_GW_SignalStrength       GW_SignalStrength;
918     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
919     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
920     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
921 } RIL_SignalStrength_v8;
922
923 typedef struct {
924     RIL_GW_SignalStrength       GW_SignalStrength;
925     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
926     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
927     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
928     RIL_TD_SCDMA_SignalStrength TD_SCDMA_SignalStrength;
929 } RIL_SignalStrength_v10;
930
931 /** RIL_CellIdentityGsm */
932 typedef struct {
933     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
934     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
935     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
936     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
937 } RIL_CellIdentityGsm;
938
939 /** RIL_CellIdentityWcdma */
940 typedef struct {
941     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
942     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
943     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
944     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
945     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
946 } RIL_CellIdentityWcdma;
947
948 /** RIL_CellIdentityCdma */
949 typedef struct {
950     int networkId;      /* Network Id 0..65535, INT_MAX if unknown */
951     int systemId;       /* CDMA System Id 0..32767, INT_MAX if unknown  */
952     int basestationId;  /* Base Station Id 0..65535, INT_MAX if unknown  */
953     int longitude;      /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
954                          * It is represented in units of 0.25 seconds and ranges from -2592000
955                          * to 2592000, both values inclusive (corresponding to a range of -180
956                          * to +180 degrees). INT_MAX if unknown */
957
958     int latitude;       /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
959                          * It is represented in units of 0.25 seconds and ranges from -1296000
960                          * to 1296000, both values inclusive (corresponding to a range of -90
961                          * to +90 degrees). INT_MAX if unknown */
962 } RIL_CellIdentityCdma;
963
964 /** RIL_CellIdentityLte */
965 typedef struct {
966     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
967     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
968     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
969     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
970     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
971 } RIL_CellIdentityLte;
972
973 /** RIL_CellIdentityTdscdma */
974 typedef struct {
975     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
976     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
977     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
978     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
979     int cpid;    /* 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown */
980 } RIL_CellIdentityTdscdma;
981
982 /** RIL_CellInfoGsm */
983 typedef struct {
984   RIL_CellIdentityGsm   cellIdentityGsm;
985   RIL_GW_SignalStrength signalStrengthGsm;
986 } RIL_CellInfoGsm;
987
988 /** RIL_CellInfoWcdma */
989 typedef struct {
990   RIL_CellIdentityWcdma cellIdentityWcdma;
991   RIL_SignalStrengthWcdma signalStrengthWcdma;
992 } RIL_CellInfoWcdma;
993
994 /** RIL_CellInfoCdma */
995 typedef struct {
996   RIL_CellIdentityCdma      cellIdentityCdma;
997   RIL_CDMA_SignalStrength   signalStrengthCdma;
998   RIL_EVDO_SignalStrength   signalStrengthEvdo;
999 } RIL_CellInfoCdma;
1000
1001 /** RIL_CellInfoLte */
1002 typedef struct {
1003   RIL_CellIdentityLte        cellIdentityLte;
1004   RIL_LTE_SignalStrength_v8  signalStrengthLte;
1005 } RIL_CellInfoLte;
1006
1007 /** RIL_CellInfoTdscdma */
1008 typedef struct {
1009   RIL_CellIdentityTdscdma cellIdentityTdscdma;
1010   RIL_TD_SCDMA_SignalStrength signalStrengthTdscdma;
1011 } RIL_CellInfoTdscdma;
1012
1013 // Must be the same as CellInfo.TYPE_XXX
1014 typedef enum {
1015   RIL_CELL_INFO_TYPE_GSM    = 1,
1016   RIL_CELL_INFO_TYPE_CDMA   = 2,
1017   RIL_CELL_INFO_TYPE_LTE    = 3,
1018   RIL_CELL_INFO_TYPE_WCDMA  = 4,
1019   RIL_CELL_INFO_TYPE_TD_SCDMA  = 5
1020 } RIL_CellInfoType;
1021
1022 // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX
1023 typedef enum {
1024     RIL_TIMESTAMP_TYPE_UNKNOWN = 0,
1025     RIL_TIMESTAMP_TYPE_ANTENNA = 1,
1026     RIL_TIMESTAMP_TYPE_MODEM = 2,
1027     RIL_TIMESTAMP_TYPE_OEM_RIL = 3,
1028     RIL_TIMESTAMP_TYPE_JAVA_RIL = 4,
1029 } RIL_TimeStampType;
1030
1031 typedef struct {
1032   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
1033   int               registered;     /* !0 if this cell is registered 0 if not registered */
1034   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
1035   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
1036   union {
1037     RIL_CellInfoGsm     gsm;
1038     RIL_CellInfoCdma    cdma;
1039     RIL_CellInfoLte     lte;
1040     RIL_CellInfoWcdma   wcdma;
1041     RIL_CellInfoTdscdma tdscdma;
1042   } CellInfo;
1043 } RIL_CellInfo;
1044
1045 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
1046 typedef enum {
1047   RIL_CDMA_DISPLAY_INFO_REC,
1048   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
1049   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
1050   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
1051   RIL_CDMA_SIGNAL_INFO_REC,
1052   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
1053   RIL_CDMA_LINE_CONTROL_INFO_REC,
1054   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
1055   RIL_CDMA_T53_CLIR_INFO_REC,
1056   RIL_CDMA_T53_RELEASE_INFO_REC,
1057   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
1058 } RIL_CDMA_InfoRecName;
1059
1060 /* Display Info Rec as defined in C.S0005 section 3.7.5.1
1061    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
1062    Note: the Extended Display info rec contains multiple records of the
1063    form: display_tag, display_len, and display_len occurrences of the
1064    chari field if the display_tag is not 10000000 or 10000001.
1065    To save space, the records are stored consecutively in a byte buffer.
1066    The display_tag, display_len and chari fields are all 1 byte.
1067 */
1068
1069 typedef struct {
1070   char alpha_len;
1071   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
1072 } RIL_CDMA_DisplayInfoRecord;
1073
1074 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
1075    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
1076    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
1077 */
1078
1079 typedef struct {
1080   char len;
1081   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
1082   char number_type;
1083   char number_plan;
1084   char pi;
1085   char si;
1086 } RIL_CDMA_NumberInfoRecord;
1087
1088 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
1089 typedef enum {
1090   RIL_REDIRECTING_REASON_UNKNOWN = 0,
1091   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
1092   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
1093   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
1094   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
1095   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
1096   RIL_REDIRECTING_REASON_RESERVED
1097 } RIL_CDMA_RedirectingReason;
1098
1099 typedef struct {
1100   RIL_CDMA_NumberInfoRecord redirectingNumber;
1101   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
1102   RIL_CDMA_RedirectingReason redirectingReason;
1103 } RIL_CDMA_RedirectingNumberInfoRecord;
1104
1105 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
1106 typedef struct {
1107   char lineCtrlPolarityIncluded;
1108   char lineCtrlToggle;
1109   char lineCtrlReverse;
1110   char lineCtrlPowerDenial;
1111 } RIL_CDMA_LineControlInfoRecord;
1112
1113 /* T53 CLIR Information Record */
1114 typedef struct {
1115   char cause;
1116 } RIL_CDMA_T53_CLIRInfoRecord;
1117
1118 /* T53 Audio Control Information Record */
1119 typedef struct {
1120   char upLink;
1121   char downLink;
1122 } RIL_CDMA_T53_AudioControlInfoRecord;
1123
1124 typedef struct {
1125
1126   RIL_CDMA_InfoRecName name;
1127
1128   union {
1129     /* Display and Extended Display Info Rec */
1130     RIL_CDMA_DisplayInfoRecord           display;
1131
1132     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
1133     RIL_CDMA_NumberInfoRecord            number;
1134
1135     /* Signal Info Rec */
1136     RIL_CDMA_SignalInfoRecord            signal;
1137
1138     /* Redirecting Number Info Rec */
1139     RIL_CDMA_RedirectingNumberInfoRecord redir;
1140
1141     /* Line Control Info Rec */
1142     RIL_CDMA_LineControlInfoRecord       lineCtrl;
1143
1144     /* T53 CLIR Info Rec */
1145     RIL_CDMA_T53_CLIRInfoRecord          clir;
1146
1147     /* T53 Audio Control Info Rec */
1148     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
1149   } rec;
1150 } RIL_CDMA_InformationRecord;
1151
1152 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
1153
1154 typedef struct {
1155   char numberOfInfoRecs;
1156   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
1157 } RIL_CDMA_InformationRecords;
1158
1159 /* See RIL_REQUEST_NV_READ_ITEM */
1160 typedef struct {
1161   RIL_NV_Item itemID;
1162 } RIL_NV_ReadItem;
1163
1164 /* See RIL_REQUEST_NV_WRITE_ITEM */
1165 typedef struct {
1166   RIL_NV_Item   itemID;
1167   char *        value;
1168 } RIL_NV_WriteItem;
1169
1170 typedef enum {
1171     HANDOVER_STARTED = 0,
1172     HANDOVER_COMPLETED = 1,
1173     HANDOVER_FAILED = 2,
1174     HANDOVER_CANCELED = 3
1175 } RIL_SrvccState;
1176
1177 /* hardware configuration reported to RILJ. */
1178 typedef enum {
1179    RIL_HARDWARE_CONFIG_MODEM = 0,
1180    RIL_HARDWARE_CONFIG_SIM = 1,
1181 } RIL_HardwareConfig_Type;
1182
1183 typedef enum {
1184    RIL_HARDWARE_CONFIG_STATE_ENABLED = 0,
1185    RIL_HARDWARE_CONFIG_STATE_STANDBY = 1,
1186    RIL_HARDWARE_CONFIG_STATE_DISABLED = 2,
1187 } RIL_HardwareConfig_State;
1188
1189 typedef struct {
1190    int rilModel;
1191    uint32_t rat; /* bitset - ref. RIL_RadioTechnology. */
1192    int maxVoice;
1193    int maxData;
1194    int maxStandby;
1195 } RIL_HardwareConfig_Modem;
1196
1197 typedef struct {
1198    char modemUuid[MAX_UUID_LENGTH];
1199 } RIL_HardwareConfig_Sim;
1200
1201 typedef struct {
1202   RIL_HardwareConfig_Type type;
1203   char uuid[MAX_UUID_LENGTH];
1204   RIL_HardwareConfig_State state;
1205   union {
1206      RIL_HardwareConfig_Modem modem;
1207      RIL_HardwareConfig_Sim sim;
1208   } cfg;
1209 } RIL_HardwareConfig;
1210
1211 /**
1212  * Data connection power state
1213  */
1214 typedef enum {
1215     RIL_DC_POWER_STATE_LOW      = 1,        // Low power state
1216     RIL_DC_POWER_STATE_MEDIUM   = 2,        // Medium power state
1217     RIL_DC_POWER_STATE_HIGH     = 3,        // High power state
1218     RIL_DC_POWER_STATE_UNKNOWN  = INT32_MAX // Unknown state
1219 } RIL_DcPowerStates;
1220
1221 /**
1222  * Data connection real time info
1223  */
1224 typedef struct {
1225     uint64_t                    time;       // Time in nanos as returned by ril_nano_time
1226     RIL_DcPowerStates           powerState; // Current power state
1227 } RIL_DcRtInfo;
1228
1229 /**
1230  * Data profile to modem
1231  */
1232 typedef struct {
1233     /* id of the data profile */
1234     int profileId;
1235     /* the APN to connect to */
1236     char* apn;
1237     /** one of the PDP_type values in TS 27.007 section 10.1.1.
1238      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
1239      */
1240     char* protocol;
1241     /** authentication protocol used for this PDP context
1242      * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
1243      */
1244     int authType;
1245     /* the username for APN, or NULL */
1246     char* user;
1247     /* the password for APN, or NULL */
1248     char* password;
1249     /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */
1250     int type;
1251     /* the period in seconds to limit the maximum connections */
1252     int maxConnsTime;
1253     /* the maximum connections during maxConnsTime */
1254     int maxConns;
1255     /** the required wait time in seconds after a successful UE initiated
1256      * disconnect of a given PDN connection before the device can send
1257      * a new PDN connection request for that given PDN
1258      */
1259     int waitTime;
1260     /* true to enable the profile, 0 to disable, 1 to enable */
1261     int enabled;
1262 } RIL_DataProfileInfo;
1263
1264 /**
1265  * RIL_REQUEST_GET_SIM_STATUS
1266  *
1267  * Requests status of the SIM interface and the SIM card
1268  *
1269  * "data" is NULL
1270  *
1271  * "response" is const RIL_CardStatus_v6 *
1272  *
1273  * Valid errors:
1274  *  Must never fail
1275  */
1276 #define RIL_REQUEST_GET_SIM_STATUS 1
1277
1278 /**
1279  * RIL_REQUEST_ENTER_SIM_PIN
1280  *
1281  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
1282  *
1283  * "data" is const char **
1284  * ((const char **)data)[0] is PIN value
1285  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1286  *
1287  * "response" is int *
1288  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1289  *
1290  * Valid errors:
1291  *
1292  * SUCCESS
1293  * RADIO_NOT_AVAILABLE (radio resetting)
1294  * GENERIC_FAILURE
1295  * PASSWORD_INCORRECT
1296  */
1297
1298 #define RIL_REQUEST_ENTER_SIM_PIN 2
1299
1300
1301 /**
1302  * RIL_REQUEST_ENTER_SIM_PUK
1303  *
1304  * Supplies SIM PUK and new PIN.
1305  *
1306  * "data" is const char **
1307  * ((const char **)data)[0] is PUK value
1308  * ((const char **)data)[1] is new PIN value
1309  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1310  *
1311  * "response" is int *
1312  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1313  *
1314  * Valid errors:
1315  *
1316  *  SUCCESS
1317  *  RADIO_NOT_AVAILABLE (radio resetting)
1318  *  GENERIC_FAILURE
1319  *  PASSWORD_INCORRECT
1320  *     (PUK is invalid)
1321  */
1322
1323 #define RIL_REQUEST_ENTER_SIM_PUK 3
1324
1325 /**
1326  * RIL_REQUEST_ENTER_SIM_PIN2
1327  *
1328  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
1329  * returned as a a failure from a previous operation.
1330  *
1331  * "data" is const char **
1332  * ((const char **)data)[0] is PIN2 value
1333  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1334  *
1335  * "response" is int *
1336  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1337  *
1338  * Valid errors:
1339  *
1340  *  SUCCESS
1341  *  RADIO_NOT_AVAILABLE (radio resetting)
1342  *  GENERIC_FAILURE
1343  *  PASSWORD_INCORRECT
1344  */
1345
1346 #define RIL_REQUEST_ENTER_SIM_PIN2 4
1347
1348 /**
1349  * RIL_REQUEST_ENTER_SIM_PUK2
1350  *
1351  * Supplies SIM PUK2 and new PIN2.
1352  *
1353  * "data" is const char **
1354  * ((const char **)data)[0] is PUK2 value
1355  * ((const char **)data)[1] is new PIN2 value
1356  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1357  *
1358  * "response" is int *
1359  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1360  *
1361  * Valid errors:
1362  *
1363  *  SUCCESS
1364  *  RADIO_NOT_AVAILABLE (radio resetting)
1365  *  GENERIC_FAILURE
1366  *  PASSWORD_INCORRECT
1367  *     (PUK2 is invalid)
1368  */
1369
1370 #define RIL_REQUEST_ENTER_SIM_PUK2 5
1371
1372 /**
1373  * RIL_REQUEST_CHANGE_SIM_PIN
1374  *
1375  * Supplies old SIM PIN and new PIN.
1376  *
1377  * "data" is const char **
1378  * ((const char **)data)[0] is old PIN value
1379  * ((const char **)data)[1] is new PIN value
1380  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1381  *
1382  * "response" is int *
1383  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1384  *
1385  * Valid errors:
1386  *
1387  *  SUCCESS
1388  *  RADIO_NOT_AVAILABLE (radio resetting)
1389  *  GENERIC_FAILURE
1390  *  PASSWORD_INCORRECT
1391  *     (old PIN is invalid)
1392  *
1393  */
1394
1395 #define RIL_REQUEST_CHANGE_SIM_PIN 6
1396
1397
1398 /**
1399  * RIL_REQUEST_CHANGE_SIM_PIN2
1400  *
1401  * Supplies old SIM PIN2 and new PIN2.
1402  *
1403  * "data" is const char **
1404  * ((const char **)data)[0] is old PIN2 value
1405  * ((const char **)data)[1] is new PIN2 value
1406  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1407  *
1408  * "response" is int *
1409  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1410  *
1411  * Valid errors:
1412  *
1413  *  SUCCESS
1414  *  RADIO_NOT_AVAILABLE (radio resetting)
1415  *  GENERIC_FAILURE
1416  *  PASSWORD_INCORRECT
1417  *     (old PIN2 is invalid)
1418  *
1419  */
1420
1421 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
1422
1423 /**
1424  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
1425  *
1426  * Requests that network personlization be deactivated
1427  *
1428  * "data" is const char **
1429  * ((const char **)(data))[0]] is network depersonlization code
1430  *
1431  * "response" is int *
1432  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1433  *
1434  * Valid errors:
1435  *
1436  *  SUCCESS
1437  *  RADIO_NOT_AVAILABLE (radio resetting)
1438  *  GENERIC_FAILURE
1439  *  PASSWORD_INCORRECT
1440  *     (code is invalid)
1441  */
1442
1443 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
1444
1445 /**
1446  * RIL_REQUEST_GET_CURRENT_CALLS
1447  *
1448  * Requests current call list
1449  *
1450  * "data" is NULL
1451  *
1452  * "response" must be a "const RIL_Call **"
1453  *
1454  * Valid errors:
1455  *
1456  *  SUCCESS
1457  *  RADIO_NOT_AVAILABLE (radio resetting)
1458  *  GENERIC_FAILURE
1459  *      (request will be made again in a few hundred msec)
1460  */
1461
1462 #define RIL_REQUEST_GET_CURRENT_CALLS 9
1463
1464
1465 /**
1466  * RIL_REQUEST_DIAL
1467  *
1468  * Initiate voice call
1469  *
1470  * "data" is const RIL_Dial *
1471  * "response" is NULL
1472  *
1473  * This method is never used for supplementary service codes
1474  *
1475  * Valid errors:
1476  *  SUCCESS
1477  *  RADIO_NOT_AVAILABLE (radio resetting)
1478  *  GENERIC_FAILURE
1479  */
1480 #define RIL_REQUEST_DIAL 10
1481
1482 /**
1483  * RIL_REQUEST_GET_IMSI
1484  *
1485  * Get the SIM IMSI
1486  *
1487  * Only valid when radio state is "RADIO_STATE_ON"
1488  *
1489  * "data" is const char **
1490  * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1491  * "response" is a const char * containing the IMSI
1492  *
1493  * Valid errors:
1494  *  SUCCESS
1495  *  RADIO_NOT_AVAILABLE (radio resetting)
1496  *  GENERIC_FAILURE
1497  */
1498
1499 #define RIL_REQUEST_GET_IMSI 11
1500
1501 /**
1502  * RIL_REQUEST_HANGUP
1503  *
1504  * Hang up a specific line (like AT+CHLD=1x)
1505  *
1506  * After this HANGUP request returns, RIL should show the connection is NOT
1507  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1508  *
1509  * "data" is an int *
1510  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
1511  *
1512  * "response" is NULL
1513  *
1514  * Valid errors:
1515  *  SUCCESS
1516  *  RADIO_NOT_AVAILABLE (radio resetting)
1517  *  GENERIC_FAILURE
1518  */
1519
1520 #define RIL_REQUEST_HANGUP 12
1521
1522 /**
1523  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
1524  *
1525  * Hang up waiting or held (like AT+CHLD=0)
1526  *
1527  * After this HANGUP request returns, RIL should show the connection is NOT
1528  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1529  *
1530  * "data" is NULL
1531  * "response" is NULL
1532  *
1533  * Valid errors:
1534  *  SUCCESS
1535  *  RADIO_NOT_AVAILABLE (radio resetting)
1536  *  GENERIC_FAILURE
1537  */
1538
1539 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
1540
1541 /**
1542  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
1543  *
1544  * Hang up waiting or held (like AT+CHLD=1)
1545  *
1546  * After this HANGUP request returns, RIL should show the connection is NOT
1547  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1548  *
1549  * "data" is NULL
1550  * "response" is NULL
1551  *
1552  * Valid errors:
1553  *  SUCCESS
1554  *  RADIO_NOT_AVAILABLE (radio resetting)
1555  *  GENERIC_FAILURE
1556  */
1557
1558 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
1559
1560 /**
1561  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
1562  *
1563  * Switch waiting or holding call and active call (like AT+CHLD=2)
1564  *
1565  * State transitions should be is follows:
1566  *
1567  * If call 1 is waiting and call 2 is active, then if this re
1568  *
1569  *   BEFORE                               AFTER
1570  * Call 1   Call 2                 Call 1       Call 2
1571  * ACTIVE   HOLDING                HOLDING     ACTIVE
1572  * ACTIVE   WAITING                HOLDING     ACTIVE
1573  * HOLDING  WAITING                HOLDING     ACTIVE
1574  * ACTIVE   IDLE                   HOLDING     IDLE
1575  * IDLE     IDLE                   IDLE        IDLE
1576  *
1577  * "data" is NULL
1578  * "response" is NULL
1579  *
1580  * Valid errors:
1581  *  SUCCESS
1582  *  RADIO_NOT_AVAILABLE (radio resetting)
1583  *  GENERIC_FAILURE
1584  */
1585
1586 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
1587 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
1588
1589 /**
1590  * RIL_REQUEST_CONFERENCE
1591  *
1592  * Conference holding and active (like AT+CHLD=3)
1593
1594  * "data" is NULL
1595  * "response" is NULL
1596  *
1597  * Valid errors:
1598  *  SUCCESS
1599  *  RADIO_NOT_AVAILABLE (radio resetting)
1600  *  GENERIC_FAILURE
1601  */
1602 #define RIL_REQUEST_CONFERENCE 16
1603
1604 /**
1605  * RIL_REQUEST_UDUB
1606  *
1607  * Send UDUB (user determined used busy) to ringing or
1608  * waiting call answer)(RIL_BasicRequest r);
1609  *
1610  * "data" is NULL
1611  * "response" is NULL
1612  *
1613  * Valid errors:
1614  *  SUCCESS
1615  *  RADIO_NOT_AVAILABLE (radio resetting)
1616  *  GENERIC_FAILURE
1617  */
1618 #define RIL_REQUEST_UDUB 17
1619
1620 /**
1621  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
1622  *
1623  * Requests the failure cause code for the most recently terminated call
1624  *
1625  * "data" is NULL
1626  * "response" is a "int *"
1627  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
1628  * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
1629  * failure reasons are derived from the possible call failure scenarios
1630  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
1631  *
1632  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
1633  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
1634  *
1635  * If the implementation does not have access to the exact cause codes,
1636  * then it should return one of the values listed in RIL_LastCallFailCause,
1637  * as the UI layer needs to distinguish these cases for tone generation or
1638  * error notification.
1639  *
1640  * Valid errors:
1641  *  SUCCESS
1642  *  RADIO_NOT_AVAILABLE
1643  *  GENERIC_FAILURE
1644  *
1645  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
1646  */
1647 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
1648
1649 /**
1650  * RIL_REQUEST_SIGNAL_STRENGTH
1651  *
1652  * Requests current signal strength and associated information
1653  *
1654  * Must succeed if radio is on.
1655  *
1656  * "data" is NULL
1657  *
1658  * "response" is a const RIL_SignalStrength *
1659  *
1660  * Valid errors:
1661  *  SUCCESS
1662  *  RADIO_NOT_AVAILABLE
1663  */
1664 #define RIL_REQUEST_SIGNAL_STRENGTH 19
1665
1666 /**
1667  * RIL_REQUEST_VOICE_REGISTRATION_STATE
1668  *
1669  * Request current registration state
1670  *
1671  * "data" is NULL
1672  * "response" is a "char **"
1673  * ((const char **)response)[0] is registration state 0-6,
1674  *              0 - Not registered, MT is not currently searching
1675  *                  a new operator to register
1676  *              1 - Registered, home network
1677  *              2 - Not registered, but MT is currently searching
1678  *                  a new operator to register
1679  *              3 - Registration denied
1680  *              4 - Unknown
1681  *              5 - Registered, roaming
1682  *             10 - Same as 0, but indicates that emergency calls
1683  *                  are enabled.
1684  *             12 - Same as 2, but indicates that emergency calls
1685  *                  are enabled.
1686  *             13 - Same as 3, but indicates that emergency calls
1687  *                  are enabled.
1688  *             14 - Same as 4, but indicates that emergency calls
1689  *                  are enabled.
1690  *
1691  * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
1692  *                              NULL if not.Valid LAC are 0x0000 - 0xffff
1693  * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
1694  *                              NULL if not.
1695  *                                 Valid CID are 0x00000000 - 0xffffffff
1696  *                                    In GSM, CID is Cell ID (see TS 27.007)
1697  *                                            in 16 bits
1698  *                                    In UMTS, CID is UMTS Cell Identity
1699  *                                             (see TS 25.331) in 28 bits
1700  * ((const char **)response)[3] indicates the available voice radio technology,
1701  *                              valid values as defined by RIL_RadioTechnology.
1702  * ((const char **)response)[4] is Base Station ID if registered on a CDMA
1703  *                              system or NULL if not.  Base Station ID in
1704  *                              decimal format
1705  * ((const char **)response)[5] is Base Station latitude if registered on a
1706  *                              CDMA system or NULL if not. Base Station
1707  *                              latitude is a decimal number as specified in
1708  *                              3GPP2 C.S0005-A v6.0. It is represented in
1709  *                              units of 0.25 seconds and ranges from -1296000
1710  *                              to 1296000, both values inclusive (corresponding
1711  *                              to a range of -90 to +90 degrees).
1712  * ((const char **)response)[6] is Base Station longitude if registered on a
1713  *                              CDMA system or NULL if not. Base Station
1714  *                              longitude is a decimal number as specified in
1715  *                              3GPP2 C.S0005-A v6.0. It is represented in
1716  *                              units of 0.25 seconds and ranges from -2592000
1717  *                              to 2592000, both values inclusive (corresponding
1718  *                              to a range of -180 to +180 degrees).
1719  * ((const char **)response)[7] is concurrent services support indicator if
1720  *                              registered on a CDMA system 0-1.
1721  *                                   0 - Concurrent services not supported,
1722  *                                   1 - Concurrent services supported
1723  * ((const char **)response)[8] is System ID if registered on a CDMA system or
1724  *                              NULL if not. Valid System ID are 0 - 32767
1725  * ((const char **)response)[9] is Network ID if registered on a CDMA system or
1726  *                              NULL if not. Valid System ID are 0 - 65535
1727  * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
1728  *                               on a CDMA or EVDO system or NULL if not. Valid values
1729  *                               are 0-255.
1730  * ((const char **)response)[11] indicates whether the current system is in the
1731  *                               PRL if registered on a CDMA or EVDO system or NULL if
1732  *                               not. 0=not in the PRL, 1=in the PRL
1733  * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
1734  *                               if registered on a CDMA or EVDO system or NULL if not.
1735  *                               Valid values are 0-255.
1736  * ((const char **)response)[13] if registration state is 3 (Registration
1737  *                               denied) this is an enumerated reason why
1738  *                               registration was denied.  See 3GPP TS 24.008,
1739  *                               10.5.3.6 and Annex G.
1740  *                                 0 - General
1741  *                                 1 - Authentication Failure
1742  *                                 2 - IMSI unknown in HLR
1743  *                                 3 - Illegal MS
1744  *                                 4 - Illegal ME
1745  *                                 5 - PLMN not allowed
1746  *                                 6 - Location area not allowed
1747  *                                 7 - Roaming not allowed
1748  *                                 8 - No Suitable Cells in this Location Area
1749  *                                 9 - Network failure
1750  *                                10 - Persistent location update reject
1751  *                                11 - PLMN not allowed
1752  *                                12 - Location area not allowed
1753  *                                13 - Roaming not allowed in this Location Area
1754  *                                15 - No Suitable Cells in this Location Area
1755  *                                17 - Network Failure
1756  *                                20 - MAC Failure
1757  *                                21 - Sync Failure
1758  *                                22 - Congestion
1759  *                                23 - GSM Authentication unacceptable
1760  *                                25 - Not Authorized for this CSG
1761  *                                32 - Service option not supported
1762  *                                33 - Requested service option not subscribed
1763  *                                34 - Service option temporarily out of order
1764  *                                38 - Call cannot be identified
1765  *                                48-63 - Retry upon entry into a new cell
1766  *                                95 - Semantically incorrect message
1767  *                                96 - Invalid mandatory information
1768  *                                97 - Message type non-existent or not implemented
1769  *                                98 - Message not compatible with protocol state
1770  *                                99 - Information element non-existent or not implemented
1771  *                               100 - Conditional IE error
1772  *                               101 - Message not compatible with protocol state
1773  *                               111 - Protocol error, unspecified
1774  * ((const char **)response)[14] is the Primary Scrambling Code of the current
1775  *                               cell as described in TS 25.331, in hexadecimal
1776  *                               format, or NULL if unknown or not registered
1777  *                               to a UMTS network.
1778  *
1779  * Please note that registration state 4 ("unknown") is treated
1780  * as "out of service" in the Android telephony system
1781  *
1782  * Registration state 3 can be returned if Location Update Reject
1783  * (with cause 17 - Network Failure) is received repeatedly from the network,
1784  * to facilitate "managed roaming"
1785  *
1786  * Valid errors:
1787  *  SUCCESS
1788  *  RADIO_NOT_AVAILABLE
1789  *  GENERIC_FAILURE
1790  */
1791 #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
1792
1793 /**
1794  * RIL_REQUEST_DATA_REGISTRATION_STATE
1795  *
1796  * Request current DATA registration state
1797  *
1798  * "data" is NULL
1799  * "response" is a "char **"
1800  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
1801  * ((const char **)response)[1] is LAC if registered or NULL if not
1802  * ((const char **)response)[2] is CID if registered or NULL if not
1803  * ((const char **)response)[3] indicates the available data radio technology,
1804  *                              valid values as defined by RIL_RadioTechnology.
1805  * ((const char **)response)[4] if registration state is 3 (Registration
1806  *                               denied) this is an enumerated reason why
1807  *                               registration was denied.  See 3GPP TS 24.008,
1808  *                               Annex G.6 "Additonal cause codes for GMM".
1809  *      7 == GPRS services not allowed
1810  *      8 == GPRS services and non-GPRS services not allowed
1811  *      9 == MS identity cannot be derived by the network
1812  *      10 == Implicitly detached
1813  *      14 == GPRS services not allowed in this PLMN
1814  *      16 == MSC temporarily not reachable
1815  *      40 == No PDP context activated
1816  * ((const char **)response)[5] The maximum number of simultaneous Data Calls that can be
1817  *                              established using RIL_REQUEST_SETUP_DATA_CALL.
1818  *
1819  * The values at offsets 6..10 are optional LTE location information in decimal.
1820  * If a value is unknown that value may be NULL. If all values are NULL,
1821  * none need to be present.
1822  *  ((const char **)response)[6] is TAC, a 16-bit Tracking Area Code.
1823  *  ((const char **)response)[7] is CID, a 0-503 Physical Cell Identifier.
1824  *  ((const char **)response)[8] is ECI, a 28-bit E-UTRAN Cell Identifier.
1825  *  ((const char **)response)[9] is CSGID, a 27-bit Closed Subscriber Group Identity.
1826  *  ((const char **)response)[10] is TADV, a 6-bit timing advance value.
1827  *
1828  * LAC and CID are in hexadecimal format.
1829  * valid LAC are 0x0000 - 0xffff
1830  * valid CID are 0x00000000 - 0x0fffffff
1831  *
1832  * Please note that registration state 4 ("unknown") is treated
1833  * as "out of service" in the Android telephony system
1834  *
1835  * Valid errors:
1836  *  SUCCESS
1837  *  RADIO_NOT_AVAILABLE
1838  *  GENERIC_FAILURE
1839  */
1840 #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
1841
1842 /**
1843  * RIL_REQUEST_OPERATOR
1844  *
1845  * Request current operator ONS or EONS
1846  *
1847  * "data" is NULL
1848  * "response" is a "const char **"
1849  * ((const char **)response)[0] is long alpha ONS or EONS
1850  *                                  or NULL if unregistered
1851  *
1852  * ((const char **)response)[1] is short alpha ONS or EONS
1853  *                                  or NULL if unregistered
1854  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
1855  *                                  or NULL if unregistered
1856  *
1857  * Valid errors:
1858  *  SUCCESS
1859  *  RADIO_NOT_AVAILABLE
1860  *  GENERIC_FAILURE
1861  */
1862 #define RIL_REQUEST_OPERATOR 22
1863
1864 /**
1865  * RIL_REQUEST_RADIO_POWER
1866  *
1867  * Toggle radio on and off (for "airplane" mode)
1868  * If the radio is is turned off/on the radio modem subsystem
1869  * is expected return to an initialized state. For instance,
1870  * any voice and data calls will be terminated and all associated
1871  * lists emptied.
1872  *
1873  * "data" is int *
1874  * ((int *)data)[0] is > 0 for "Radio On"
1875  * ((int *)data)[0] is == 0 for "Radio Off"
1876  *
1877  * "response" is NULL
1878  *
1879  * Turn radio on if "on" > 0
1880  * Turn radio off if "on" == 0
1881  *
1882  * Valid errors:
1883  *  SUCCESS
1884  *  RADIO_NOT_AVAILABLE
1885  *  GENERIC_FAILURE
1886  */
1887 #define RIL_REQUEST_RADIO_POWER 23
1888
1889 /**
1890  * RIL_REQUEST_DTMF
1891  *
1892  * Send a DTMF tone
1893  *
1894  * If the implementation is currently playing a tone requested via
1895  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
1896  * should be played instead
1897  *
1898  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
1899  * "response" is NULL
1900  *
1901  * FIXME should this block/mute microphone?
1902  * How does this interact with local DTMF feedback?
1903  *
1904  * Valid errors:
1905  *  SUCCESS
1906  *  RADIO_NOT_AVAILABLE
1907  *  GENERIC_FAILURE
1908  *
1909  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
1910  *
1911  */
1912 #define RIL_REQUEST_DTMF 24
1913
1914 /**
1915  * RIL_REQUEST_SEND_SMS
1916  *
1917  * Send an SMS message
1918  *
1919  * "data" is const char **
1920  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
1921  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1922  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
1923  *      less the SMSC address
1924  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
1925  *
1926  * "response" is a const RIL_SMS_Response *
1927  *
1928  * Based on the return error, caller decides to resend if sending sms
1929  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
1930  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
1931  *
1932  * Valid errors:
1933  *  SUCCESS
1934  *  RADIO_NOT_AVAILABLE
1935  *  SMS_SEND_FAIL_RETRY
1936  *  FDN_CHECK_FAILURE
1937  *  GENERIC_FAILURE
1938  *
1939  * FIXME how do we specify TP-Message-Reference if we need to resend?
1940  */
1941 #define RIL_REQUEST_SEND_SMS 25
1942
1943
1944 /**
1945  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
1946  *
1947  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
1948  * except that more messages are expected to be sent soon. If possible,
1949  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
1950  *
1951  * "data" is const char **
1952  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
1953  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
1954  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
1955  *      less the SMSC address
1956  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
1957  *
1958  * "response" is a const RIL_SMS_Response *
1959  *
1960  * Based on the return error, caller decides to resend if sending sms
1961  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
1962  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
1963  *
1964  * Valid errors:
1965  *  SUCCESS
1966  *  RADIO_NOT_AVAILABLE
1967  *  SMS_SEND_FAIL_RETRY
1968  *  GENERIC_FAILURE
1969  *
1970  */
1971 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
1972
1973
1974 /**
1975  * RIL_REQUEST_SETUP_DATA_CALL
1976  *
1977  * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
1978  * return success it is added to the list of data calls and a
1979  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
1980  * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
1981  * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
1982  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
1983  *
1984  * The RIL is expected to:
1985  *  - Create one data call context.
1986  *  - Create and configure a dedicated interface for the context
1987  *  - The interface must be point to point.
1988  *  - The interface is configured with one or more addresses and
1989  *    is capable of sending and receiving packets. The prefix length
1990  *    of the addresses must be /32 for IPv4 and /128 for IPv6.
1991  *  - Must NOT change the linux routing table.
1992  *  - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
1993  *    number of simultaneous data call contexts.
1994  *
1995  * "data" is a const char **
1996  * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
1997  *                          for values above 2 this is RIL_RadioTechnology + 2.
1998  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
1999  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
2000  *                          override the one in the profile. NULL indicates no APN overrride.
2001  * ((const char **)data)[3] is the username for APN, or NULL
2002  * ((const char **)data)[4] is the password for APN, or NULL
2003  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
2004  *                          0 => PAP and CHAP is never performed.
2005  *                          1 => PAP may be performed; CHAP is never performed.
2006  *                          2 => CHAP may be performed; PAP is never performed.
2007  *                          3 => PAP / CHAP may be performed - baseband dependent.
2008  * ((const char **)data)[6] is the connection type to request must be one of the
2009  *                          PDP_type values in TS 27.007 section 10.1.1.
2010  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
2011  * ((const char **)data)[7] Optional connection property parameters, format to be defined.
2012  *
2013  * "response" is a RIL_Data_Call_Response_v6
2014  *
2015  * FIXME may need way to configure QoS settings
2016  *
2017  * Valid errors:
2018  *  SUCCESS should be returned on both success and failure of setup with
2019  *  the RIL_Data_Call_Response_v6.status containing the actual status.
2020  *  For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
2021  *
2022  *  Other errors could include:
2023  *    RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
2024  *    OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED.
2025  *
2026  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
2027  */
2028 #define RIL_REQUEST_SETUP_DATA_CALL 27
2029
2030
2031 /**
2032  * RIL_REQUEST_SIM_IO
2033  *
2034  * Request SIM I/O operation.
2035  * This is similar to the TS 27.007 "restricted SIM" operation
2036  * where it assumes all of the EF selection will be done by the
2037  * callee.
2038  *
2039  * "data" is a const RIL_SIM_IO_v6 *
2040  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
2041  * or may specify a PIN2 for operations that require a PIN2 (eg
2042  * updating FDN records)
2043  *
2044  * "response" is a const RIL_SIM_IO_Response *
2045  *
2046  * Arguments and responses that are unused for certain
2047  * values of "command" should be ignored or set to NULL
2048  *
2049  * Valid errors:
2050  *  SUCCESS
2051  *  RADIO_NOT_AVAILABLE
2052  *  GENERIC_FAILURE
2053  *  SIM_PIN2
2054  *  SIM_PUK2
2055  */
2056 #define RIL_REQUEST_SIM_IO 28
2057
2058 /**
2059  * RIL_REQUEST_SEND_USSD
2060  *
2061  * Send a USSD message
2062  *
2063  * If a USSD session already exists, the message should be sent in the
2064  * context of that session. Otherwise, a new session should be created.
2065  *
2066  * The network reply should be reported via RIL_UNSOL_ON_USSD
2067  *
2068  * Only one USSD session may exist at a time, and the session is assumed
2069  * to exist until:
2070  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
2071  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
2072  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
2073  *
2074  * "data" is a const char * containing the USSD request in UTF-8 format
2075  * "response" is NULL
2076  *
2077  * Valid errors:
2078  *  SUCCESS
2079  *  RADIO_NOT_AVAILABLE
2080  *  FDN_CHECK_FAILURE
2081  *  GENERIC_FAILURE
2082  *
2083  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
2084  */
2085
2086 #define RIL_REQUEST_SEND_USSD 29
2087
2088 /**
2089  * RIL_REQUEST_CANCEL_USSD
2090  *
2091  * Cancel the current USSD session if one exists
2092  *
2093  * "data" is null
2094  * "response" is NULL
2095  *
2096  * Valid errors:
2097  *  SUCCESS
2098  *  RADIO_NOT_AVAILABLE
2099  *  GENERIC_FAILURE
2100  */
2101
2102 #define RIL_REQUEST_CANCEL_USSD 30
2103
2104 /**
2105  * RIL_REQUEST_GET_CLIR
2106  *
2107  * Gets current CLIR status
2108  * "data" is NULL
2109  * "response" is int *
2110  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
2111  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
2112  *
2113  * Valid errors:
2114  *  SUCCESS
2115  *  RADIO_NOT_AVAILABLE
2116  *  GENERIC_FAILURE
2117  */
2118 #define RIL_REQUEST_GET_CLIR 31
2119
2120 /**
2121  * RIL_REQUEST_SET_CLIR
2122  *
2123  * "data" is int *
2124  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
2125  *
2126  * "response" is NULL
2127  *
2128  * Valid errors:
2129  *  SUCCESS
2130  *  RADIO_NOT_AVAILABLE
2131  *  GENERIC_FAILURE
2132  */
2133 #define RIL_REQUEST_SET_CLIR 32
2134
2135 /**
2136  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
2137  *
2138  * "data" is const RIL_CallForwardInfo *
2139  *
2140  * "response" is const RIL_CallForwardInfo **
2141  * "response" points to an array of RIL_CallForwardInfo *'s, one for
2142  * each distinct registered phone number.
2143  *
2144  * For example, if data is forwarded to +18005551212 and voice is forwarded
2145  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
2146  *
2147  * If, however, both data and voice are forwarded to +18005551212, then
2148  * a single RIL_CallForwardInfo can be returned with the service class
2149  * set to "data + voice = 3")
2150  *
2151  * Valid errors:
2152  *  SUCCESS
2153  *  RADIO_NOT_AVAILABLE
2154  *  GENERIC_FAILURE
2155  */
2156 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
2157
2158
2159 /**
2160  * RIL_REQUEST_SET_CALL_FORWARD
2161  *
2162  * Configure call forward rule
2163  *
2164  * "data" is const RIL_CallForwardInfo *
2165  * "response" is NULL
2166  *
2167  * Valid errors:
2168  *  SUCCESS
2169  *  RADIO_NOT_AVAILABLE
2170  *  GENERIC_FAILURE
2171  */
2172 #define RIL_REQUEST_SET_CALL_FORWARD 34
2173
2174
2175 /**
2176  * RIL_REQUEST_QUERY_CALL_WAITING
2177  *
2178  * Query current call waiting state
2179  *
2180  * "data" is const int *
2181  * ((const int *)data)[0] is the TS 27.007 service class to query.
2182  * "response" is a const int *
2183  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
2184  *
2185  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
2186  * must follow, with the TS 27.007 service class bit vector of services
2187  * for which call waiting is enabled.
2188  *
2189  * For example, if ((const int *)response)[0]  is 1 and
2190  * ((const int *)response)[1] is 3, then call waiting is enabled for data
2191  * and voice and disabled for everything else
2192  *
2193  * Valid errors:
2194  *  SUCCESS
2195  *  RADIO_NOT_AVAILABLE
2196  *  GENERIC_FAILURE
2197  */
2198 #define RIL_REQUEST_QUERY_CALL_WAITING 35
2199
2200
2201 /**
2202  * RIL_REQUEST_SET_CALL_WAITING
2203  *
2204  * Configure current call waiting state
2205  *
2206  * "data" is const int *
2207  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
2208  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
2209  *                           services to modify
2210  * "response" is NULL
2211  *
2212  * Valid errors:
2213  *  SUCCESS
2214  *  RADIO_NOT_AVAILABLE
2215  *  GENERIC_FAILURE
2216  */
2217 #define RIL_REQUEST_SET_CALL_WAITING 36
2218
2219 /**
2220  * RIL_REQUEST_SMS_ACKNOWLEDGE
2221  *
2222  * Acknowledge successful or failed receipt of SMS previously indicated
2223  * via RIL_UNSOL_RESPONSE_NEW_SMS
2224  *
2225  * "data" is int *
2226  * ((int *)data)[0] is 1 on successful receipt
2227  *                  (basically, AT+CNMA=1 from TS 27.005
2228  *                  is 0 on failed receipt
2229  *                  (basically, AT+CNMA=2 from TS 27.005)
2230  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
2231  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
2232  *                  capacity exceeded) and 0xFF (unspecified error) are
2233  *                  reported.
2234  *
2235  * "response" is NULL
2236  *
2237  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
2238  *
2239  * Valid errors:
2240  *  SUCCESS
2241  *  RADIO_NOT_AVAILABLE
2242  *  GENERIC_FAILURE
2243  */
2244 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
2245
2246 /**
2247  * RIL_REQUEST_GET_IMEI - DEPRECATED
2248  *
2249  * Get the device IMEI, including check digit
2250  *
2251  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
2252  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
2253  *
2254  * "data" is NULL
2255  * "response" is a const char * containing the IMEI
2256  *
2257  * Valid errors:
2258  *  SUCCESS
2259  *  RADIO_NOT_AVAILABLE (radio resetting)
2260  *  GENERIC_FAILURE
2261  */
2262
2263 #define RIL_REQUEST_GET_IMEI 38
2264
2265 /**
2266  * RIL_REQUEST_GET_IMEISV - DEPRECATED
2267  *
2268  * Get the device IMEISV, which should be two decimal digits
2269  *
2270  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
2271  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
2272  *
2273  * "data" is NULL
2274  * "response" is a const char * containing the IMEISV
2275  *
2276  * Valid errors:
2277  *  SUCCESS
2278  *  RADIO_NOT_AVAILABLE (radio resetting)
2279  *  GENERIC_FAILURE
2280  */
2281
2282 #define RIL_REQUEST_GET_IMEISV 39
2283
2284
2285 /**
2286  * RIL_REQUEST_ANSWER
2287  *
2288  * Answer incoming call
2289  *
2290  * Will not be called for WAITING calls.
2291  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
2292  * instead
2293  *
2294  * "data" is NULL
2295  * "response" is NULL
2296  *
2297  * Valid errors:
2298  *  SUCCESS
2299  *  RADIO_NOT_AVAILABLE (radio resetting)
2300  *  GENERIC_FAILURE
2301  */
2302
2303 #define RIL_REQUEST_ANSWER 40
2304
2305 /**
2306  * RIL_REQUEST_DEACTIVATE_DATA_CALL
2307  *
2308  * Deactivate packet data connection and remove from the
2309  * data call list if SUCCESS is returned. Any other return
2310  * values should also try to remove the call from the list,
2311  * but that may not be possible. In any event a
2312  * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
2313  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
2314  * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
2315  *
2316  * "data" is const char **
2317  * ((char**)data)[0] indicating CID
2318  * ((char**)data)[1] indicating Disconnect Reason
2319  *                   0 => No specific reason specified
2320  *                   1 => Radio shutdown requested
2321  *
2322  * "response" is NULL
2323  *
2324  * Valid errors:
2325  *  SUCCESS
2326  *  RADIO_NOT_AVAILABLE
2327  *  GENERIC_FAILURE
2328  *
2329  * See also: RIL_REQUEST_SETUP_DATA_CALL
2330  */
2331 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
2332
2333 /**
2334  * RIL_REQUEST_QUERY_FACILITY_LOCK
2335  *
2336  * Query the status of a facility lock state
2337  *
2338  * "data" is const char **
2339  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
2340  *                      (eg "AO" for BAOC, "SC" for SIM lock)
2341  * ((const char **)data)[1] is the password, or "" if not required
2342  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
2343  *                           services to query
2344  * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2345  *                            This is only applicable in the case of Fixed Dialing Numbers
2346  *                            (FDN) requests.
2347  *
2348  * "response" is an int *
2349  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
2350  *                           services for which the specified barring facility
2351  *                           is active. "0" means "disabled for all"
2352  *
2353  *
2354  * Valid errors:
2355  *  SUCCESS
2356  *  RADIO_NOT_AVAILABLE
2357  *  GENERIC_FAILURE
2358  *
2359  */
2360 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
2361
2362 /**
2363  * RIL_REQUEST_SET_FACILITY_LOCK
2364  *
2365  * Enable/disable one facility lock
2366  *
2367  * "data" is const char **
2368  *
2369  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
2370  * (eg "AO" for BAOC)
2371  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
2372  * ((const char **)data)[2] = password
2373  * ((const char **)data)[3] = string representation of decimal TS 27.007
2374  *                            service class bit vector. Eg, the string
2375  *                            "1" means "set this facility for voice services"
2376  * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2377  *                            This is only applicable in the case of Fixed Dialing Numbers
2378  *                            (FDN) requests.
2379  *
2380  * "response" is int *
2381  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2382  *
2383  * Valid errors:
2384  *  SUCCESS
2385  *  RADIO_NOT_AVAILABLE
2386  *  GENERIC_FAILURE
2387  *
2388  */
2389 #define RIL_REQUEST_SET_FACILITY_LOCK 43
2390
2391 /**
2392  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
2393  *
2394  * Change call barring facility password
2395  *
2396  * "data" is const char **
2397  *
2398  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
2399  * (eg "AO" for BAOC)
2400  * ((const char **)data)[1] = old password
2401  * ((const char **)data)[2] = new password
2402  *
2403  * "response" is NULL
2404  *
2405  * Valid errors:
2406  *  SUCCESS
2407  *  RADIO_NOT_AVAILABLE
2408  *  GENERIC_FAILURE
2409  *
2410  */
2411 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
2412
2413 /**
2414  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
2415  *
2416  * Query current network selectin mode
2417  *
2418  * "data" is NULL
2419  *
2420  * "response" is int *
2421  * ((const int *)response)[0] is
2422  *     0 for automatic selection
2423  *     1 for manual selection
2424  *
2425  * Valid errors:
2426  *  SUCCESS
2427  *  RADIO_NOT_AVAILABLE
2428  *  GENERIC_FAILURE
2429  *
2430  */
2431 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
2432
2433 /**
2434  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
2435  *
2436  * Specify that the network should be selected automatically
2437  *
2438  * "data" is NULL
2439  * "response" is NULL
2440  *
2441  * This request must not respond until the new operator is selected
2442  * and registered
2443  *
2444  * Valid errors:
2445  *  SUCCESS
2446  *  RADIO_NOT_AVAILABLE
2447  *  ILLEGAL_SIM_OR_ME
2448  *  GENERIC_FAILURE
2449  *
2450  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
2451  *       no retries needed, such as illegal SIM or ME.
2452  *       Returns GENERIC_FAILURE for all other causes that might be
2453  *       fixed by retries.
2454  *
2455  */
2456 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
2457
2458 /**
2459  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
2460  *
2461  * Manually select a specified network.
2462  *
2463  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
2464  * "response" is NULL
2465  *
2466  * This request must not respond until the new operator is selected
2467  * and registered
2468  *
2469  * Valid errors:
2470  *  SUCCESS
2471  *  RADIO_NOT_AVAILABLE
2472  *  ILLEGAL_SIM_OR_ME
2473  *  GENERIC_FAILURE
2474  *
2475  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
2476  *       no retries needed, such as illegal SIM or ME.
2477  *       Returns GENERIC_FAILURE for all other causes that might be
2478  *       fixed by retries.
2479  *
2480  */
2481 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
2482
2483 /**
2484  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
2485  *
2486  * Scans for available networks
2487  *
2488  * "data" is NULL
2489  * "response" is const char ** that should be an array of n*4 strings, where
2490  *    n is the number of available networks
2491  * For each available network:
2492  *
2493  * ((const char **)response)[n+0] is long alpha ONS or EONS
2494  * ((const char **)response)[n+1] is short alpha ONS or EONS
2495  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
2496  * ((const char **)response)[n+3] is a string value of the status:
2497  *           "unknown"
2498  *           "available"
2499  *           "current"
2500  *           "forbidden"
2501  *
2502  * This request must not respond until the new operator is selected
2503  * and registered
2504  *
2505  * Valid errors:
2506  *  SUCCESS
2507  *  RADIO_NOT_AVAILABLE
2508  *  GENERIC_FAILURE
2509  *
2510  */
2511 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
2512
2513 /**
2514  * RIL_REQUEST_DTMF_START
2515  *
2516  * Start playing a DTMF tone. Continue playing DTMF tone until
2517  * RIL_REQUEST_DTMF_STOP is received
2518  *
2519  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
2520  * it should cancel the previous tone and play the new one.
2521  *
2522  * "data" is a char *
2523  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
2524  * "response" is NULL
2525  *
2526  * Valid errors:
2527  *  SUCCESS
2528  *  RADIO_NOT_AVAILABLE
2529  *  GENERIC_FAILURE
2530  *
2531  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
2532  */
2533 #define RIL_REQUEST_DTMF_START 49
2534
2535 /**
2536  * RIL_REQUEST_DTMF_STOP
2537  *
2538  * Stop playing a currently playing DTMF tone.
2539  *
2540  * "data" is NULL
2541  * "response" is NULL
2542  *
2543  * Valid errors:
2544  *  SUCCESS
2545  *  RADIO_NOT_AVAILABLE
2546  *  GENERIC_FAILURE
2547  *
2548  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
2549  */
2550 #define RIL_REQUEST_DTMF_STOP 50
2551
2552 /**
2553  * RIL_REQUEST_BASEBAND_VERSION
2554  *
2555  * Return string value indicating baseband version, eg
2556  * response from AT+CGMR
2557  *
2558  * "data" is NULL
2559  * "response" is const char * containing version string for log reporting
2560  *
2561  * Valid errors:
2562  *  SUCCESS
2563  *  RADIO_NOT_AVAILABLE
2564  *  GENERIC_FAILURE
2565  *
2566  */
2567 #define RIL_REQUEST_BASEBAND_VERSION 51
2568
2569 /**
2570  * RIL_REQUEST_SEPARATE_CONNECTION
2571  *
2572  * Separate a party from a multiparty call placing the multiparty call
2573  * (less the specified party) on hold and leaving the specified party
2574  * as the only other member of the current (active) call
2575  *
2576  * Like AT+CHLD=2x
2577  *
2578  * See TS 22.084 1.3.8.2 (iii)
2579  * TS 22.030 6.5.5 "Entering "2X followed by send"
2580  * TS 27.007 "AT+CHLD=2x"
2581  *
2582  * "data" is an int *
2583  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
2584  *
2585  * "response" is NULL
2586  *
2587  * Valid errors:
2588  *  SUCCESS
2589  *  RADIO_NOT_AVAILABLE (radio resetting)
2590  *  GENERIC_FAILURE
2591  */
2592 #define RIL_REQUEST_SEPARATE_CONNECTION 52
2593
2594
2595 /**
2596  * RIL_REQUEST_SET_MUTE
2597  *
2598  * Turn on or off uplink (microphone) mute.
2599  *
2600  * Will only be sent while voice call is active.
2601  * Will always be reset to "disable mute" when a new voice call is initiated
2602  *
2603  * "data" is an int *
2604  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
2605  *
2606  * "response" is NULL
2607  *
2608  * Valid errors:
2609  *  SUCCESS
2610  *  RADIO_NOT_AVAILABLE (radio resetting)
2611  *  GENERIC_FAILURE
2612  */
2613
2614 #define RIL_REQUEST_SET_MUTE 53
2615
2616 /**
2617  * RIL_REQUEST_GET_MUTE
2618  *
2619  * Queries the current state of the uplink mute setting
2620  *
2621  * "data" is NULL
2622  * "response" is an int *
2623  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
2624  *
2625  * Valid errors:
2626  *  SUCCESS
2627  *  RADIO_NOT_AVAILABLE (radio resetting)
2628  *  GENERIC_FAILURE
2629  */
2630
2631 #define RIL_REQUEST_GET_MUTE 54
2632
2633 /**
2634  * RIL_REQUEST_QUERY_CLIP
2635  *
2636  * Queries the status of the CLIP supplementary service
2637  *
2638  * (for MMI code "*#30#")
2639  *
2640  * "data" is NULL
2641  * "response" is an int *
2642  * (int *)response)[0] is 1 for "CLIP provisioned"
2643  *                           and 0 for "CLIP not provisioned"
2644  *                           and 2 for "unknown, e.g. no network etc"
2645  *
2646  * Valid errors:
2647  *  SUCCESS
2648  *  RADIO_NOT_AVAILABLE (radio resetting)
2649  *  GENERIC_FAILURE
2650  */
2651
2652 #define RIL_REQUEST_QUERY_CLIP 55
2653
2654 /**
2655  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
2656  * field in RIL_Data_Call_Response_v6.
2657  *
2658  * Requests the failure cause code for the most recently failed PDP
2659  * context or CDMA data connection active
2660  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
2661  *
2662  * "data" is NULL
2663  *
2664  * "response" is a "int *"
2665  * ((int *)response)[0] is an integer cause code defined in TS 24.008
2666  *   section 6.1.3.1.3 or close approximation
2667  *
2668  * If the implementation does not have access to the exact cause codes,
2669  * then it should return one of the values listed in
2670  * RIL_DataCallFailCause, as the UI layer needs to distinguish these
2671  * cases for error notification
2672  * and potential retries.
2673  *
2674  * Valid errors:
2675  *  SUCCESS
2676  *  RADIO_NOT_AVAILABLE
2677  *  GENERIC_FAILURE
2678  *
2679  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
2680  *
2681  * Deprecated use the status field in RIL_Data_Call_Response_v6.
2682  */
2683
2684 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
2685
2686 /**
2687  * RIL_REQUEST_DATA_CALL_LIST
2688  *
2689  * Returns the data call list. An entry is added when a
2690  * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
2691  * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
2692  * when RIL_REQUEST_RADIO_POWER off/on is issued.
2693  *
2694  * "data" is NULL
2695  * "response" is an array of RIL_Data_Call_Response_v6
2696  *
2697  * Valid errors:
2698  *  SUCCESS
2699  *  RADIO_NOT_AVAILABLE (radio resetting)
2700  *  GENERIC_FAILURE
2701  *
2702  * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
2703  */
2704
2705 #define RIL_REQUEST_DATA_CALL_LIST 57
2706
2707 /**
2708  * RIL_REQUEST_RESET_RADIO - DEPRECATED
2709  *
2710  * Request a radio reset. The RIL implementation may postpone
2711  * the reset until after this request is responded to if the baseband
2712  * is presently busy.
2713  *
2714  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
2715  *
2716  * "data" is NULL
2717  * "response" is NULL
2718  *
2719  * Valid errors:
2720  *  SUCCESS
2721  *  RADIO_NOT_AVAILABLE (radio resetting)
2722  *  GENERIC_FAILURE
2723  *  REQUEST_NOT_SUPPORTED
2724  */
2725
2726 #define RIL_REQUEST_RESET_RADIO 58
2727
2728 /**
2729  * RIL_REQUEST_OEM_HOOK_RAW
2730  *
2731  * This request reserved for OEM-specific uses. It passes raw byte arrays
2732  * back and forth.
2733  *
2734  * It can be invoked on the Java side from
2735  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
2736  *
2737  * "data" is a char * of bytes copied from the byte[] data argument in java
2738  * "response" is a char * of bytes that will returned via the
2739  * caller's "response" Message here:
2740  * (byte[])(((AsyncResult)response.obj).result)
2741  *
2742  * An error response here will result in
2743  * (((AsyncResult)response.obj).result) == null and
2744  * (((AsyncResult)response.obj).exception) being an instance of
2745  * com.android.internal.telephony.gsm.CommandException
2746  *
2747  * Valid errors:
2748  *  All
2749  */
2750
2751 #define RIL_REQUEST_OEM_HOOK_RAW 59
2752
2753 /**
2754  * RIL_REQUEST_OEM_HOOK_STRINGS
2755  *
2756  * This request reserved for OEM-specific uses. It passes strings
2757  * back and forth.
2758  *
2759  * It can be invoked on the Java side from
2760  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
2761  *
2762  * "data" is a const char **, representing an array of null-terminated UTF-8
2763  * strings copied from the "String[] strings" argument to
2764  * invokeOemRilRequestStrings()
2765  *
2766  * "response" is a const char **, representing an array of null-terminated UTF-8
2767  * stings that will be returned via the caller's response message here:
2768  *
2769  * (String[])(((AsyncResult)response.obj).result)
2770  *
2771  * An error response here will result in
2772  * (((AsyncResult)response.obj).result) == null and
2773  * (((AsyncResult)response.obj).exception) being an instance of
2774  * com.android.internal.telephony.gsm.CommandException
2775  *
2776  * Valid errors:
2777  *  All
2778  */
2779
2780 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
2781
2782 /**
2783  * RIL_REQUEST_SCREEN_STATE
2784  *
2785  * Indicates the current state of the screen.  When the screen is off, the
2786  * RIL should notify the baseband to suppress certain notifications (eg,
2787  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
2788  * in an effort to conserve power.  These notifications should resume when the
2789  * screen is on.
2790  *
2791  * "data" is int *
2792  * ((int *)data)[0] is == 1 for "Screen On"
2793  * ((int *)data)[0] is == 0 for "Screen Off"
2794  *
2795  * "response" is NULL
2796  *
2797  * Valid errors:
2798  *  SUCCESS
2799  *  GENERIC_FAILURE
2800  */
2801 #define RIL_REQUEST_SCREEN_STATE 61
2802
2803
2804 /**
2805  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
2806  *
2807  * Enables/disables supplementary service related notifications
2808  * from the network.
2809  *
2810  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
2811  *
2812  * "data" is int *
2813  * ((int *)data)[0] is == 1 for notifications enabled
2814  * ((int *)data)[0] is == 0 for notifications disabled
2815  *
2816  * "response" is NULL
2817  *
2818  * Valid errors:
2819  *  SUCCESS
2820  *  RADIO_NOT_AVAILABLE
2821  *  GENERIC_FAILURE
2822  *
2823  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
2824  */
2825 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
2826
2827 /**
2828  * RIL_REQUEST_WRITE_SMS_TO_SIM
2829  *
2830  * Stores a SMS message to SIM memory.
2831  *
2832  * "data" is RIL_SMS_WriteArgs *
2833  *
2834  * "response" is int *
2835  * ((const int *)response)[0] is the record index where the message is stored.
2836  *
2837  * Valid errors:
2838  *  SUCCESS
2839  *  GENERIC_FAILURE
2840  *
2841  */
2842 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
2843
2844 /**
2845  * RIL_REQUEST_DELETE_SMS_ON_SIM
2846  *
2847  * Deletes a SMS message from SIM memory.
2848  *
2849  * "data" is int  *
2850  * ((int *)data)[0] is the record index of the message to delete.
2851  *
2852  * "response" is NULL
2853  *
2854  * Valid errors:
2855  *  SUCCESS
2856  *  GENERIC_FAILURE
2857  *
2858  */
2859 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
2860
2861 /**
2862  * RIL_REQUEST_SET_BAND_MODE
2863  *
2864  * Assign a specified band for RF configuration.
2865  *
2866  * "data" is int *
2867  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
2868  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
2869  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
2870  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
2871  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
2872  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
2873  * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
2874  * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
2875  * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
2876  * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
2877  * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
2878  * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
2879  * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
2880  * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
2881  * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
2882  * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
2883  * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
2884  * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
2885  * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
2886  *
2887  * "response" is NULL
2888  *
2889  * Valid errors:
2890  *  SUCCESS
2891  *  RADIO_NOT_AVAILABLE
2892  *  GENERIC_FAILURE
2893  */
2894 #define RIL_REQUEST_SET_BAND_MODE 65
2895
2896 /**
2897  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
2898  *
2899  * Query the list of band mode supported by RF.
2900  *
2901  * "data" is NULL
2902  *
2903  * "response" is int *
2904  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
2905  * each available band mode.
2906  *
2907  *  0 for "unspecified" (selected by baseband automatically)
2908  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
2909  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
2910  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
2911  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
2912  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
2913  *  6 for "Cellular (800-MHz Band)"
2914  *  7 for "PCS (1900-MHz Band)"
2915  *  8 for "Band Class 3 (JTACS Band)"
2916  *  9 for "Band Class 4 (Korean PCS Band)"
2917  *  10 for "Band Class 5 (450-MHz Band)"
2918  *  11 for "Band Class 6 (2-GMHz IMT2000 Band)"
2919  *  12 for "Band Class 7 (Upper 700-MHz Band)"
2920  *  13 for "Band Class 8 (1800-MHz Band)"
2921  *  14 for "Band Class 9 (900-MHz Band)"
2922  *  15 for "Band Class 10 (Secondary 800-MHz Band)"
2923  *  16 for "Band Class 11 (400-MHz European PAMR Band)"
2924  *  17 for "Band Class 15 (AWS Band)"
2925  *  18 for "Band Class 16 (US 2.5-GHz Band)"
2926  *
2927  * Valid errors:
2928  *  SUCCESS
2929  *  RADIO_NOT_AVAILABLE
2930  *  GENERIC_FAILURE
2931  *
2932  * See also: RIL_REQUEST_SET_BAND_MODE
2933  */
2934 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
2935
2936 /**
2937  * RIL_REQUEST_STK_GET_PROFILE
2938  *
2939  * Requests the profile of SIM tool kit.
2940  * The profile indicates the SAT/USAT features supported by ME.
2941  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
2942  *
2943  * "data" is NULL
2944  *
2945  * "response" is a const char * containing SAT/USAT profile
2946  * in hexadecimal format string starting with first byte of terminal profile
2947  *
2948  * Valid errors:
2949  *  RIL_E_SUCCESS
2950  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2951  *  RIL_E_GENERIC_FAILURE
2952  */
2953 #define RIL_REQUEST_STK_GET_PROFILE 67
2954
2955 /**
2956  * RIL_REQUEST_STK_SET_PROFILE
2957  *
2958  * Download the STK terminal profile as part of SIM initialization
2959  * procedure
2960  *
2961  * "data" is a const char * containing SAT/USAT profile
2962  * in hexadecimal format string starting with first byte of terminal profile
2963  *
2964  * "response" is NULL
2965  *
2966  * Valid errors:
2967  *  RIL_E_SUCCESS
2968  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2969  *  RIL_E_GENERIC_FAILURE
2970  */
2971 #define RIL_REQUEST_STK_SET_PROFILE 68
2972
2973 /**
2974  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
2975  *
2976  * Requests to send a SAT/USAT envelope command to SIM.
2977  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
2978  *
2979  * "data" is a const char * containing SAT/USAT command
2980  * in hexadecimal format string starting with command tag
2981  *
2982  * "response" is a const char * containing SAT/USAT response
2983  * in hexadecimal format string starting with first byte of response
2984  * (May be NULL)
2985  *
2986  * Valid errors:
2987  *  RIL_E_SUCCESS
2988  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
2989  *  RIL_E_GENERIC_FAILURE
2990  */
2991 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
2992
2993 /**
2994  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
2995  *
2996  * Requests to send a terminal response to SIM for a received
2997  * proactive command
2998  *
2999  * "data" is a const char * containing SAT/USAT response
3000  * in hexadecimal format string starting with first byte of response data
3001  *
3002  * "response" is NULL
3003  *
3004  * Valid errors:
3005  *  RIL_E_SUCCESS
3006  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3007  *  RIL_E_GENERIC_FAILURE
3008  */
3009 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
3010
3011 /**
3012  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
3013  *
3014  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
3015  * been initialized by ME already. (We could see the call has been in the 'call
3016  * list') So, STK application needs to accept/reject the call according as user
3017  * operations.
3018  *
3019  * "data" is int *
3020  * ((int *)data)[0] is > 0 for "accept" the call setup
3021  * ((int *)data)[0] is == 0 for "reject" the call setup
3022  *
3023  * "response" is NULL
3024  *
3025  * Valid errors:
3026  *  RIL_E_SUCCESS
3027  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3028  *  RIL_E_GENERIC_FAILURE
3029  */
3030 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
3031
3032 /**
3033  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
3034  *
3035  * Connects the two calls and disconnects the subscriber from both calls.
3036  *
3037  * "data" is NULL
3038  * "response" is NULL
3039  *
3040  * Valid errors:
3041  *  SUCCESS
3042  *  RADIO_NOT_AVAILABLE (radio resetting)
3043  *  GENERIC_FAILURE
3044  */
3045 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
3046
3047 /**
3048  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
3049  *
3050  * Requests to set the preferred network type for searching and registering
3051  * (CS/PS domain, RAT, and operation mode)
3052  *
3053  * "data" is int * which is RIL_PreferredNetworkType
3054  *
3055  * "response" is NULL
3056  *
3057  * Valid errors:
3058  *  SUCCESS
3059  *  RADIO_NOT_AVAILABLE (radio resetting)
3060  *  GENERIC_FAILURE
3061  *  MODE_NOT_SUPPORTED
3062  */
3063 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
3064
3065 /**
3066  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
3067  *
3068  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
3069  * for searching and registering
3070  *
3071  * "data" is NULL
3072  *
3073  * "response" is int *
3074  * ((int *)reponse)[0] is == RIL_PreferredNetworkType
3075  *
3076  * Valid errors:
3077  *  SUCCESS
3078  *  RADIO_NOT_AVAILABLE
3079  *  GENERIC_FAILURE
3080  *
3081  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
3082  */
3083 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
3084
3085 /**
3086  * RIL_REQUEST_NEIGHBORING_CELL_IDS
3087  *
3088  * Request neighboring cell id in GSM network
3089  *
3090  * "data" is NULL
3091  * "response" must be a " const RIL_NeighboringCell** "
3092  *
3093  * Valid errors:
3094  *  SUCCESS
3095  *  RADIO_NOT_AVAILABLE
3096  *  GENERIC_FAILURE
3097  */
3098 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
3099
3100 /**
3101  * RIL_REQUEST_SET_LOCATION_UPDATES
3102  *
3103  * Enables/disables network state change notifications due to changes in
3104  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
3105  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
3106  *
3107  * Note:  The RIL implementation should default to "updates enabled"
3108  * when the screen is on and "updates disabled" when the screen is off.
3109  *
3110  * "data" is int *
3111  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
3112  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
3113  *
3114  * "response" is NULL
3115  *
3116  * Valid errors:
3117  *  SUCCESS
3118  *  RADIO_NOT_AVAILABLE
3119  *  GENERIC_FAILURE
3120  *
3121  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
3122  */
3123 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
3124
3125 /**
3126  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
3127  *
3128  * Request to set the location where the CDMA subscription shall
3129  * be retrieved
3130  *
3131  * "data" is int *
3132  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3133  *
3134  * "response" is NULL
3135  *
3136  * Valid errors:
3137  *  SUCCESS
3138  *  RADIO_NOT_AVAILABLE
3139  *  GENERIC_FAILURE
3140  *  SIM_ABSENT
3141  *  SUBSCRIPTION_NOT_AVAILABLE
3142  *
3143  * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
3144  */
3145 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
3146
3147 /**
3148  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
3149  *
3150  * Request to set the roaming preferences in CDMA
3151  *
3152  * "data" is int *
3153  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
3154  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
3155  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
3156  *
3157  * "response" is NULL
3158  *
3159  * Valid errors:
3160  *  SUCCESS
3161  *  RADIO_NOT_AVAILABLE
3162  *  GENERIC_FAILURE
3163  */
3164 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
3165
3166 /**
3167  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
3168  *
3169  * Request the actual setting of the roaming preferences in CDMA in the modem
3170  *
3171  * "data" is NULL
3172  *
3173  * "response" is int *
3174  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
3175  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
3176  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
3177  *
3178  * "response" is NULL
3179  *
3180  * Valid errors:
3181  *  SUCCESS
3182  *  RADIO_NOT_AVAILABLE
3183  *  GENERIC_FAILURE
3184  */
3185 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
3186
3187 /**
3188  * RIL_REQUEST_SET_TTY_MODE
3189  *
3190  * Request to set the TTY mode
3191  *
3192  * "data" is int *
3193  * ((int *)data)[0] is == 0 for TTY off
3194  * ((int *)data)[0] is == 1 for TTY Full
3195  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
3196  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
3197  *
3198  * "response" is NULL
3199  *
3200  * Valid errors:
3201  *  SUCCESS
3202  *  RADIO_NOT_AVAILABLE
3203  *  GENERIC_FAILURE
3204  */
3205 #define RIL_REQUEST_SET_TTY_MODE 80
3206
3207 /**
3208  * RIL_REQUEST_QUERY_TTY_MODE
3209  *
3210  * Request the setting of TTY mode
3211  *
3212  * "data" is NULL
3213  *
3214  * "response" is int *
3215  * ((int *)response)[0] is == 0 for TTY off
3216  * ((int *)response)[0] is == 1 for TTY Full
3217  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
3218  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
3219  *
3220  * "response" is NULL
3221  *
3222  * Valid errors:
3223  *  SUCCESS
3224  *  RADIO_NOT_AVAILABLE
3225  *  GENERIC_FAILURE
3226  */
3227 #define RIL_REQUEST_QUERY_TTY_MODE 81
3228
3229 /**
3230  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
3231  *
3232  * Request to set the preferred voice privacy mode used in voice
3233  * scrambling
3234  *
3235  * "data" is int *
3236  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
3237  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
3238  *
3239  * "response" is NULL
3240  *
3241  * Valid errors:
3242  *  SUCCESS
3243  *  RADIO_NOT_AVAILABLE
3244  *  GENERIC_FAILURE
3245  */
3246 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
3247
3248 /**
3249  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
3250  *
3251  * Request the setting of preferred voice privacy mode
3252  *
3253  * "data" is NULL
3254  *
3255  * "response" is int *
3256  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
3257  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
3258  *
3259  * "response" is NULL
3260  *
3261  * Valid errors:
3262  *  SUCCESS
3263  *  RADIO_NOT_AVAILABLE
3264  *  GENERIC_FAILURE
3265  */
3266 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
3267
3268 /**
3269  * RIL_REQUEST_CDMA_FLASH
3270  *
3271  * Send FLASH
3272  *
3273  * "data" is const char *
3274  * ((const char *)data)[0] is a FLASH string
3275  *
3276  * "response" is NULL
3277  *
3278  * Valid errors:
3279  *  SUCCESS
3280  *  RADIO_NOT_AVAILABLE
3281  *  GENERIC_FAILURE
3282  *
3283  */
3284 #define RIL_REQUEST_CDMA_FLASH 84
3285
3286 /**
3287  * RIL_REQUEST_CDMA_BURST_DTMF
3288  *
3289  * Send DTMF string
3290  *
3291  * "data" is const char **
3292  * ((const char **)data)[0] is a DTMF string
3293  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
3294  *                          default
3295  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
3296  *                          default
3297  *
3298  * "response" is NULL
3299  *
3300  * Valid errors:
3301  *  SUCCESS
3302  *  RADIO_NOT_AVAILABLE
3303  *  GENERIC_FAILURE
3304  *
3305  */
3306 #define RIL_REQUEST_CDMA_BURST_DTMF 85
3307
3308 /**
3309  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
3310  *
3311  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
3312  * If the checksum is valid the 20 digit AKEY is written to NV,
3313  * replacing the existing AKEY no matter what it was before.
3314  *
3315  * "data" is const char *
3316  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
3317  *                         where the last 6 digits are a checksum of the
3318  *                         first 20, as specified in TR45.AHAG
3319  *                         "Common Cryptographic Algorithms, Revision D.1
3320  *                         Section 2.2"
3321  *
3322  * "response" is NULL
3323  *
3324  * Valid errors:
3325  *  SUCCESS
3326  *  RADIO_NOT_AVAILABLE
3327  *  GENERIC_FAILURE
3328  *
3329  */
3330 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
3331
3332 /**
3333  * RIL_REQUEST_CDMA_SEND_SMS
3334  *
3335  * Send a CDMA SMS message
3336  *
3337  * "data" is const RIL_CDMA_SMS_Message *
3338  *
3339  * "response" is a const RIL_SMS_Response *
3340  *
3341  * Based on the return error, caller decides to resend if sending sms
3342  * fails. The CDMA error class is derived as follows,
3343  * SUCCESS is error class 0 (no error)
3344  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
3345  * and GENERIC_FAILURE is error class 3 (permanent and no retry)
3346  *
3347  * Valid errors:
3348  *  SUCCESS
3349  *  RADIO_NOT_AVAILABLE
3350  *  SMS_SEND_FAIL_RETRY
3351  *  GENERIC_FAILURE
3352  *
3353  */
3354 #define RIL_REQUEST_CDMA_SEND_SMS 87
3355
3356 /**
3357  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
3358  *
3359  * Acknowledge the success or failure in the receipt of SMS
3360  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
3361  *
3362  * "data" is const RIL_CDMA_SMS_Ack *
3363  *
3364  * "response" is NULL
3365  *
3366  * Valid errors:
3367  *  SUCCESS
3368  *  RADIO_NOT_AVAILABLE
3369  *  GENERIC_FAILURE
3370  *
3371  */
3372 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
3373
3374 /**
3375  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
3376  *
3377  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
3378  *
3379  * "data" is NULL
3380  *
3381  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
3382  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
3383  *
3384  * Valid errors:
3385  *  SUCCESS
3386  *  RADIO_NOT_AVAILABLE
3387  *  GENERIC_FAILURE
3388  *
3389  */
3390 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
3391
3392 /**
3393  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
3394  *
3395  * Set GSM/WCDMA Cell Broadcast SMS config
3396  *
3397  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
3398  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
3399  *
3400  * "response" is NULL
3401  *
3402  * Valid errors:
3403  *  SUCCESS
3404  *  RADIO_NOT_AVAILABLE
3405  *  GENERIC_FAILURE
3406  *
3407  */
3408 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
3409
3410 /**
3411  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
3412  *
3413 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
3414  *
3415  * "data" is const int *
3416  * (const int *)data[0] indicates to activate or turn off the
3417  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
3418  *                       0 - Activate, 1 - Turn off
3419  *
3420  * "response" is NULL
3421  *
3422  * Valid errors:
3423  *  SUCCESS
3424  *  RADIO_NOT_AVAILABLE
3425  *  GENERIC_FAILURE
3426  *
3427  */
3428 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
3429
3430 /**
3431  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
3432  *
3433  * Request the setting of CDMA Broadcast SMS config
3434  *
3435  * "data" is NULL
3436  *
3437  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
3438  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
3439  *
3440  * Valid errors:
3441  *  SUCCESS
3442  *  RADIO_NOT_AVAILABLE
3443  *  GENERIC_FAILURE
3444  *
3445  */
3446 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
3447
3448 /**
3449  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
3450  *
3451  * Set CDMA Broadcast SMS config
3452  *
3453  * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo **
3454  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
3455  *
3456  * "response" is NULL
3457  *
3458  * Valid errors:
3459  *  SUCCESS
3460  *  RADIO_NOT_AVAILABLE
3461  *  GENERIC_FAILURE
3462  *
3463  */
3464 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
3465
3466 /**
3467  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
3468  *
3469  * Enable or disable the reception of CDMA Broadcast SMS
3470  *
3471  * "data" is const int *
3472  * (const int *)data[0] indicates to activate or turn off the
3473  * reception of CDMA Broadcast SMS, 0-1,
3474  *                       0 - Activate, 1 - Turn off
3475  *
3476  * "response" is NULL
3477  *
3478  * Valid errors:
3479  *  SUCCESS
3480  *  RADIO_NOT_AVAILABLE
3481  *  GENERIC_FAILURE
3482  *
3483  */
3484 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
3485
3486 /**
3487  * RIL_REQUEST_CDMA_SUBSCRIPTION
3488  *
3489  * Request the device MDN / H_SID / H_NID.
3490  *
3491  * The request is only allowed when CDMA subscription is available.  When CDMA
3492  * subscription is changed, application layer should re-issue the request to
3493  * update the subscription information.
3494  *
3495  * If a NULL value is returned for any of the device id, it means that error
3496  * accessing the device.
3497  *
3498  * "response" is const char **
3499  * ((const char **)response)[0] is MDN if CDMA subscription is available
3500  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
3501  *                              CDMA subscription is available, in decimal format
3502  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
3503  *                              CDMA subscription is available, in decimal format
3504  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
3505  * ((const char **)response)[4] is PRL version if CDMA subscription is available
3506  *
3507  * Valid errors:
3508  *  SUCCESS
3509  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
3510  */
3511
3512 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
3513
3514 /**
3515  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
3516  *
3517  * Stores a CDMA SMS message to RUIM memory.
3518  *
3519  * "data" is RIL_CDMA_SMS_WriteArgs *
3520  *
3521  * "response" is int *
3522  * ((const int *)response)[0] is the record index where the message is stored.
3523  *
3524  * Valid errors:
3525  *  SUCCESS
3526  *  RADIO_NOT_AVAILABLE
3527  *  GENERIC_FAILURE
3528  *
3529  */
3530 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
3531
3532 /**
3533  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
3534  *
3535  * Deletes a CDMA SMS message from RUIM memory.
3536  *
3537  * "data" is int  *
3538  * ((int *)data)[0] is the record index of the message to delete.
3539  *
3540  * "response" is NULL
3541  *
3542  * Valid errors:
3543  *  SUCCESS
3544  *  RADIO_NOT_AVAILABLE
3545  *  GENERIC_FAILURE
3546  *
3547  */
3548 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
3549
3550 /**
3551  * RIL_REQUEST_DEVICE_IDENTITY
3552  *
3553  * Request the device ESN / MEID / IMEI / IMEISV.
3554  *
3555  * The request is always allowed and contains GSM and CDMA device identity;
3556  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
3557  * RIL_REQUEST_GET_IMEISV.
3558  *
3559  * If a NULL value is returned for any of the device id, it means that error
3560  * accessing the device.
3561  *
3562  * When CDMA subscription is changed the ESN/MEID may change.  The application
3563  * layer should re-issue the request to update the device identity in this case.
3564  *
3565  * "response" is const char **
3566  * ((const char **)response)[0] is IMEI if GSM subscription is available
3567  * ((const char **)response)[1] is IMEISV if GSM subscription is available
3568  * ((const char **)response)[2] is ESN if CDMA subscription is available
3569  * ((const char **)response)[3] is MEID if CDMA subscription is available
3570  *
3571  * Valid errors:
3572  *  SUCCESS
3573  *  RADIO_NOT_AVAILABLE
3574  *  GENERIC_FAILURE
3575  */
3576 #define RIL_REQUEST_DEVICE_IDENTITY 98
3577
3578 /**
3579  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
3580  *
3581  * Request the radio's system selection module to exit emergency
3582  * callback mode.  RIL will not respond with SUCCESS until the modem has
3583  * completely exited from Emergency Callback Mode.
3584  *
3585  * "data" is NULL
3586  *
3587  * "response" is NULL
3588  *
3589  * Valid errors:
3590  *  SUCCESS
3591  *  RADIO_NOT_AVAILABLE
3592  *  GENERIC_FAILURE
3593  *
3594  */
3595 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
3596
3597 /**
3598  * RIL_REQUEST_GET_SMSC_ADDRESS
3599  *
3600  * Queries the default Short Message Service Center address on the device.
3601  *
3602  * "data" is NULL
3603  *
3604  * "response" is const char * containing the SMSC address.
3605  *
3606  * Valid errors:
3607  *  SUCCESS
3608  *  RADIO_NOT_AVAILABLE
3609  *  GENERIC_FAILURE
3610  *
3611  */
3612 #define RIL_REQUEST_GET_SMSC_ADDRESS 100
3613
3614 /**
3615  * RIL_REQUEST_SET_SMSC_ADDRESS
3616  *
3617  * Sets the default Short Message Service Center address on the device.
3618  *
3619  * "data" is const char * containing the SMSC address.
3620  *
3621  * "response" is NULL
3622  *
3623  * Valid errors:
3624  *  SUCCESS
3625  *  RADIO_NOT_AVAILABLE
3626  *  GENERIC_FAILURE
3627  *
3628  */
3629 #define RIL_REQUEST_SET_SMSC_ADDRESS 101
3630
3631 /**
3632  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
3633  *
3634  * Indicates whether there is storage available for new SMS messages.
3635  *
3636  * "data" is int *
3637  * ((int *)data)[0] is 1 if memory is available for storing new messages
3638  *                  is 0 if memory capacity is exceeded
3639  *
3640  * "response" is NULL
3641  *
3642  * Valid errors:
3643  *  SUCCESS
3644  *  RADIO_NOT_AVAILABLE
3645  *  GENERIC_FAILURE
3646  *
3647  */
3648 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
3649
3650 /**
3651  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
3652  *
3653  * Indicates that the StkSerivce is running and is
3654  * ready to receive RIL_UNSOL_STK_XXXXX commands.
3655  *
3656  * "data" is NULL
3657  * "response" is NULL
3658  *
3659  * Valid errors:
3660  *  SUCCESS
3661  *  RADIO_NOT_AVAILABLE
3662  *  GENERIC_FAILURE
3663  *
3664  */
3665 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
3666
3667 /**
3668  * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
3669  *
3670  * Request to query the location where the CDMA subscription shall
3671  * be retrieved
3672  *
3673  * "data" is NULL
3674  *
3675  * "response" is int *
3676  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3677  *
3678  * Valid errors:
3679  *  SUCCESS
3680  *  RADIO_NOT_AVAILABLE
3681  *  GENERIC_FAILURE
3682  *  SUBSCRIPTION_NOT_AVAILABLE
3683  *
3684  * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
3685  */
3686 #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
3687
3688 /**
3689  * RIL_REQUEST_ISIM_AUTHENTICATION
3690  *
3691  * Request the ISIM application on the UICC to perform AKA
3692  * challenge/response algorithm for IMS authentication
3693  *
3694  * "data" is a const char * containing the challenge string in Base64 format
3695  * "response" is a const char * containing the response in Base64 format
3696  *
3697  * Valid errors:
3698  *  SUCCESS
3699  *  RADIO_NOT_AVAILABLE
3700  *  GENERIC_FAILURE
3701  */
3702 #define RIL_REQUEST_ISIM_AUTHENTICATION 105
3703
3704 /**
3705  * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
3706  *
3707  * Acknowledge successful or failed receipt of SMS previously indicated
3708  * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
3709  * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
3710  *
3711  * "data" is const char **
3712  * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
3713  *                          is "0" on failed receipt (send RP-ERROR)
3714  * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
3715  *
3716  * "response" is NULL
3717  *
3718  * Valid errors:
3719  *  SUCCESS
3720  *  RADIO_NOT_AVAILABLE
3721  *  GENERIC_FAILURE
3722  */
3723 #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
3724
3725 /**
3726  * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
3727  *
3728  * Requests to send a SAT/USAT envelope command to SIM.
3729  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
3730  *
3731  * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
3732  * the SW1 and SW2 status bytes from the UICC response are returned along with
3733  * the response data, using the same structure as RIL_REQUEST_SIM_IO.
3734  *
3735  * The RIL implementation shall perform the normal processing of a '91XX'
3736  * response in SW1/SW2 to retrieve the pending proactive command and send it
3737  * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
3738  *
3739  * "data" is a const char * containing the SAT/USAT command
3740  * in hexadecimal format starting with command tag
3741  *
3742  * "response" is a const RIL_SIM_IO_Response *
3743  *
3744  * Valid errors:
3745  *  RIL_E_SUCCESS
3746  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3747  *  RIL_E_GENERIC_FAILURE
3748  */
3749 #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
3750
3751 /**
3752  * RIL_REQUEST_VOICE_RADIO_TECH
3753  *
3754  * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
3755  * when radio state is RADIO_STATE_ON
3756  *
3757  * "data" is NULL
3758  * "response" is int *
3759  * ((int *) response)[0] is of type const RIL_RadioTechnology
3760  *
3761  * Valid errors:
3762  *  SUCCESS
3763  *  RADIO_NOT_AVAILABLE
3764  *  GENERIC_FAILURE
3765  */
3766 #define RIL_REQUEST_VOICE_RADIO_TECH 108
3767
3768 /**
3769  * RIL_REQUEST_GET_CELL_INFO_LIST
3770  *
3771  * Request all of the current cell information known to the radio. The radio
3772  * must a list of all current cells, including the neighboring cells. If for a particular
3773  * cell information isn't known then the appropriate unknown value will be returned.
3774  * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST.
3775  *
3776  * "data" is NULL
3777  *
3778  * "response" is an array of  RIL_CellInfo.
3779  */
3780 #define RIL_REQUEST_GET_CELL_INFO_LIST 109
3781
3782 /**
3783  * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
3784  *
3785  * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked.
3786  * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
3787  * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
3788  * a RIL_UNSOL_CELL_INFO_LIST.
3789  *
3790  * "data" is int *
3791  * ((int *)data)[0] is minimum time in milliseconds
3792  *
3793  * "response" is NULL
3794  *
3795  * Valid errors:
3796  *  SUCCESS
3797  *  RADIO_NOT_AVAILABLE
3798  *  GENERIC_FAILURE
3799  */
3800 #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110
3801
3802 /**
3803  * RIL_REQUEST_SET_INITIAL_ATTACH_APN
3804  *
3805  * Set an apn to initial attach network
3806  * "response" is NULL
3807  *
3808  * Valid errors:
3809  *  SUCCESS
3810  *  RADIO_NOT_AVAILABLE (radio resetting)
3811  *  GENERIC_FAILURE
3812  *  SUBSCRIPTION_NOT_AVAILABLE
3813  */
3814 #define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111
3815
3816 /**
3817  * RIL_REQUEST_IMS_REGISTRATION_STATE
3818  *
3819  * Request current IMS registration state
3820  *
3821  * "data" is NULL
3822  *
3823  * "response" is int *
3824  * ((int *)response)[0] is registration state:
3825  *              0 - Not registered
3826  *              1 - Registered
3827  *
3828  * If ((int*)response)[0] is = 1, then ((int *) response)[1]
3829  * must follow with IMS SMS format:
3830  *
3831  * ((int *) response)[1] is of type RIL_RadioTechnologyFamily
3832  *
3833  * Valid errors:
3834  *  SUCCESS
3835  *  RADIO_NOT_AVAILABLE
3836  *  GENERIC_FAILURE
3837  */
3838 #define RIL_REQUEST_IMS_REGISTRATION_STATE 112
3839
3840 /**
3841  * RIL_REQUEST_IMS_SEND_SMS
3842  *
3843  * Send a SMS message over IMS
3844  *
3845  * "data" is const RIL_IMS_SMS_Message *
3846  *
3847  * "response" is a const RIL_SMS_Response *
3848  *
3849  * Based on the return error, caller decides to resend if sending sms
3850  * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
3851  * In case of retry, data is encoded based on Voice Technology available.
3852  *
3853  * Valid errors:
3854  *  SUCCESS
3855  *  RADIO_NOT_AVAILABLE
3856  *  SMS_SEND_FAIL_RETRY
3857  *  FDN_CHECK_FAILURE
3858  *  GENERIC_FAILURE
3859  *
3860  */
3861 #define RIL_REQUEST_IMS_SEND_SMS 113
3862
3863 /**
3864  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC
3865  *
3866  * Request APDU exchange on the basic channel. This command reflects TS 27.007
3867  * "generic SIM access" operation (+CSIM). The modem must ensure proper function
3868  * of GSM/CDMA, and filter commands appropriately. It should filter
3869  * channel management and SELECT by DF name commands.
3870  *
3871  * "data" is a const RIL_SIM_APDU *
3872  * "sessionid" field should be ignored.
3873  *
3874  * "response" is a const RIL_SIM_IO_Response *
3875  *
3876  * Valid errors:
3877  *  SUCCESS
3878  *  RADIO_NOT_AVAILABLE
3879  *  GENERIC_FAILURE
3880  */
3881 #define RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC 114
3882
3883 /**
3884  * RIL_REQUEST_SIM_OPEN_CHANNEL
3885  *
3886  * Open a new logical channel and select the given application. This command
3887  * reflects TS 27.007 "open logical channel" operation (+CCHO).
3888  *
3889  * "data" is const char * and set to AID value, See ETSI 102.221 and 101.220.
3890  *
3891  * "response" is int *
3892  * ((int *)data)[0] contains the session id of the logical channel.
3893  * ((int *)data)[1] onwards may optionally contain the select response for the
3894  *     open channel command with one byte per integer.
3895  *
3896  * Valid errors:
3897  *  SUCCESS
3898  *  RADIO_NOT_AVAILABLE
3899  *  GENERIC_FAILURE
3900  *  MISSING_RESOURCE
3901  *  NO_SUCH_ELEMENT
3902  */
3903 #define RIL_REQUEST_SIM_OPEN_CHANNEL 115
3904
3905 /**
3906  * RIL_REQUEST_SIM_CLOSE_CHANNEL
3907  *
3908  * Close a previously opened logical channel. This command reflects TS 27.007
3909  * "close logical channel" operation (+CCHC).
3910  *
3911  * "data" is int *
3912  * ((int *)data)[0] is the session id of logical the channel to close.
3913  *
3914  * "response" is NULL
3915  *
3916  * Valid errors:
3917  *  SUCCESS
3918  *  RADIO_NOT_AVAILABLE
3919  *  GENERIC_FAILURE
3920  */
3921 #define RIL_REQUEST_SIM_CLOSE_CHANNEL 116
3922
3923 /**
3924  * RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL
3925  *
3926  * Exchange APDUs with a UICC over a previously opened logical channel. This
3927  * command reflects TS 27.007 "generic logical channel access" operation
3928  * (+CGLA). The modem should filter channel management and SELECT by DF name
3929  * commands.
3930  *
3931  * "data" is a const RIL_SIM_APDU*
3932  *
3933  * "response" is a const RIL_SIM_IO_Response *
3934  *
3935  * Valid errors:
3936  *  SUCCESS
3937  *  RADIO_NOT_AVAILABLE
3938  *  GENERIC_FAILURE
3939  */
3940 #define RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL 117
3941
3942 /**
3943  * RIL_REQUEST_NV_READ_ITEM
3944  *
3945  * Read one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
3946  * This is used for device configuration by some CDMA operators.
3947  *
3948  * "data" is a const RIL_NV_ReadItem *
3949  *
3950  * "response" is const char * containing the contents of the NV item
3951  *
3952  * Valid errors:
3953  *  SUCCESS
3954  *  RADIO_NOT_AVAILABLE
3955  *  GENERIC_FAILURE
3956  */
3957 #define RIL_REQUEST_NV_READ_ITEM 118
3958
3959 /**
3960  * RIL_REQUEST_NV_WRITE_ITEM
3961  *
3962  * Write one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
3963  * This is used for device configuration by some CDMA operators.
3964  *
3965  * "data" is a const RIL_NV_WriteItem *
3966  *
3967  * "response" is NULL
3968  *
3969  * Valid errors:
3970  *  SUCCESS
3971  *  RADIO_NOT_AVAILABLE
3972  *  GENERIC_FAILURE
3973  */
3974 #define RIL_REQUEST_NV_WRITE_ITEM 119
3975
3976 /**
3977  * RIL_REQUEST_NV_WRITE_CDMA_PRL
3978  *
3979  * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
3980  * This is used for device configuration by some CDMA operators.
3981  *
3982  * "data" is a const char * containing the PRL as a byte array
3983  *
3984  * "response" is NULL
3985  *
3986  * Valid errors:
3987  *  SUCCESS
3988  *  RADIO_NOT_AVAILABLE
3989  *  GENERIC_FAILURE
3990  */
3991 #define RIL_REQUEST_NV_WRITE_CDMA_PRL 120
3992
3993 /**
3994  * RIL_REQUEST_NV_RESET_CONFIG
3995  *
3996  * Reset the radio NV configuration to the factory state.
3997  * This is used for device configuration by some CDMA operators.
3998  *
3999  * "data" is int *
4000  * ((int *)data)[0] is 1 to reload all NV items
4001  * ((int *)data)[0] is 2 for erase NV reset (SCRTN)
4002  * ((int *)data)[0] is 3 for factory reset (RTN)
4003  *
4004  * "response" is NULL
4005  *
4006  * Valid errors:
4007  *  SUCCESS
4008  *  RADIO_NOT_AVAILABLE
4009  *  GENERIC_FAILURE
4010  */
4011 #define RIL_REQUEST_NV_RESET_CONFIG 121
4012
4013  /** RIL_REQUEST_SET_UICC_SUBSCRIPTION
4014  * FIXME This API needs to have more documentation.
4015  *
4016  * Selection/de-selection of a subscription from a SIM card
4017  * "data" is const  RIL_SelectUiccSub*
4018
4019  *
4020  * "response" is NULL
4021  *
4022  *  Valid errors:
4023  *  SUCCESS
4024  *  RADIO_NOT_AVAILABLE (radio resetting)
4025  *  GENERIC_FAILURE
4026  *  SUBSCRIPTION_NOT_SUPPORTED
4027  *
4028  */
4029 #define RIL_REQUEST_SET_UICC_SUBSCRIPTION  122
4030
4031 /**
4032  *  RIL_REQUEST_ALLOW_DATA
4033  *
4034  *  Tells the modem whether data calls are allowed or not
4035  *
4036  * "data" is int *
4037  * FIXME slotId and aid will be added.
4038  * ((int *)data)[0] is == 0 to allow data calls
4039  * ((int *)data)[0] is == 1 to disallow data calls
4040  *
4041  * "response" is NULL
4042  *
4043  *  Valid errors:
4044  *
4045  *  SUCCESS
4046  *  RADIO_NOT_AVAILABLE (radio resetting)
4047  *  GENERIC_FAILURE
4048  *
4049  */
4050 #define RIL_REQUEST_ALLOW_DATA  123
4051
4052 /**
4053  * RIL_REQUEST_GET_HARDWARE_CONFIG
4054  *
4055  * Request all of the current hardware (modem and sim) associated
4056  * with the RIL.
4057  *
4058  * "data" is NULL
4059  *
4060  * "response" is an array of  RIL_HardwareConfig.
4061  */
4062 #define RIL_REQUEST_GET_HARDWARE_CONFIG 124
4063
4064 /**
4065  * RIL_REQUEST_SIM_AUTHENTICATION
4066  *
4067  * Returns the response of SIM Authentication through RIL to a
4068  * challenge request.
4069  *
4070  * "data" Base64 encoded string containing challenge:
4071  *      int   authContext;          P2 value of authentication command, see P2 parameter in
4072  *                                  3GPP TS 31.102 7.1.2
4073  *      char *authData;             the challenge string in Base64 format, see 3GPP
4074  *                                  TS 31.102 7.1.2
4075  *      char *aid;                  AID value, See ETSI 102.221 8.1 and 101.220 4,
4076  *                                  NULL if no value
4077  *
4078  * "response" Base64 encoded strings containing response:
4079  *      int   sw1;                  Status bytes per 3GPP TS 31.102 section 7.3
4080  *      int   sw2;
4081  *      char *simResponse;          Response in Base64 format, see 3GPP TS 31.102 7.1.2
4082  */
4083 #define RIL_REQUEST_SIM_AUTHENTICATION 125
4084
4085 /**
4086  * RIL_REQUEST_GET_DC_RT_INFO
4087  *
4088  * Requests the Data Connection Real Time Info
4089  *
4090  * "data" is NULL
4091  *
4092  * "response" is the most recent RIL_DcRtInfo
4093  *
4094  * Valid errors:
4095  *  SUCCESS
4096  *  RADIO_NOT_AVAILABLE
4097  *  GENERIC_FAILURE
4098  *
4099  * See also: RIL_UNSOL_DC_RT_INFO_CHANGED
4100  */
4101 #define RIL_REQUEST_GET_DC_RT_INFO 126
4102
4103 /**
4104  * RIL_REQUEST_SET_DC_RT_INFO_RATE
4105  *
4106  * This is the minimum number of milliseconds between successive
4107  * RIL_UNSOL_DC_RT_INFO_CHANGED messages and defines the highest rate
4108  * at which RIL_UNSOL_DC_RT_INFO_CHANGED's will be sent. A value of
4109  * 0 means send as fast as possible.
4110  *
4111  * "data" The number of milliseconds as an int
4112  *
4113  * "response" is null
4114  *
4115  * Valid errors:
4116  *  SUCCESS must not fail
4117  */
4118 #define RIL_REQUEST_SET_DC_RT_INFO_RATE 127
4119
4120 /**
4121  * RIL_REQUEST_SET_DATA_PROFILE
4122  *
4123  * Set data profile in modem
4124  * Modem should erase existed profiles from framework, and apply new profiles
4125  * "data" is an const RIL_DataProfileInfo **
4126  * "datalen" is count * sizeof(const RIL_DataProfileInfo *)
4127  * "response" is NULL
4128  *
4129  * Valid errors:
4130  *  SUCCESS
4131  *  RADIO_NOT_AVAILABLE (radio resetting)
4132  *  GENERIC_FAILURE
4133  *  SUBSCRIPTION_NOT_AVAILABLE
4134  */
4135 #define RIL_REQUEST_SET_DATA_PROFILE 128
4136
4137 /**
4138  * RIL_REQUEST_SHUTDOWN
4139  *
4140  * Device is shutting down. All further commands are ignored
4141  * and RADIO_NOT_AVAILABLE must be returned.
4142  *
4143  * "data" is null
4144  * "response" is NULL
4145  *
4146  * Valid errors:
4147  *  SUCCESS
4148  *  RADIO_NOT_AVAILABLE
4149  *  GENERIC_FAILURE
4150  */
4151 #define RIL_REQUEST_SHUTDOWN 129
4152
4153 /**
4154  * RIL_REQUEST_GET_RADIO_CAPABILITY
4155  *
4156  * Used to get phone radio capablility.
4157  *
4158  * "data" is int *
4159  * ((int *)data)[0] is the phone radio access family defined in
4160  * RadioAccessFamily. It's a bit mask value to represent the support type.
4161  *
4162  * Valid errors:
4163  *  SUCCESS
4164  *  RADIO_NOT_AVAILABLE
4165  *  GENERIC_FAILURE
4166  */
4167 #define RIL_REQUEST_GET_RADIO_CAPABILITY 130
4168
4169 /**
4170  * RIL_REQUEST_SET_RADIO_CAPABILITY
4171  *
4172  * Used to set the phones radio capability. Be VERY careful
4173  * using this request as it may cause some vendor modems to reset. Because
4174  * of the possible modem reset any RIL commands after this one may not be
4175  * processed.
4176  *
4177  * "data" is the RIL_RadioCapability structure
4178  *
4179  * "response" is the RIL_RadioCapability structure, used to feedback return status
4180  *
4181  * Valid errors:
4182  *  SUCCESS means a RIL_UNSOL_RADIO_CAPABILITY will be sent within 30 seconds.
4183  *  RADIO_NOT_AVAILABLE
4184  *  GENERIC_FAILURE
4185  */
4186 #define RIL_REQUEST_SET_RADIO_CAPABILITY 131
4187
4188
4189 /***********************************************************************/
4190
4191
4192 #define RIL_UNSOL_RESPONSE_BASE 1000
4193
4194 /**
4195  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
4196  *
4197  * Indicate when value of RIL_RadioState has changed.
4198  *
4199  * Callee will invoke RIL_RadioStateRequest method on main thread
4200  *
4201  * "data" is NULL
4202  */
4203
4204 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
4205
4206
4207 /**
4208  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
4209  *
4210  * Indicate when call state has changed
4211  *
4212  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
4213  *
4214  * "data" is NULL
4215  *
4216  * Response should be invoked on, for example,
4217  * "RING", "BUSY", "NO CARRIER", and also call state
4218  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
4219  *
4220  * Redundent or extraneous invocations are tolerated
4221  */
4222 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
4223
4224
4225 /**
4226  * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
4227  *
4228  * Called when the voice network state changed
4229  *
4230  * Callee will invoke the following requests on main thread:
4231  *
4232  * RIL_REQUEST_VOICE_REGISTRATION_STATE
4233  * RIL_REQUEST_OPERATOR
4234  *
4235  * "data" is NULL
4236  *
4237  * FIXME should this happen when SIM records are loaded? (eg, for
4238  * EONS)
4239  */
4240 #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
4241
4242 /**
4243  * RIL_UNSOL_RESPONSE_NEW_SMS
4244  *
4245  * Called when new SMS is received.
4246  *
4247  * "data" is const char *
4248  * This is a pointer to a string containing the PDU of an SMS-DELIVER
4249  * as an ascii string of hex digits. The PDU starts with the SMSC address
4250  * per TS 27.005 (+CMT:)
4251  *
4252  * Callee will subsequently confirm the receipt of thei SMS with a
4253  * RIL_REQUEST_SMS_ACKNOWLEDGE
4254  *
4255  * No new RIL_UNSOL_RESPONSE_NEW_SMS
4256  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
4257  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
4258  */
4259
4260 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
4261
4262 /**
4263  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
4264  *
4265  * Called when new SMS Status Report is received.
4266  *
4267  * "data" is const char *
4268  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
4269  * as an ascii string of hex digits. The PDU starts with the SMSC address
4270  * per TS 27.005 (+CDS:).
4271  *
4272  * Callee will subsequently confirm the receipt of the SMS with a
4273  * RIL_REQUEST_SMS_ACKNOWLEDGE
4274  *
4275  * No new RIL_UNSOL_RESPONSE_NEW_SMS
4276  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
4277  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
4278  */
4279
4280 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
4281
4282 /**
4283  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
4284  *
4285  * Called when new SMS has been stored on SIM card
4286  *
4287  * "data" is const int *
4288  * ((const int *)data)[0] contains the slot index on the SIM that contains
4289  * the new message
4290  */
4291
4292 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
4293
4294 /**
4295  * RIL_UNSOL_ON_USSD
4296  *
4297  * Called when a new USSD message is received.
4298  *
4299  * "data" is const char **
4300  * ((const char **)data)[0] points to a type code, which is
4301  *  one of these string values:
4302  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
4303  *      "1"   USSD-Request -- text in ((const char **)data)[1]
4304  *      "2"   Session terminated by network
4305  *      "3"   other local client (eg, SIM Toolkit) has responded
4306  *      "4"   Operation not supported
4307  *      "5"   Network timeout
4308  *
4309  * The USSD session is assumed to persist if the type code is "1", otherwise
4310  * the current session (if any) is assumed to have terminated.
4311  *
4312  * ((const char **)data)[1] points to a message string if applicable, which
4313  * should always be in UTF-8.
4314  */
4315 #define RIL_UNSOL_ON_USSD 1006
4316 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
4317
4318 /**
4319  * RIL_UNSOL_ON_USSD_REQUEST
4320  *
4321  * Obsolete. Send via RIL_UNSOL_ON_USSD
4322  */
4323 #define RIL_UNSOL_ON_USSD_REQUEST 1007
4324
4325
4326 /**
4327  * RIL_UNSOL_NITZ_TIME_RECEIVED
4328  *
4329  * Called when radio has received a NITZ time message
4330  *
4331  * "data" is const char * pointing to NITZ time string
4332  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
4333  */
4334 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
4335
4336 /**
4337  * RIL_UNSOL_SIGNAL_STRENGTH
4338  *
4339  * Radio may report signal strength rather han have it polled.
4340  *
4341  * "data" is a const RIL_SignalStrength *
4342  */
4343 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
4344
4345
4346 /**
4347  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
4348  *
4349  * "data" is an array of RIL_Data_Call_Response_v6 identical to that
4350  * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
4351  * of current data contexts including new contexts that have been
4352  * activated. A data call is only removed from this list when the
4353  * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
4354  * is powered off/on.
4355  *
4356  * See also: RIL_REQUEST_DATA_CALL_LIST
4357  */
4358
4359 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
4360
4361 /**
4362  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
4363  *
4364  * Reports supplementary service related notification from the network.
4365  *
4366  * "data" is a const RIL_SuppSvcNotification *
4367  *
4368  */
4369
4370 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
4371
4372 /**
4373  * RIL_UNSOL_STK_SESSION_END
4374  *
4375  * Indicate when STK session is terminated by SIM.
4376  *
4377  * "data" is NULL
4378  */
4379 #define RIL_UNSOL_STK_SESSION_END 1012
4380
4381 /**
4382  * RIL_UNSOL_STK_PROACTIVE_COMMAND
4383  *
4384  * Indicate when SIM issue a STK proactive command to applications
4385  *
4386  * "data" is a const char * containing SAT/USAT proactive command
4387  * in hexadecimal format string starting with command tag
4388  *
4389  */
4390 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
4391
4392 /**
4393  * RIL_UNSOL_STK_EVENT_NOTIFY
4394  *
4395  * Indicate when SIM notifies applcations some event happens.
4396  * Generally, application does not need to have any feedback to
4397  * SIM but shall be able to indicate appropriate messages to users.
4398  *
4399  * "data" is a const char * containing SAT/USAT commands or responses
4400  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
4401  * starting with first byte of response data or command tag
4402  *
4403  */
4404 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
4405
4406 /**
4407  * RIL_UNSOL_STK_CALL_SETUP
4408  *
4409  * Indicate when SIM wants application to setup a voice call.
4410  *
4411  * "data" is const int *
4412  * ((const int *)data)[0] contains timeout value (in milliseconds)
4413  */
4414 #define RIL_UNSOL_STK_CALL_SETUP 1015
4415
4416 /**
4417  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
4418  *
4419  * Indicates that SMS storage on the SIM is full.  Sent when the network
4420  * attempts to deliver a new SMS message.  Messages cannot be saved on the
4421  * SIM until space is freed.  In particular, incoming Class 2 messages
4422  * cannot be stored.
4423  *
4424  * "data" is null
4425  *
4426  */
4427 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
4428
4429 /**
4430  * RIL_UNSOL_SIM_REFRESH
4431  *
4432  * Indicates that file(s) on the SIM have been updated, or the SIM
4433  * has been reinitialized.
4434  *
4435  * In the case where RIL is version 6 or older:
4436  * "data" is an int *
4437  * ((int *)data)[0] is a RIL_SimRefreshResult.
4438  * ((int *)data)[1] is the EFID of the updated file if the result is
4439  * SIM_FILE_UPDATE or NULL for any other result.
4440  *
4441  * In the case where RIL is version 7:
4442  * "data" is a RIL_SimRefreshResponse_v7 *
4443  *
4444  * Note: If the SIM state changes as a result of the SIM refresh (eg,
4445  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
4446  * should be sent.
4447  */
4448 #define RIL_UNSOL_SIM_REFRESH 1017
4449
4450 /**
4451  * RIL_UNSOL_CALL_RING
4452  *
4453  * Ring indication for an incoming call (eg, RING or CRING event).
4454  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
4455  * of a call and sending multiple is optional. If the system property
4456  * ro.telephony.call_ring.multiple is false then the upper layers
4457  * will generate the multiple events internally. Otherwise the vendor
4458  * ril must generate multiple RIL_UNSOL_CALL_RING if
4459  * ro.telephony.call_ring.multiple is true or if it is absent.
4460  *
4461  * The rate of these events is controlled by ro.telephony.call_ring.delay
4462  * and has a default value of 3000 (3 seconds) if absent.
4463  *
4464  * "data" is null for GSM
4465  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
4466  */
4467 #define RIL_UNSOL_CALL_RING 1018
4468
4469 /**
4470  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
4471  *
4472  * Indicates that SIM state changes.
4473  *
4474  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
4475
4476  * "data" is null
4477  */
4478 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
4479
4480 /**
4481  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
4482  *
4483  * Called when new CDMA SMS is received
4484  *
4485  * "data" is const RIL_CDMA_SMS_Message *
4486  *
4487  * Callee will subsequently confirm the receipt of the SMS with
4488  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
4489  *
4490  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
4491  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
4492  *
4493  */
4494 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
4495
4496 /**
4497  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
4498  *
4499  * Called when new Broadcast SMS is received
4500  *
4501  * "data" can be one of the following:
4502  * If received from GSM network, "data" is const char of 88 bytes
4503  * which indicates each page of a CBS Message sent to the MS by the
4504  * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
4505  * If received from UMTS network, "data" is const char of 90 up to 1252
4506  * bytes which contain between 1 and 15 CBS Message pages sent as one
4507  * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
4508  *
4509  */
4510 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
4511
4512 /**
4513  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
4514  *
4515  * Indicates that SMS storage on the RUIM is full.  Messages
4516  * cannot be saved on the RUIM until space is freed.
4517  *
4518  * "data" is null
4519  *
4520  */
4521 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
4522
4523 /**
4524  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
4525  *
4526  * Indicates a restricted state change (eg, for Domain Specific Access Control).
4527  *
4528  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
4529  *
4530  * "data" is an int *
4531  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
4532  */
4533 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
4534
4535 /**
4536  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
4537  *
4538  * Indicates that the radio system selection module has
4539  * autonomously entered emergency callback mode.
4540  *
4541  * "data" is null
4542  *
4543  */
4544 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
4545
4546 /**
4547  * RIL_UNSOL_CDMA_CALL_WAITING
4548  *
4549  * Called when CDMA radio receives a call waiting indication.
4550  *
4551  * "data" is const RIL_CDMA_CallWaiting *
4552  *
4553  */
4554 #define RIL_UNSOL_CDMA_CALL_WAITING 1025
4555
4556 /**
4557  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
4558  *
4559  * Called when CDMA radio receives an update of the progress of an
4560  * OTASP/OTAPA call.
4561  *
4562  * "data" is const int *
4563  *  For CDMA this is an integer OTASP/OTAPA status listed in
4564  *  RIL_CDMA_OTA_ProvisionStatus.
4565  *
4566  */
4567 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
4568
4569 /**
4570  * RIL_UNSOL_CDMA_INFO_REC
4571  *
4572  * Called when CDMA radio receives one or more info recs.
4573  *
4574  * "data" is const RIL_CDMA_InformationRecords *
4575  *
4576  */
4577 #define RIL_UNSOL_CDMA_INFO_REC 1027
4578
4579 /**
4580  * RIL_UNSOL_OEM_HOOK_RAW
4581  *
4582  * This is for OEM specific use.
4583  *
4584  * "data" is a byte[]
4585  */
4586 #define RIL_UNSOL_OEM_HOOK_RAW 1028
4587
4588 /**
4589  * RIL_UNSOL_RINGBACK_TONE
4590  *
4591  * Indicates that nework doesn't have in-band information,  need to
4592  * play out-band tone.
4593  *
4594  * "data" is an int *
4595  * ((int *)data)[0] == 0 for stop play ringback tone.
4596  * ((int *)data)[0] == 1 for start play ringback tone.
4597  */
4598 #define RIL_UNSOL_RINGBACK_TONE 1029
4599
4600 /**
4601  * RIL_UNSOL_RESEND_INCALL_MUTE
4602  *
4603  * Indicates that framework/application need reset the uplink mute state.
4604  *
4605  * There may be situations where the mute state becomes out of sync
4606  * between the application and device in some GSM infrastructures.
4607  *
4608  * "data" is null
4609  */
4610 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
4611
4612 /**
4613  * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
4614  *
4615  * Called when CDMA subscription source changed.
4616  *
4617  * "data" is int *
4618  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
4619  */
4620 #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
4621
4622 /**
4623  * RIL_UNSOL_CDMA_PRL_CHANGED
4624  *
4625  * Called when PRL (preferred roaming list) changes.
4626  *
4627  * "data" is int *
4628  * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
4629  */
4630 #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
4631
4632 /**
4633  * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
4634  *
4635  * Called when Emergency Callback Mode Ends
4636  *
4637  * Indicates that the radio system selection module has
4638  * proactively exited emergency callback mode.
4639  *
4640  * "data" is NULL
4641  *
4642  */
4643 #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
4644
4645 /**
4646  * RIL_UNSOL_RIL_CONNECTED
4647  *
4648  * Called the ril connects and returns the version
4649  *
4650  * "data" is int *
4651  * ((int *)data)[0] is RIL_VERSION
4652  */
4653 #define RIL_UNSOL_RIL_CONNECTED 1034
4654
4655 /**
4656  * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
4657  *
4658  * Indicates that voice technology has changed. Contains new radio technology
4659  * as a data in the message.
4660  *
4661  * "data" is int *
4662  * ((int *)data)[0] is of type const RIL_RadioTechnology
4663  *
4664  */
4665 #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
4666
4667 /**
4668  * RIL_UNSOL_CELL_INFO_LIST
4669  *
4670  * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned
4671  * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE.
4672  *
4673  * "data" is NULL
4674  *
4675  * "response" is an array of RIL_CellInfo.
4676  */
4677 #define RIL_UNSOL_CELL_INFO_LIST 1036
4678
4679 /**
4680  * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED
4681  *
4682  * Called when IMS registration state has changed
4683  *
4684  * To get IMS registration state and IMS SMS format, callee needs to invoke the
4685  * following request on main thread:
4686  *
4687  * RIL_REQUEST_IMS_REGISTRATION_STATE
4688  *
4689  * "data" is NULL
4690  *
4691  */
4692 #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037
4693
4694 /**
4695  * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED
4696  *
4697  * Indicated when there is a change in subscription status.
4698  * This event will be sent in the following scenarios
4699  *  - subscription readiness at modem, which was selected by telephony layer
4700  *  - when subscription is deactivated by modem due to UICC card removal
4701  *  - When network invalidates the subscription i.e. attach reject due to authentication reject
4702  *
4703  * "data" is const int *
4704  * ((const int *)data)[0] == 0 for Subscription Deactivated
4705  * ((const int *)data)[0] == 1 for Subscription Activated
4706  *
4707  */
4708 #define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1038
4709
4710 /**
4711  * RIL_UNSOL_SRVCC_STATE_NOTIFY
4712  *
4713  * Called when Single Radio Voice Call Continuity(SRVCC)
4714  * progress state has changed
4715  *
4716  * "data" is int *
4717  * ((int *)data)[0] is of type const RIL_SrvccState
4718  *
4719  */
4720
4721 #define RIL_UNSOL_SRVCC_STATE_NOTIFY 1039
4722
4723 /**
4724  * RIL_UNSOL_HARDWARE_CONFIG_CHANGED
4725  *
4726  * Called when the hardware configuration associated with the RILd changes
4727  *
4728  * "data" is an array of RIL_HardwareConfig
4729  *
4730  */
4731 #define RIL_UNSOL_HARDWARE_CONFIG_CHANGED 1040
4732
4733 /**
4734  * RIL_UNSOL_DC_RT_INFO_CHANGED
4735  *
4736  * Sent when the DC_RT_STATE changes but the time
4737  * between these messages must not be less than the
4738  * value set by RIL_REQUEST_SET_DC_RT_RATE.
4739  *
4740  * "data" is the most recent RIL_DcRtInfo
4741  *
4742  */
4743 #define RIL_UNSOL_DC_RT_INFO_CHANGED 1041
4744
4745 /**
4746  * RIL_UNSOL_RADIO_CAPABILITY
4747  *
4748  * Sent when RIL_REQUEST_SET_RADIO_CAPABILITY completes.
4749  * Returns the phone radio capability exactly as
4750  * RIL_REQUEST_GET_RADIO_CAPABILITY and should be the
4751  * same set as sent by RIL_REQUEST_SET_RADIO_CAPABILITY.
4752  *
4753  * "data" is the RIL_RadioCapability structure
4754  */
4755 #define RIL_UNSOL_RADIO_CAPABILITY 1042
4756
4757 /***********************************************************************/
4758
4759 #if defined(ANDROID_MULTI_SIM)
4760 /**
4761  * RIL_Request Function pointer
4762  *
4763  * @param request is one of RIL_REQUEST_*
4764  * @param data is pointer to data defined for that RIL_REQUEST_*
4765  *        data is owned by caller, and should not be modified or freed by callee
4766  * @param t should be used in subsequent call to RIL_onResponse
4767  * @param datalen the length of data
4768  *
4769  */
4770 typedef void (*RIL_RequestFunc) (int request, void *data,
4771                                     size_t datalen, RIL_Token t, RIL_SOCKET_ID socket_id);
4772
4773 /**
4774  * This function should return the current radio state synchronously
4775  */
4776 typedef RIL_RadioState (*RIL_RadioStateRequest)(RIL_SOCKET_ID socket_id);
4777
4778 #else
4779 /* Backward compatible */
4780
4781 /**
4782  * RIL_Request Function pointer
4783  *
4784  * @param request is one of RIL_REQUEST_*
4785  * @param data is pointer to data defined for that RIL_REQUEST_*
4786  *        data is owned by caller, and should not be modified or freed by callee
4787  * @param t should be used in subsequent call to RIL_onResponse
4788  * @param datalen the length of data
4789  *
4790  */
4791 typedef void (*RIL_RequestFunc) (int request, void *data,
4792                                     size_t datalen, RIL_Token t);
4793
4794 /**
4795  * This function should return the current radio state synchronously
4796  */
4797 typedef RIL_RadioState (*RIL_RadioStateRequest)();
4798
4799 #endif
4800
4801
4802 /**
4803  * This function returns "1" if the specified RIL_REQUEST code is
4804  * supported and 0 if it is not
4805  *
4806  * @param requestCode is one of RIL_REQUEST codes
4807  */
4808
4809 typedef int (*RIL_Supports)(int requestCode);
4810
4811 /**
4812  * This function is called from a separate thread--not the
4813  * thread that calls RIL_RequestFunc--and indicates that a pending
4814  * request should be cancelled.
4815  *
4816  * On cancel, the callee should do its best to abandon the request and
4817  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
4818  *
4819  * Subsequent calls to  RIL_onRequestComplete for this request with
4820  * other results will be tolerated but ignored. (That is, it is valid
4821  * to ignore the cancellation request)
4822  *
4823  * RIL_Cancel calls should return immediately, and not wait for cancellation
4824  *
4825  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
4826  * interface
4827  *
4828  * @param t token wants to be canceled
4829  */
4830
4831 typedef void (*RIL_Cancel)(RIL_Token t);
4832
4833 typedef void (*RIL_TimedCallback) (void *param);
4834
4835 /**
4836  * Return a version string for your RIL implementation
4837  */
4838 typedef const char * (*RIL_GetVersion) (void);
4839
4840 typedef struct {
4841     int version;        /* set to RIL_VERSION */
4842     RIL_RequestFunc onRequest;
4843     RIL_RadioStateRequest onStateRequest;
4844     RIL_Supports supports;
4845     RIL_Cancel onCancel;
4846     RIL_GetVersion getVersion;
4847 } RIL_RadioFunctions;
4848
4849 typedef struct {
4850     char *apn;
4851     char *protocol;
4852     int authtype;
4853     char *username;
4854     char *password;
4855 } RIL_InitialAttachApn;
4856
4857 typedef struct {
4858     int authContext;            /* P2 value of authentication command, see P2 parameter in
4859                                    3GPP TS 31.102 7.1.2 */
4860     char *authData;             /* the challenge string in Base64 format, see 3GPP
4861                                    TS 31.102 7.1.2 */
4862     char *aid;                  /* AID value, See ETSI 102.221 8.1 and 101.220 4,
4863                                    NULL if no value. */
4864 } RIL_SimAuthentication;
4865
4866 #ifdef RIL_SHLIB
4867 struct RIL_Env {
4868     /**
4869      * "t" is parameter passed in on previous call to RIL_Notification
4870      * routine.
4871      *
4872      * If "e" != SUCCESS, then response can be null/is ignored
4873      *
4874      * "response" is owned by caller, and should not be modified or
4875      * freed by callee
4876      *
4877      * RIL_onRequestComplete will return as soon as possible
4878      */
4879     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
4880                            void *response, size_t responselen);
4881
4882 #if defined(ANDROID_MULTI_SIM)
4883     /**
4884      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
4885      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
4886      *
4887      * "data" is owned by caller, and should not be modified or freed by callee
4888      */
4889     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen, RIL_SOCKET_ID socket_id);
4890 #else
4891     /**
4892      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
4893      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
4894      *
4895      * "data" is owned by caller, and should not be modified or freed by callee
4896      */
4897     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen);
4898 #endif
4899     /**
4900      * Call user-specifed "callback" function on on the same thread that
4901      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
4902      * a relative time value at which the callback is invoked. If relativeTime is
4903      * NULL or points to a 0-filled structure, the callback will be invoked as
4904      * soon as possible
4905      */
4906
4907     void (*RequestTimedCallback) (RIL_TimedCallback callback,
4908                                    void *param, const struct timeval *relativeTime);
4909 };
4910
4911
4912 /**
4913  *  RIL implementations must defined RIL_Init
4914  *  argc and argv will be command line arguments intended for the RIL implementation
4915  *  Return NULL on error
4916  *
4917  * @param env is environment point defined as RIL_Env
4918  * @param argc number of arguments
4919  * @param argv list fo arguments
4920  *
4921  */
4922 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
4923
4924 #else /* RIL_SHLIB */
4925
4926 /**
4927  * Call this once at startup to register notification routine
4928  *
4929  * @param callbacks user-specifed callback function
4930  */
4931 void RIL_register (const RIL_RadioFunctions *callbacks);
4932
4933
4934 /**
4935  *
4936  * RIL_onRequestComplete will return as soon as possible
4937  *
4938  * @param t is parameter passed in on previous call to RIL_Notification
4939  *          routine.
4940  * @param e error code
4941  *          if "e" != SUCCESS, then response can be null/is ignored
4942  * @param response is owned by caller, and should not be modified or
4943  *                 freed by callee
4944  * @param responselen the length of response in byte
4945  */
4946 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
4947                            void *response, size_t responselen);
4948
4949 #if defined(ANDROID_MULTI_SIM)
4950 /**
4951  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
4952  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
4953  *     "data" is owned by caller, and should not be modified or freed by callee
4954  * @param datalen the length of data in byte
4955  */
4956
4957 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
4958                                 size_t datalen, RIL_SOCKET_ID socket_id);
4959 #else
4960 /**
4961  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
4962  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
4963  *     "data" is owned by caller, and should not be modified or freed by callee
4964  * @param datalen the length of data in byte
4965  */
4966
4967 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
4968                                 size_t datalen);
4969 #endif
4970
4971 /**
4972  * Call user-specifed "callback" function on on the same thread that
4973  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
4974  * a relative time value at which the callback is invoked. If relativeTime is
4975  * NULL or points to a 0-filled structure, the callback will be invoked as
4976  * soon as possible
4977  *
4978  * @param callback user-specifed callback function
4979  * @param param parameter list
4980  * @param relativeTime a relative time value at which the callback is invoked
4981  */
4982
4983 void RIL_requestTimedCallback (RIL_TimedCallback callback,
4984                                void *param, const struct timeval *relativeTime);
4985
4986
4987 #endif /* RIL_SHLIB */
4988
4989 #ifdef __cplusplus
4990 }
4991 #endif
4992
4993 #endif /*ANDROID_RIL_H*/