Add DS support.

Change-Id: Ib8bc4e171dd5ca526f8e151ff3d467097582a8cb
diff --git a/mbtk/mbtk_rild_v2/inc/atchannel.h b/mbtk/mbtk_rild_v2/inc/atchannel.h
index 43efd0e..997ef33 100755
--- a/mbtk/mbtk_rild_v2/inc/atchannel.h
+++ b/mbtk/mbtk_rild_v2/inc/atchannel.h
@@ -87,8 +87,8 @@
  */
 typedef void (*ATUnsolHandler)(const char *s, const char *sms_pdu);
 
-int at_open(ATPortType_enum port, int at_fd, int uart_fd, ATUnsolHandler h);
-void at_close(ATPortType_enum port);
+int at_open(ATPortId_enum port, int at_fd, int uart_fd, ATUnsolHandler h);
+void at_close(ATPortId_enum port);
 
 /* This callback is invoked on the command thread.
    You should reset or handshake here to avoid getting out of sync */
@@ -101,26 +101,26 @@
    channel is already closed */
 void at_set_on_reader_closed(void (*onClose)(void));
 
-int at_send_command_singleline (ATPortType_enum port, const char *command,
+int at_send_command_singleline (ATPortId_enum port, const char *command,
                                 const char *responsePrefix,
                                 ATResponse **pp_outResponse);
-int at_send_command_singleline_with_timeout (ATPortType_enum port, const char *command,
+int at_send_command_singleline_with_timeout (ATPortId_enum port, const char *command,
         const char *responsePrefix,
         ATResponse **pp_outResponse,long long timeoutMsec);
 
-int at_send_command_numeric (ATPortType_enum port, const char *command,
+int at_send_command_numeric (ATPortId_enum port, const char *command,
                              ATResponse **pp_outResponse);
 
-int at_send_command_multiline (ATPortType_enum port, const char *command,
+int at_send_command_multiline (ATPortId_enum port, const char *command,
                                const char *responsePrefix,
                                ATResponse **pp_outResponse);
 
 
-int at_handshake(ATPortType_enum port);
+int at_handshake(ATPortId_enum port);
 
-int at_send_command (ATPortType_enum port, const char *command, ATResponse **pp_outResponse);
+int at_send_command (ATPortId_enum port, const char *command, ATResponse **pp_outResponse);
 
-int at_send_command_sms (ATPortType_enum port, const char *command, const char *pdu,
+int at_send_command_sms (ATPortId_enum port, const char *command, const char *pdu,
                          const char *responsePrefix,
                          ATResponse **pp_outResponse);
 
@@ -136,8 +136,8 @@
 
 AT_CME_Error at_get_cme_error(const ATResponse *p_response);
 
-mbtk_ril_at_state_enum at_state_get(ATPortType_enum port);
-void at_state_set(ATPortType_enum port, mbtk_ril_at_state_enum state);
+mbtk_ril_at_state_enum at_state_get(ATPortId_enum port);
+void at_state_set(ATPortId_enum port, mbtk_ril_at_state_enum state);
 bool at_rsp_check(ATResponse *p_response);
 
 #ifdef __cplusplus
diff --git a/mbtk/mbtk_rild_v2/inc/ril_info.h b/mbtk/mbtk_rild_v2/inc/ril_info.h
index 558d3f9..3a41f0b 100755
--- a/mbtk/mbtk_rild_v2/inc/ril_info.h
+++ b/mbtk/mbtk_rild_v2/inc/ril_info.h
@@ -35,6 +35,7 @@
 typedef struct
 {
     int fd;
+    mbtk_sim_type_enum sim_id;
     ATPortType_enum port;
 
     uint32 ind_num;
@@ -48,9 +49,10 @@
 } ril_msg_queue_info_t;
 
 typedef struct {
-    mbtk_radio_state_enum radio_state;
-    mbtk_sim_state_enum sim_state;
-    mbtk_sim_card_type_enum sim_type;
+    mbtk_sim_type_enum cur_sim_id;
+    mbtk_radio_state_enum radio_state[MBTK_SIM_NUM];
+    mbtk_sim_state_enum sim_state[MBTK_SIM_NUM];
+    mbtk_sim_card_type_enum sim_type[MBTK_SIM_NUM];
     int sock_listen_fd;
     int epoll_fd;
     bool at_process[ATPORTTYPE_NUM];
@@ -122,12 +124,12 @@
 extern ril_info_t ril_info;
 
 
-mbtk_radio_state_enum ril_radio_state_get(ATPortType_enum port);
-mbtk_ril_err_enum ril_radio_state_set(ATPortType_enum port, mbtk_radio_state_enum state, bool reset);
+mbtk_radio_state_enum ril_radio_state_get(mbtk_sim_type_enum sim_id, ATPortType_enum port);
+mbtk_ril_err_enum ril_radio_state_set(mbtk_sim_type_enum sim_id, ATPortType_enum port, mbtk_radio_state_enum state, bool reset);
 
-mbtk_sim_state_enum ril_sim_state_get(ATPortType_enum port);
+mbtk_sim_state_enum ril_sim_state_get(mbtk_sim_type_enum sim_id, ATPortType_enum port);
 
-void apn_auto_conf_from_prop(ATPortType_enum port);
+void apn_auto_conf_from_prop(mbtk_sim_type_enum sim_id, ATPortType_enum port);
 
 bool is_ipv4(const char *ip);