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