OSDN Git Service

Add support for EVDO rev B
[android-x86/hardware-ril.git] / include / telephony / ril.h
index ca8c1df..4b53f6b 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
@@ -94,7 +94,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 +149,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 +161,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 +192,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 +242,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 +275,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;
 
@@ -280,20 +321,6 @@ typedef struct {
                                    (MT only, may be NULL). */
 } RIL_SuppSvcNotification;
 
-/* TODO: Remove these once reference-ril cleanup is done. */
-#define RIL_SIM_ABSENT                  0
-#define RIL_SIM_NOT_READY               1
-/* RIL_SIM_READY means that the radio state is RADIO_STATE_SIM_READY.
- * This is more
- * than "+CPIN: READY". It also means the radio is ready for SIM I/O
- */
-#define RIL_SIM_READY                   2
-#define RIL_SIM_PIN                     3
-#define RIL_SIM_PUK                     4
-#define RIL_SIM_NETWORK_PERSONALIZATION 5
-
-/* see RIL_REQUEST_GET_SIM_STATUS */
-
 #define RIL_CARD_MAX_APPS     8
 
 typedef enum {
@@ -613,13 +640,6 @@ typedef struct {
  * "data" is NULL
  *
  * "response" is const RIL_CardStatus *
-
- *
- * If the radio is off or unavailable, return RIL_SIM_NOT_READY
- *
- * Please note: RIL_SIM_READY means that the radio state
- * is RADIO_STATE_SIM_READY.   This is more than "+CPIN: READY".
- * It also means the radio is ready for SIM I/O
  *
  * Valid errors:
  *  Must never fail
@@ -629,7 +649,7 @@ typedef struct {
 /**
  * RIL_REQUEST_ENTER_SIM_PIN
  *
- * Supplies SIM PIN. Only called if SIM status is RIL_SIM_PIN
+ * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
  *
  * "data" is const char **
  * ((const char **)data)[0] is PIN value
@@ -960,7 +980,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)
@@ -1012,6 +1034,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
@@ -1024,16 +1055,26 @@ typedef struct {
  * ((const char **)response)[3] indicates the available radio technology 0-7,
  *                                  0 - Unknown, 1 - GPRS, 2 - EDGE, 3 - UMTS,
  *                                  4 - IS95A, 5 - IS95B, 6 - 1xRTT,
- *                                  7 - EvDo Rev. 0, 8 - EvDo Rev. A
+ *                                  7 - EvDo Rev. 0, 8 - EvDo Rev. A,
+ *                                  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,
@@ -1043,13 +1084,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
@@ -1088,7 +1129,7 @@ typedef struct {
  *
  * "data" is NULL
  * "response" is a "char **"
- * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2
+ * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
  * ((const char **)response)[1] is LAC if registered or NULL if not
  * ((const char **)response)[2] is CID if registered or NULL if not
  * ((const char **)response)[3] indicates the available radio technology, where:
@@ -1096,6 +1137,9 @@ typedef struct {
  *      1 == GPRS only
  *      2 == EDGE
  *      3 == UMTS
+ *      9 == HSDPA
+ *      10 == HSUPA
+ *      11 == HSPA
  *
  * LAC and CID are in hexadecimal format.
  * valid LAC are 0x0000 - 0xffff
@@ -2006,8 +2050,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"
@@ -2338,7 +2383,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.
@@ -2541,12 +2587,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
  *
@@ -2556,7 +2608,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
@@ -2567,6 +2619,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
@@ -2721,9 +2779,9 @@ typedef struct {
  * "response" is const char **
  * ((const char **)response)[0] is MDN if CDMA subscription is available
  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
- *                              CDMA subscription is available, in hexadecimal format
+ *                              CDMA subscription is available, in decimal format
  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
- *                              CDMA subscription is available, in hexadecimal format
+ *                              CDMA subscription is available, in decimal format
  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
  * ((const char **)response)[4] is PRL version if CDMA subscription is available
  *
@@ -3151,6 +3209,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
@@ -3272,6 +3339,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
 /***********************************************************************/