Squashed 'LYNQ_PUBLIC/' changes from 994e41a76..f3dd8cbdf

f3dd8cbdf [Feature][ZK-92] ftp gpslog to soc with syslog
8bb9992d3 [Feature][API-1508] in NMEA-statement for ZK ,transfer BD to GB
17579bbfa [BugFix][API-1564]fix File descriptor leakage
9c8bb35ff Merge "[Bugfix][API-1561][mtklog]  support mtk log slim fota upgrade"
926d2ad75 [Bugfix][API-1561][mtklog]  support mtk log slim fota upgrade
4bcc14334 Merge "[Bugfix][ZK-78][FOTA]get process and upgrade status error when start fota up status"
610236b60 [Bugfix][ZK-78][FOTA]get process and upgrade status error when start fota up status
f700d98cb Merge "[Bugfix][API-1473][mdlog] lynq_query_registration_state type Voice  lac cid error"
0c874421d [Feature][T8TSK-320]Print the reason for the PDN when disconnected by the modem into the syslog
dac13540e Merge "[Feature][API-1406][API-1113]Adjust SEND_SMS timeout"
31850f3e5 Merge "[Feature][API-1557] FIX libvendor-ril can`t connected RILD issue"
d3a8f5da1 [Feature][API-1557] FIX libvendor-ril can`t connected RILD issue
2f4c07922 Merge "[Feature][T8TSK-316][rtp] rtp confirm to the standard of Geely"
1ee60ec01 Merge "[Bugfix][API-1551[network]  lynq_set_vlan_info, vlan_info is "", ret 8004"
98beaeaf3 Merge "[Bugfix][API-1534]After turning on the USB port, delay for 3 seconds to make a  call"
786e97304 [Feature][T8TSK-289] missing wom when add telephonyware to LYNQ_PUBLIC repo 0
d25d37156 [Bugfix][API-1534]After turning on the USB port, delay for 3 seconds to make a  call
4157623f6 [Feature][T8TSK-316][rtp] rtp confirm to the standard of Geely
c66c73d5d [Bugfix][API-1551[network]  lynq_set_vlan_info, vlan_info is "", ret 8004
4bf2e2e0b [Feature][API-1406][API-1113]Adjust SEND_SMS timeout
4b1c33121 [Bugfix][API-1473][mdlog] lynq_query_registration_state type Voice  lac cid error

git-subtree-dir: LYNQ_PUBLIC
git-subtree-split: f3dd8cbdf17f75f5c9672368b59c1cd59194fce6

Change-Id: Ie206616813b8064220450958d9f91e5048c08ac2
diff --git a/IC_src/mtk/framework/lynq-logrotate-service/src/lynq_logrotate_service.c b/IC_src/mtk/framework/lynq-logrotate-service/src/lynq_logrotate_service.c
index 264bb11..d4338e1 100755
--- a/IC_src/mtk/framework/lynq-logrotate-service/src/lynq_logrotate_service.c
+++ b/IC_src/mtk/framework/lynq-logrotate-service/src/lynq_logrotate_service.c
@@ -141,6 +141,15 @@
     }

     system("/usr/bin/lynq-default");

     system("systemctl stop ntpd");

+

+    if(access("/etc/firmware/catcher_filter_5_SuperSlim.bin",0) && access("/data_backup/catcher_filter_5_SuperSlim.bin",0) == 0 )    

+    {

+           system("cp /data_backup/catcher_filter_5_SuperSlim.bin /etc/firmware/catcher_filter_5_SuperSlim.bin");

+           sleep(2);

+           system("killall emdlogger1");

+           sleep(2);         

+    }

+

     lynq_fota_func();

 //    while(1)

 //    {

diff --git a/IC_src/mtk/lib/liblynq-fota/rock_ua/rock_ua.c b/IC_src/mtk/lib/liblynq-fota/rock_ua/rock_ua.c
index d510633..8fae757 100755
--- a/IC_src/mtk/lib/liblynq-fota/rock_ua/rock_ua.c
+++ b/IC_src/mtk/lib/liblynq-fota/rock_ua/rock_ua.c
@@ -289,10 +289,9 @@
         RLOGD("+[UA]: save_fota_status: Error opening metadata file: %s\n",strerror(errno));
         return -err;
     }
-    
+
     write(fd_fota_status, &fota_status,sizeof(fota_status));
     sync();
-    
     close(fd_fota_status);
 }
 
@@ -876,6 +875,10 @@
     }
     close(fd);
 //xf.li@20230830 add for ab_recover end
+    memset(&fota_status,0,sizeof(fota_status));
+    fota_status.ota_run = 1;
+    save_fota_status();
+
     hw_module = &HAL_MODULE_INFO_SYM;
 
     if (!hw_module ||
@@ -907,7 +910,6 @@
     RLOGD("Booting slot = %d, : isSlotMarkedSuccessful= %d\n",current_slot,is_successful);
 
 
-
     memset(&ctx, 0, sizeof(ctx));
     ctx.rom_base = 0;
     ctx.ram_base =(unsigned char *)&ram_buffer[0];
@@ -927,8 +929,6 @@
         return E_ROCK_FOTA_ADDR;
     }
 
-
-    memset(&fota_status,0,sizeof(fota_status));
     RLOGD("+[UA]: up_info.ota_run = %d\n",up_info.ota_run);
 
 #if 0
@@ -937,7 +937,6 @@
         up_info.ota_run = 0;
     }    
 #endif 
-
     up_info.ota_run = 0;
     if(backup_mode == 1)
     {
@@ -1099,14 +1098,13 @@
                 fd_write = fd_partition_b;
             }
 
-            fota_status.ota_run = i;
+            fota_status.ota_run = i+1;
             fota_status.update_status[i].check_delta = WAIT;
             fota_status.update_status[i].check_rom = WAIT;
             fota_status.update_status[i].update_result= WAIT;
 
             save_fota_status();
-        
-        
+
             up_info.ota_run = i+1;
             save_fota_info();
 
@@ -1173,8 +1171,7 @@
 
         now_patch = 0;
         up_info.ota_run = 0;
-        
-        memset(&fota_status,0,sizeof(fota_status));
+
         fota_status.switch_slot = WAIT;
         save_fota_status();
         
diff --git a/IC_src/mtk/lib/liblynq-gnss/include/lynq_gnss.h b/IC_src/mtk/lib/liblynq-gnss/include/lynq_gnss.h
index fac71b0..ea02c2e 100755
--- a/IC_src/mtk/lib/liblynq-gnss/include/lynq_gnss.h
+++ b/IC_src/mtk/lib/liblynq-gnss/include/lynq_gnss.h
@@ -110,7 +110,9 @@
 int lynq_gnss_epo_switch(LYNQ_CONF_SWITCH switch_op);

 

 int lynq_gnss_output_frequency_set(int frequency);

-

+#ifdef GNSS_BD_TRANSFORM_GB

+int lynq_gnss_bd_transform_enable(int flag);

+#endif

 int lynq_agps_set_enabled(LYNQ_CONF_SWITCH agps_status);

 

 int lynq_agps_get_enabled_status(int *status);

diff --git a/IC_src/mtk/lib/liblynq-gnss/makefile b/IC_src/mtk/lib/liblynq-gnss/makefile
index 1d21aef..66084e0 100755
--- a/IC_src/mtk/lib/liblynq-gnss/makefile
+++ b/IC_src/mtk/lib/liblynq-gnss/makefile
@@ -50,6 +50,10 @@
     LOCAL_CFLAGS += -DGNSS_CN_OUTPUT_SYSLOG

 endif

 

+ifeq ($(strip $(MOBILETEK_GNSS_BD_TRANSFORM_GB)), yes)

+    LOCAL_CFLAGS += -DGNSS_BD_TRANSFORM_GB

+endif

+

 

 

 $(warning libs=$(LOCAL_LIBS))

diff --git a/IC_src/mtk/lib/liblynq-gnss/src/lynq_callback.c b/IC_src/mtk/lib/liblynq-gnss/src/lynq_callback.c
index 51dd989..e0102a3 100755
--- a/IC_src/mtk/lib/liblynq-gnss/src/lynq_callback.c
+++ b/IC_src/mtk/lib/liblynq-gnss/src/lynq_callback.c
@@ -25,7 +25,8 @@
 #define NMEA_GGA "GGA"

 #define NMEA_VTG "VTG"

 #define NMEA_GSV "GSV"

-

+#define NMEA_BD "BD"

+#define NMEA_GB "GB"

 time_t reopen_start;

 extern lynq_gnss_cb* lynq_callbacks;

 extern lynq_raw_gnss_cbs *lynq_meas_callbacks;

@@ -75,6 +76,9 @@
 int count = 0;

 int nmea_count = 0;

 #endif

+#ifdef GNSS_BD_TRANSFORM_GB

+extern int BD_transform_GB_flag;

+#endif

 

 static inline int update_systime_time(GpsUtcTime gpstime)

 {

@@ -135,6 +139,22 @@
     }

 }

 #endif

+#ifdef GNSS_BD_TRANSFORM_GB

+void BD_transform_GB(char *str)

+{

+    int i;

+    int result;

+

+    strncpy(str + 1, NMEA_GB,strlen(NMEA_GB));

+    result = str[1];

+    for(i = 2; str[i] != '*'; i++)

+    {

+        result ^= str[i];

+    }

+    sprintf(str+i+1,"%02X",result);

+    return;

+}

+#endif

 

 void lynq_gps_nmea_callback(GpsUtcTime timestamp, const char* nmea, int length)

 {

@@ -191,6 +211,15 @@
         }

     }

 #endif

+#ifdef GNSS_BD_TRANSFORM_GB

+    char str[128];

+    if(BD_transform_GB_flag == 1 && strncmp(nmea + 1, NMEA_BD,strlen(NMEA_BD)) == 0)

+    {

+        strncpy(str,nmea,strlen(nmea));

+        BD_transform_GB(str);

+        nmea = str;

+    }

+#endif

 #ifdef GNSS_ELT_OUTPUT_CFG

     if(Open_ELT)

     {

diff --git a/IC_src/mtk/lib/liblynq-gnss/src/lynq_gnss.c b/IC_src/mtk/lib/liblynq-gnss/src/lynq_gnss.c
index 053a2fd..c6ad803 100755
--- a/IC_src/mtk/lib/liblynq-gnss/src/lynq_gnss.c
+++ b/IC_src/mtk/lib/liblynq-gnss/src/lynq_gnss.c
@@ -398,6 +398,15 @@
     return 0;

 }

 

+#ifdef GNSS_BD_TRANSFORM_GB

+int BD_transform_GB_flag = 0;

+int lynq_gnss_bd_transform_enable(int flag)

+{

+    BD_transform_GB_flag = flag;

+    return 0;

+}

+#endif

+

 lynq_atsvc_outcb atsvc_gnss_outcb;

 void atsvc_incb_entity(const char *input,const int length);

 int lynq_at_cgps(int at_type,char *at_paramter);

diff --git a/IC_src/mtk/lib/liblynq-wifi6/libwifi6.c b/IC_src/mtk/lib/liblynq-wifi6/libwifi6.c
index 60c4224..dbc9ef1 100755
--- a/IC_src/mtk/lib/liblynq-wifi6/libwifi6.c
+++ b/IC_src/mtk/lib/liblynq-wifi6/libwifi6.c
@@ -214,7 +214,7 @@
 
 static void notify_service_invoke_fail(int error)
 {
-    struct local_wpa_ctrl *lynq_wpa_ctrl = NULL;
+    struct wpa_ctrl *lynq_wpa_ctrl = NULL;
     pthread_mutex_lock(&s_global_check_mutex);
     if (error == -2) //timeout
     {
@@ -232,15 +232,19 @@
         {
             s_service_invoke_timeout_cnt = FAKE_MAX_INT_VALUE;
             pthread_cond_signal(&s_global_check_cond);
-        }
-        wpa_ctrl_close(lynq_wpa_ctrl);
+        }else
+         {
+            wpa_ctrl_close(lynq_wpa_ctrl);
+         }
         lynq_wpa_ctrl = wpa_ctrl_open(CTRL_PATH[1]);
         if (lynq_wpa_ctrl == NULL)
         {
             s_service_invoke_timeout_cnt = FAKE_MAX_INT_VALUE;
             pthread_cond_signal(&s_global_check_cond);
+        }else
+        {
+            wpa_ctrl_close(lynq_wpa_ctrl);
         }
-        wpa_ctrl_close(lynq_wpa_ctrl);
     }
 
     pthread_mutex_unlock(&s_global_check_mutex);
@@ -1582,18 +1586,31 @@
         pthread_join(g_sta_watcher_pid, NULL);
     if (g_sta_auto_watcher_pid != 0)
         pthread_join(g_sta_auto_watcher_pid, NULL);
-    if (g_lynq_wpa_ctrl[0] != NULL)
-        wpa_ctrl_close(g_lynq_wpa_ctrl[0]);
-    if (g_lynq_wpa_ctrl[1] != NULL)
-        wpa_ctrl_close(g_lynq_wpa_ctrl[1]);
+    if ( g_lynq_wpa_ctrl[0] != NULL)
+    {
+        if(g_lynq_wpa_ctrl[0]->ctrl != NULL)
+        {
+             wpa_ctrl_close(g_lynq_wpa_ctrl[0]->ctrl);
+        }
+        free(g_lynq_wpa_ctrl[0]);
+        g_lynq_wpa_ctrl[0] = NULL;
+    }
+
+    if ( g_lynq_wpa_ctrl[1] != NULL )
+    {
+        if( g_lynq_wpa_ctrl[1]->ctrl != NULL )
+        {
+            wpa_ctrl_close(g_lynq_wpa_ctrl[1]->ctrl);
+        }
+        free(g_lynq_wpa_ctrl[1]);
+        g_lynq_wpa_ctrl[1] = NULL;
+    }
     if (g_ap_tmp_watcher_pid != 0)
         pthread_join(g_ap_tmp_watcher_pid, NULL);
     g_ap_watcher_pid = 0;
     g_sta_watcher_pid = 0;
     g_sta_auto_watcher_pid = 0;
 //    g_ap_tmp_watcher_pid = 0;
-    g_lynq_wpa_ctrl[0] = NULL;
-    g_lynq_wpa_ctrl[1] = NULL;
     g_history_disconnect_valid_num = 0;   //clean history_disconenct_list info
     system("systemctl stop wg870_drv_insmod.service");
     pthread_mutex_unlock(&s_check_wpa_ctrl_mutex);
diff --git a/IC_src/mtk/packages/apps/lynq-log-transfer/lynq_inner_log_transfer.sh b/IC_src/mtk/packages/apps/lynq-log-transfer/lynq_inner_log_transfer.sh
index 1a8a462..189ab5c 100755
--- a/IC_src/mtk/packages/apps/lynq-log-transfer/lynq_inner_log_transfer.sh
+++ b/IC_src/mtk/packages/apps/lynq-log-transfer/lynq_inner_log_transfer.sh
@@ -129,7 +129,6 @@
 q_max_size_uci=""
 
 
-
 TAR_CMD="gzip"
 TAR_ARG=" -f"
 TAR_EXT="gz"
@@ -146,6 +145,78 @@
     mkdir -p ${CONTROL_FILE_PATH}
 fi
 
+#gpslog transfer to soc begin@cz.li,20240314
+GPS_LOG_PATH="${TMP_LOG_PATH}gps/"
+GPS_COF_PATH="/etc/gnss/mnl.prop"
+EXIST_GPS_NUM=0
+EXIST_GPS_NUM_MAX=180
+GPS_LOG_DEL=$(($EXIST_GPS_NUM_MAX/2))
+
+function get_gpslog_del_num()
+{	
+    if [ $1 -lt $((${2}/2)) ]; then
+        GPS_LOG_DEL=$((${1}+${2}/2))
+    else
+	    GPS_LOG_DEL=$((${1}-${2}/2))
+    fi
+}
+
+function do_gpslog_num_plus()
+{
+    ((EXIST_GPS_NUM++))
+    if [ $EXIST_GPS_NUM -gt $EXIST_GPS_NUM_MAX ]; then
+        EXIST_GPS_NUM=0
+    fi
+}
+
+function do_gps_log_transfer()
+{
+    cd ${GPS_LOG_PATH}
+    gpslog_prefix="gpslog"
+    for file_name in *."$1"; do 
+        gps_new_file_name=${gpslog_prefix}_${EXIST_GPS_NUM}.$1    
+        if [ -e "$file_name" ]; then        		   
+            mv $file_name $GPS_LOG_PATH${gps_new_file_name}
+            get_gpslog_del_num $EXIST_GPS_NUM $EXIST_GPS_NUM_MAX
+            ftp_delete_file ${gpslog_prefix}_${GPS_LOG_DEL}.$TAR_EXT
+            ftp_transfer_file_then_delete ${gps_new_file_name}    1 
+            do_gpslog_num_plus     
+        else
+            break;
+        fi    
+    done     
+}
+
+function gps_init_conf()
+{
+    echo "debug.dbg2file=1" > $GPS_COF_PATH
+    echo "debug.filename=${GPS_LOG_PATH}gpsdebug.log" >> $GPS_COF_PATH
+    echo "DBGLOG_FILE_MAX=5242880" >> $GPS_COF_PATH
+    echo "DBGLOG_FOLDER_MAX=10485760" >> $GPS_COF_PATH
+}
+
+function init_gpslog()
+{
+    target="DBGLOG_FILE_MAX=5242880"
+    sign=0
+    if [ ! -e ${GPS_COF_PATH} ]; then
+        gps_init_conf
+    else
+    while IFS= read -r line || [ -n "$line" ]; do
+        if [[ $line == *"$target"* ]]; then
+            sign=1
+            break
+        fi
+    done < ${GPS_COF_PATH}
+
+        if [ $sign -eq 0 ]; then
+            gps_init_conf
+            echo_debug_info "gps log file size is changed  to 5M" 
+        fi
+    fi
+}
+#gpslog transfer to soc end@cz.li,20240314
+
 function clear_relative_tag()
 {      
     length=${#transfer_log_tag[@]}
@@ -154,7 +225,10 @@
     do
         if [ ${transfer_log_tag[$i]} -eq 1 ]; then                       
             if [ $i -eq 0 ]; then              
-                rm -rf $SYS_LOG_PATH$log_prefix*                    
+                rm -rf $SYS_LOG_PATH$log_prefix* 
+                #gpslog transfer to soc begin@cz.li,20240314
+                rm -rf ${GPS_LOG_PATH}     
+                #gpslog transfer to soc end@cz.li,20240314            
             elif [ $i -eq 1 ]; then
                 echo 7 | emdlogger_ctrl        
                 rm -rf $MTK_LOG_PATH*
@@ -477,7 +551,13 @@
 {
     if [ $1 -eq 0 ]; then        
         do_sys_log_transfer "syslog.log"
-        echo "" > ${SYS_LOG_PATH}/syslog.log 
+        echo "" > ${SYS_LOG_PATH}/syslog.log
+        #gpslog transfer to soc begin@cz.li,20240314
+        if [ -d ${GPS_LOG_PATH} ]; then
+            do_gps_log_transfer "nma" 
+            do_gps_log_transfer "curf" 
+        fi
+        #gpslog transfer to soc end@cz.li,20240314
     elif [ $1 -eq 1 ]; 
     then
         do_mtk_log_transfer "muxz"
@@ -489,12 +569,15 @@
     fi    
 }
 
-
-
 function do_log_transfer()
 {
-    if [ $1 -eq 0 ]; then        
+    if [ $1 -eq 0 ]; then
         do_sys_log_transfer
+        #gpslog transfer to soc begin@cz.li,20240314
+        if [ -d ${GPS_LOG_PATH} ]; then 
+            do_gps_log_transfer "nma"
+        fi
+        #gpslog transfer to soc end@cz.li,20240314
     elif [ $1 -eq 1 ]; 
     then
         do_mtk_log_transfer "muxz"
@@ -635,7 +718,11 @@
 
 function loop_prepare()
 {
-    if [ $1 -eq 1 ]; then
+    #gpslog transfer to soc begin@cz.li,20240314
+    if [ $1 -eq 0 ]; then
+        init_gpslog
+    #gpslog transfer to soc end@cz.li,20240314
+    elif [ $1 -eq 1 ]; then
         echo 6 | emdlogger_ctrl
         if [ $? -ne 0 ]; then 
             echo_debug_info "start mtk log fail"
@@ -698,8 +785,12 @@
     if [ -e ${WAIT_TRANSFER_REMAIN_LOG[$index]} ]; then                
         exit_process $((ERROR_IS_IN_TRANSFER_LOG+${index}*5+2 ))
     fi          
-    
-    if [ $index -eq 1 ]; then
+    #gpslog transfer to soc begin@cz.li,20240314
+    if [ $index -eq 0 ]; then
+        #Because the GPS process cannot dynamically stop log output,${GPS_LOG_PATH} needs to be deleted in order to exit the log
+        rm -rf ${GPS_LOG_PATH}
+    #gpslog transfer to soc end@cz.li,20240314
+    elif [ $index -eq 1 ]; then
         echo 7 | emdlogger_ctrl
     elif [ $index -eq 2 ]; then
         show_relative_tag
@@ -733,7 +824,7 @@
 {
     index=$2
     if [ $index -eq 1 ]; then
-        #Æô¶¯debug
+        # activate  debug
         trigger_log_transfer 3  
         init_md_log
     fi	
diff --git a/IC_src/mtk/telephonyware/3.0/atcid/atci/src/Makefile b/IC_src/mtk/telephonyware/3.0/atcid/atci/src/Makefile
index 77f997a..7a5d595 100755
--- a/IC_src/mtk/telephonyware/3.0/atcid/atci/src/Makefile
+++ b/IC_src/mtk/telephonyware/3.0/atcid/atci/src/Makefile
@@ -7,6 +7,10 @@
     FLAGS += -DLYNQ_ATSVC 
 endif
 
+ifeq ($(strip $(MOBILETEK_ATCID_CFG)), WOM)
+    FLAGS += -DCONFIG_WOM_ATCID
+endif
+
 INCLUDES := -I. \
          -I./platform \
          -I./lynq-private \
diff --git a/IC_src/mtk/telephonyware/3.0/atcid/atci/src/atcid.c b/IC_src/mtk/telephonyware/3.0/atcid/atci/src/atcid.c
index 0eaff4f..54f1c5e 100755
--- a/IC_src/mtk/telephonyware/3.0/atcid/atci/src/atcid.c
+++ b/IC_src/mtk/telephonyware/3.0/atcid/atci/src/atcid.c
@@ -94,6 +94,27 @@
         listenVCOM = 1;
     }
 #else
+#ifdef CONFIG_WOM_ATCID
+    /*dongyu@2023.5.2 VCOM port as AT port in WOM platform meta mode, ELT port as AT port in normal mode start*/
+    snprintf(serial.devicename[0], strlen(TTY_GS0) + 1, "%s", TTY_GS0);
+    int listenVCOM = 1;
+    int bootMode = readSys_int(BOOTMODE_PATH);
+
+    LOGATCI(LOG_INFO, "bootMode = %d", bootMode);
+
+    if(bootMode == META_BOOT)
+    {
+        LOGATCI(LOG_INFO, "meta mode for CPE/ IVT, listen VCOM");
+        listenVCOM = 0;
+    }
+    else if(bootMode == NORMAL_BOOT)
+    {
+        LOGATCI(LOG_INFO, "normal mode for CPE/ IVT, listen ELT");
+        snprintf(serial.devicename[0], strlen(TTY_GS3) + 1, "%s", TTY_GS3);
+        listenVCOM = 1;
+    }
+    /*dongyu@2023.4.2 VCOM port as AT port in WOM platform meta mode, ELT port as AT port in normal mode end*/
+#else
     //for CPE / IVT listen TTYGS0
     snprintf(serial.devicename[0], strlen(TTY_GS0) + 1, "%s", TTY_GS0);
     int listenVCOM = 1; //listen ETS port as default
@@ -106,6 +127,7 @@
         listenVCOM = 0;
     }
 #endif
+#endif
 
     if (listenVCOM == 1) {
         for (i = 0; i < MAX_DEVICE_VCOM_NUM; i++) {
diff --git a/IC_src/mtk/telephonyware/3.0/atcid/atci/src/lynq-private/lynq_atsvc_plugin.xml b/IC_src/mtk/telephonyware/3.0/atcid/atci/src/lynq-private/lynq_atsvc_plugin.xml
index 3cdb250..ddb6a95 100755
--- a/IC_src/mtk/telephonyware/3.0/atcid/atci/src/lynq-private/lynq_atsvc_plugin.xml
+++ b/IC_src/mtk/telephonyware/3.0/atcid/atci/src/lynq-private/lynq_atsvc_plugin.xml
@@ -6,7 +6,7 @@
   />
   <module name="/lib64/liblynq-gnss.so"
                  register="lynq_register_gnss"
-                 cmd="AT+CGPS;AT+CGPSNMEA"
+                 cmd="AT+CGPS;AT+CGPSNMEA;AT+CGPSINFO"
   />
   <module name="/lib64/liblynq-at-common.so"
                  register="lynq_register_at_common"
@@ -16,4 +16,8 @@
                  register="lynq_register_at_factory"
                  cmd="AT+LYNQFACTORY"
   />
+  <module name="/lib64/liblynq-at-fota.so"
+                 register="lynq_register_fota"
+                 cmd="AT+FOTA;AT+LYNQFOTA"
+  />
 </lynq_atsvc_plugin>
\ No newline at end of file
diff --git a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp
index 24aa3ad..d937316 100755
--- a/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp
+++ b/IC_src/mtk/telephonyware/3.0/hardware/ril/fusion/libril/rilmipc/telephony/data/RpDataController.cpp
@@ -1651,10 +1651,10 @@
             case -4: return PDP_FAIL_PREF_RADIO_TECH_CHANGED;
             case -5: return PDP_FAIL_RADIO_POWER_OFF;
             case -6: return PDP_FAIL_TETHERED_CALL_ACTIVE;
-            default: return PDP_FAIL_ERROR_UNSPECIFIED;
+            default: return (RIL_DataCallFailCause)cause;
         }
     } else {
-        return PDP_FAIL_ERROR_UNSPECIFIED;
+        return (RIL_DataCallFailCause)cause;
     }
 }