OSDN Git Service

Support for fetching PSC of serving cell.
[android-x86/hardware-ril.git] / include / telephony / ril.h
index af7a873..4bd9442 100644 (file)
@@ -40,7 +40,7 @@
 extern "C" {
 #endif
 
-#define RIL_VERSION 2
+#define RIL_VERSION 3
 
 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
@@ -67,7 +67,9 @@ typedef enum {
     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
                                                    location */
     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
-    RIL_E_FDN_CHECK_FAILURE = 14                /* command failed because recipient is not on FDN list */
+    RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
+    RIL_E_ILLEGAL_SIM_OR_ME = 15                /* network selection failed due to
+                                                   illegal SIM or ME */
 } RIL_Errno;
 
 typedef enum {
@@ -94,7 +96,40 @@ typedef enum {
     RADIO_STATE_NV_READY = 9               /* Radio is on and the NV interface is available */
 } RIL_RadioState;
 
- /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
+/* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
+typedef enum {
+    RIL_UUS_TYPE1_IMPLICIT = 0,
+    RIL_UUS_TYPE1_REQUIRED = 1,
+    RIL_UUS_TYPE1_NOT_REQUIRED = 2,
+    RIL_UUS_TYPE2_REQUIRED = 3,
+    RIL_UUS_TYPE2_NOT_REQUIRED = 4,
+    RIL_UUS_TYPE3_REQUIRED = 5,
+    RIL_UUS_TYPE3_NOT_REQUIRED = 6
+} RIL_UUS_Type;
+
+/* User-to-User Signaling Information data coding schemes. Possible values for
+ * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
+ * specified in section 10.5.4.25 of 3GPP TS 24.008 */
+typedef enum {
+    RIL_UUS_DCS_USP = 0,          /* User specified protocol */
+    RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
+    RIL_UUS_DCS_X244 = 2,         /* X.244 */
+    RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
+                                     convergence function */
+    RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
+} RIL_UUS_DCS;
+
+/* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
+ * This data is passed in RIL_ExtensionRecord and rec contains this
+ * structure when type is RIL_UUS_INFO_EXT_REC */
+typedef struct {
+  RIL_UUS_Type    uusType;    /* UUS Type */
+  RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
+  int             uusLength;  /* Length of UUS Data */
+  char *          uusData;    /* UUS Data */
+} RIL_UUS_Info;
+
+/* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
 typedef struct {
   char isPresent;    /* non-zero if signal information record is present */
   char signalType;   /* as defined 3.7.5.5-1 */
@@ -116,6 +151,7 @@ typedef struct {
     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
     char *          name;       /* Remote party name */
     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
+    RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
 } RIL_Call;
 
 typedef struct {
@@ -127,7 +163,9 @@ typedef struct {
 } RIL_Data_Call_Response;
 
 typedef struct {
-    int messageRef;   /*TP-Message-Reference*/
+    int messageRef;   /* TP-Message-Reference for GSM,
+                         and BearerData MessageId for CDMA
+                         (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
     char *ackPDU;     /* or NULL if n/a */
     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
@@ -156,6 +194,7 @@ typedef struct {
              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
              * clir == 2 on "CLIR suppression" (allow CLI presentation)
              */
+    RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
 } RIL_Dial;
 
 typedef struct {
@@ -205,18 +244,21 @@ typedef struct {
 }RIL_CallForwardInfo;
 
 typedef struct {
-   char * cid;         /* Cell Id (as described in TS 27.005) in 16 bits in GSM
+   char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
+                        * Upper 16 bits is LAC and lower 16 bits
+                        * is CID (as described in TS 27.005)
                         * Primary Scrambling Code (as described in TS 25.331)
                         *         in 9 bits in UMTS
-                        * Valid values are hexadecimal 0x0000 - 0xffff.
+                        * Valid values are hexadecimal 0x0000 - 0xffffffff.
                         */
-   int    rssi;        /* Received RSSI in 2G,
-                        * Level index of CPICH Received Signal Code Power in 3G
+   int    rssi;        /* Received RSSI in GSM,
+                        * Level index of CPICH Received Signal Code Power in UMTS
                         */
 } RIL_NeighboringCell;
 
 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
 typedef enum {
+    CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
     CALL_FAIL_NORMAL = 16,
     CALL_FAIL_BUSY = 17,
     CALL_FAIL_CONGESTION = 34,
@@ -235,6 +277,7 @@ typedef enum {
     CALL_FAIL_CDMA_PREEMPTED = 1007,
     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
                                             during emergency callback mode */
+    CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
 } RIL_LastCallFailCause;
 
@@ -939,7 +982,9 @@ typedef struct {
  * "data" is NULL
  * "response" is a "int *"
  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
- * mapped to cause codes defined in TS 24.008 Annex H where possible.
+ * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
+ * failure reasons are derived from the possible call failure scenarios
+ * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
  *
  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
@@ -991,6 +1036,15 @@ typedef struct {
  *              3 - Registration denied
  *              4 - Unknown
  *              5 - Registered, roaming
+ *             10 - Same as 0, but indicates that emergency calls
+ *                  are enabled.
+ *             12 - Same as 2, but indicates that emergency calls
+ *                  are enabled.
+ *             13 - Same as 3, but indicates that emergency calls
+ *                  are enabled.
+ *             14 - Same as 4, but indicates that emergency calls
+ *                  are enabled.
+ *
  * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
  *                              NULL if not.Valid LAC are 0x0000 - 0xffff
  * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
@@ -1004,16 +1058,25 @@ typedef struct {
  *                                  0 - Unknown, 1 - GPRS, 2 - EDGE, 3 - UMTS,
  *                                  4 - IS95A, 5 - IS95B, 6 - 1xRTT,
  *                                  7 - EvDo Rev. 0, 8 - EvDo Rev. A,
- *                                  9 - HSDPA, 10 - HSUPA, 11 - HSPA
+ *                                  9 - HSDPA, 10 - HSUPA, 11 - HSPA,
+ *                                  12 - EVDO Rev B
  * ((const char **)response)[4] is Base Station ID if registered on a CDMA
  *                              system or NULL if not.  Base Station ID in
  *                              decimal format
  * ((const char **)response)[5] is Base Station latitude if registered on a
  *                              CDMA system or NULL if not. Base Station
- *                              latitude in hexadecimal format
+ *                              latitude is a decimal number as specified in
+ *                              3GPP2 C.S0005-A v6.0. It is represented in
+ *                              units of 0.25 seconds and ranges from -1296000
+ *                              to 1296000, both values inclusive (corresponding
+ *                              to a range of -90° to +90°).
  * ((const char **)response)[6] is Base Station longitude if registered on a
  *                              CDMA system or NULL if not. Base Station
- *                              longitude in hexadecimal format
+ *                              longitude is a decimal number as specified in
+ *                              3GPP2 C.S0005-A v6.0. It is represented in
+ *                              units of 0.25 seconds and ranges from -2592000
+ *                              to 2592000, both values inclusive (corresponding
+ *                              to a range of -180° to +180°).
  * ((const char **)response)[7] is concurrent services support indicator if
  *                              registered on a CDMA system 0-1.
  *                                   0 - Concurrent services not supported,
@@ -1023,13 +1086,13 @@ typedef struct {
  * ((const char **)response)[9] is Network ID if registered on a CDMA system or
  *                              NULL if not. Valid System ID are 0 - 65535
  * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
- *                               on a CDMA system or NULL if not. Valid values
+ *                               on a CDMA or EVDO system or NULL if not. Valid values
  *                               are 0-255.
  * ((const char **)response)[11] indicates whether the current system is in the
- *                               PRL if registered on a CDMA system or NULL if
+ *                               PRL if registered on a CDMA or EVDO system or NULL if
  *                               not. 0=not in the PRL, 1=in the PRL
  * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
- *                               if registered on a CDMA system or NULL if not.
+ *                               if registered on a CDMA or EVDO system or NULL if not.
  *                               Valid values are 0-255.
  * ((const char **)response)[13] if registration state is 3 (Registration
  *                               denied) this is an enumerated reason why
@@ -1046,6 +1109,10 @@ typedef struct {
  *                                 8 - No Suitable Cells in this Location Area
  *                                 9 - Network failure
  *                                10 - Persistent location update reject
+ * ((const char **)response)[14] is the Primary Scrambling Code of the current
+ *                               cell as described in TS 25.331, in hexadecimal
+ *                               format, or NULL if unknown or not registered
+ *                               to a UMTS network.
  *
  * Please note that registration state 4 ("unknown") is treated
  * as "out of service" in the Android telephony system
@@ -1665,8 +1732,14 @@ typedef struct {
  * Valid errors:
  *  SUCCESS
  *  RADIO_NOT_AVAILABLE
+ *  ILLEGAL_SIM_OR_ME
  *  GENERIC_FAILURE
  *
+ * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
+ *       no retries needed, such as illegal SIM or ME.
+ *       Returns GENERIC_FAILURE for all other causes that might be
+ *       fixed by retries.
+ *
  */
 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
 
@@ -1684,8 +1757,14 @@ typedef struct {
  * Valid errors:
  *  SUCCESS
  *  RADIO_NOT_AVAILABLE
+ *  ILLEGAL_SIM_OR_ME
  *  GENERIC_FAILURE
  *
+ * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
+ *       no retries needed, such as illegal SIM or ME.
+ *       Returns GENERIC_FAILURE for all other causes that might be
+ *       fixed by retries.
+ *
  */
 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
 
@@ -1989,8 +2068,9 @@ typedef struct {
  *
  * Indicates the current state of the screen.  When the screen is off, the
  * RIL should notify the baseband to suppress certain notifications (eg,
- * signal strength and changes in LAC or CID) in an effort to conserve power.
- * These notifications should resume when the screen is on.
+ * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
+ * in an effort to conserve power.  These notifications should resume when the
+ * screen is on.
  *
  * "data" is int *
  * ((int *)data)[0] is == 1 for "Screen On"
@@ -2321,7 +2401,8 @@ typedef struct {
  * RIL_REQUEST_SET_LOCATION_UPDATES
  *
  * Enables/disables network state change notifications due to changes in
- * LAC and/or CID (basically, +CREG=2 vs. +CREG=1).
+ * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
+ * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
  *
  * Note:  The RIL implementation should default to "updates enabled"
  * when the screen is on and "updates disabled" when the screen is off.
@@ -2524,12 +2605,18 @@ typedef struct {
 #define RIL_REQUEST_CDMA_BURST_DTMF 85
 
 /**
- * RIL_REQUEST_CDMA_VALIDATE_AKEY
+ * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
  *
- * Validate AKey.
+ * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
+ * If the checksum is valid the 20 digit AKEY is written to NV,
+ * replacing the existing AKEY no matter what it was before.
  *
  * "data" is const char *
- * ((const char *)data)[0] is a AKey string
+ * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
+ *                         where the last 6 digits are a checksum of the
+ *                         first 20, as specified in TR45.AHAG
+ *                         "Common Cryptographic Algorithms, Revision D.1
+ *                         Section 2.2"
  *
  * "response" is NULL
  *
@@ -2539,7 +2626,7 @@ typedef struct {
  *  GENERIC_FAILURE
  *
  */
-#define RIL_REQUEST_CDMA_VALIDATE_AKEY 86
+#define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
 
 /**
  * RIL_REQUEST_CDMA_SEND_SMS
@@ -2550,6 +2637,12 @@ typedef struct {
  *
  * "response" is a const RIL_SMS_Response *
  *
+ * Based on the return error, caller decides to resend if sending sms
+ * fails. The CDMA error class is derived as follows,
+ * SUCCESS is error class 0 (no error)
+ * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
+ * and GENERIC_FAILURE is error class 3 (permanent and no retry)
+ *
  * Valid errors:
  *  SUCCESS
  *  RADIO_NOT_AVAILABLE
@@ -2870,7 +2963,6 @@ typedef struct {
  */
 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
 
-
 /***********************************************************************/
 
 
@@ -3134,6 +3226,15 @@ typedef struct {
  * RIL_UNSOL_CALL_RING
  *
  * Ring indication for an incoming call (eg, RING or CRING event).
+ * There must be at least one RIL_UNSOL_CALL_RING at the beginning
+ * of a call and sending multiple is optional. If the system property
+ * ro.telephony.call_ring.multiple is false then the upper layers
+ * will generate the multiple events internally. Otherwise the vendor
+ * ril must generate multiple RIL_UNSOL_CALL_RING if
+ * ro.telephony.call_ring.multiple is true or if it is absent.
+ *
+ * The rate of these events is controlled by ro.telephony.call_ring.delay
+ * and has a default value of 3000 (3 seconds) if absent.
  *
  * "data" is null for GSM
  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
@@ -3255,6 +3356,29 @@ typedef struct {
  */
 #define RIL_UNSOL_OEM_HOOK_RAW 1028
 
+/**
+ * RIL_UNSOL_RINGBACK_TONE
+ *
+ * Indicates that nework doesn't have in-band information,  need to
+ * play out-band tone.
+ *
+ * "data" is an int *
+ * ((int *)data)[0] == 0 for stop play ringback tone.
+ * ((int *)data)[0] == 1 for start play ringback tone.
+ */
+#define RIL_UNSOL_RINGBACK_TONE 1029
+
+/**
+ * RIL_UNSOL_RESEND_INCALL_MUTE
+ *
+ * Indicates that framework/application need reset the uplink mute state.
+ *
+ * There may be situations where the mute state becomes out of sync
+ * between the application and device in some GSM infrastructures.
+ *
+ * "data" is null
+ */
+#define RIL_UNSOL_RESEND_INCALL_MUTE 1030
 /***********************************************************************/