[Feature][ZXW-130]merge P50U02 version

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I4f29ec5bb7c59385f23738d2b7ca84e67c100f69
diff --git a/ap/app/include/audio_res_ctrl.h b/ap/app/include/audio_res_ctrl.h
index 74914a3..e36ffeb 100755
--- a/ap/app/include/audio_res_ctrl.h
+++ b/ap/app/include/audio_res_ctrl.h
@@ -42,7 +42,8 @@
 	USE_AUDIO_RSP,      //ÏûÏ¢µÚÒ»¸ö²ÎÊýָʾÉêÇë³É¹¦»¹ÊÇʧ°Ü£¬µÚ¶þ¸ö²ÎÊýָʾµ±Ç°Ê¹ÓõÄÒµÎñ
 	REL_AUDIO_REQ,      //¹©Ö÷¿ØÇëÇóijҵÎñÄ£¿éÊÍ·ÅÕýÔÚ½øÐеÄAUDIOʹÓÃȨ
 	REL_AUDIO_IND,      //ÇëÇóijҵÎñÄ£¿éÊÍ·ÅaudioµÄ½á¹ûÓ¦´ð£¬Èôʧ°Ü£¬¶ÏÑÔ£»»»ÑÔÖ®£¬±ØÐë³É¹¦
-	IDLE_AUDIO_INFO     //Ö÷¿ØÍ¨ÖªËùÓÐÉêÇë¹ýAUDIO×ÊÔ´µÄÒµÎñÄ£¿é£¬¸æÖªµ±Ç°¿ÕÏУ¬ÒÔ½â¾öÒµÎñÄ£¿é´¦ÓÚ¹ÒÆð̬»ò֮ǰ±»Ç¿ÐÐÊͷŵÄÒµÎñÄ£¿é£¬ÈçMP3ÒôÀÖ²¥·ÅµÈ£»
+	IDLE_AUDIO_INFO,     //Ö÷¿ØÍ¨ÖªËùÓÐÉêÇë¹ýAUDIO×ÊÔ´µÄÒµÎñÄ£¿é£¬¸æÖªµ±Ç°¿ÕÏУ¬ÒÔ½â¾öÒµÎñÄ£¿é´¦ÓÚ¹ÒÆð̬»ò֮ǰ±»Ç¿ÐÐÊͷŵÄÒµÎñÄ£¿é£¬ÈçMP3ÒôÀÖ²¥·ÅµÈ£»
+	EXIT_AUDIO_IND, //֪ͨÖ÷¿Ø£¬ÒµÎñÄ£¿éÍ˳öÒôƵ×ÊÔ´¾ºÕù
 };
 
 
@@ -77,6 +78,13 @@
     int tempMouduleId;       /* ÉêÇë×ÊÔ´µÄ½ÓÊÜÏûÏ¢ÁÙʱId */
     int audioType;          /* ÒµÎñÀàÐÍ */
 }T_audio_Res_Request;
+
+typedef struct {
+	int	type;
+	int moduleId;
+} T_audio_ExitInd;
+
+
 /**
  *º¯Êý˵Ã÷£ºÇëÇóʹÓÃcodec×ÊÔ´£¬µÈ´ýcodecÖ÷¿Ø»Ø¸´         
  *@param :  Ó¦ÓÃÇëÇóµÄ²ÎÊý
diff --git a/ap/app/include/flags_api.h b/ap/app/include/flags_api.h
index 68ccdad..c779ef4 100755
--- a/ap/app/include/flags_api.h
+++ b/ap/app/include/flags_api.h
@@ -1,6 +1,6 @@
 /**
  * @file flags_api.h
- * @brief flags·ÖÇø½Ó¿Ú
+ * @brief flags分区接口
  *
  * Copyright (C) 2023 Sanechips Technology Co., Ltd.
  * @author 
@@ -8,7 +8,7 @@
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation. £¨±ØÑ¡£ºGPLv2 Licence£©
+ * published by the Free Software Foundation. (必选:GPLv2 Licence)
  *
  */
 
@@ -42,57 +42,73 @@
  *                       Global function declarations                          *
  ******************************************************************************/
 /**
- * @brief  ³õʼ»¯flags·ÖÇø
- * @param[out]  p_flags_info  flags³õʼ»¯Êý¾Ý
- * @return  0 ³õʼ»¯³É¹¦, -1 ³õʼ»¯Ê§°Ü
+ * @brief  初始化flags分区
+ * @param[out]  p_flags_info  flags初始化数据
+ * @return  0 初始化成功, -1 初始化失败
  * @note
  */
 int flags_init();
 
 
 /**
- * @brief  »ñÈ¡flags·ÖÇøÄÚÈÝ
- * @param[out]  p_flags_info  flags·ÖÇøÄÚÈÝ
- * @return  0 »ñÈ¡³É¹¦, -1 »ñȡʧ°Ü
+ * @brief  获取flags分区内容
+ * @param[out]  p_flags_info  flags分区内容
+ * @return  0 获取成功, -1 获取失败
  * @note
  */
 int flags_get(T_FLAGS_INFO *p_flags_info);
 
 
 /**
- * @brief  ÉèÖÃflags·ÖÇøÄÚÈÝ
- * @param[out]  p_flags_info  flags·ÖÇøÄÚÈÝ
- * @return  0 ÉèÖóɹ¦, -1 ÉèÖÃʧ°Ü
+ * @brief  设置flags分区内容
+ * @param[out]  p_flags_info  flags分区内容
+ * @return  0 设置成功, -1 设置失败
  * @note
  */
 int flags_set(T_FLAGS_INFO *p_flags_info);
 
 
 /**
- * @brief  »ñÈ¡flags·ÖÇøÖÐubifs״̬
- * @param[out]  status  ubifs״̬
- * @return  0 »ñÈ¡³É¹¦, -1 »ñȡʧ°Ü
+ * @brief  获取flags分区中ubifs状态
+ * @param[out]  status  ubifs状态
+ * @return  0 获取成功, -1 获取失败
  * @note
  */
 int flags_get_ubifs_status(T_UBIFS_STATUS *p_ubifs_status);
 
 
 /**
- * @brief  ÉèÖÃflags·ÖÇøÖÐubifs״̬
- * @param[in]  status  ubifs״̬
- * @return  0 ÉèÖóɹ¦, -1 ÉèÖÃʧ°Ü
+ * @brief  设置flags分区中ubifs状态
+ * @param[in]  status  ubifs状态
+ * @return  0 设置成功, -1 设置失败
  * @note
  */
 int flags_set_ubifs_status(T_UBIFS_STATUS *p_ubifs_status);
 
 
 /**
- * @brief  »ñÈ¡µ±Ç°ÏµÍ³
- * @return  µ±Ç°ÔËÐÐϵͳ
+ * @brief  获取当前系统
+ * @return  当前运行系统
  * @note
  */
 int flags_get_current_system();
 
+/**
+ * @brief  »ñÈ¡flags·ÖÇøÖÐnvro_flag״̬
+ * @param[out]  
+ * @return  nvro_flag
+ * @note
+ */
+unsigned int flags_get_nvroflag(void);
+
+/**
+ * @brief  ÉèÖÃflags·ÖÇøÖÐnvro_flag
+ * @param[in]  flag nvro״̬
+ * @return  0 ÉèÖóɹ¦, -1 ÉèÖÃʧ°Ü
+ * @note
+ */
+int flags_set_nvroflag(unsigned int flag);
+
 
 #endif // FLAGS_API_H
 
diff --git a/ap/app/include/libcpnv.h b/ap/app/include/libcpnv.h
index 9eac4c1..f2c4c30 100755
--- a/ap/app/include/libcpnv.h
+++ b/ap/app/include/libcpnv.h
@@ -112,4 +112,24 @@
  */

 unsigned int cpnv_FsGcWait(int partition_no);

 

+/**

+ * @brief  nvro备份

+ * @param  无

+ * @return CPNV_OK 成功,CPNV_ERROR 失败

+ * @retval

+ * @note

+ * @warning nvrofs里nvroall.bin备份到nvrofs2

+ */

+unsigned int cpnv_NvroBackup(void);

+

+/**

+ * @brief  nvro恢复

+ * @param  无

+ * @return CPNV_OK 成功,CPNV_ERROR 失败

+ * @retval

+ * @note

+ * @warning nvrofs2里nvroall.bin恢复到nvrofs

+ */

+unsigned int cpnv_NvroRestore(void);

+

 #endif // __LIBCPNV_H

diff --git a/ap/app/include/netotherapi.h b/ap/app/include/netotherapi.h
index fcf872d..b953458 100755
--- a/ap/app/include/netotherapi.h
+++ b/ap/app/include/netotherapi.h
@@ -249,6 +249,8 @@
 */
 unsigned long gethostbyname_l(char *hostname,char* dev_name);
 
+int gethostbyname6_l(char *hostname,char* dev_name, struct in6_addr* ip6);
+
 #endif
 
 #endif /* __NETOTHERAPI_H__ */
diff --git a/ap/app/include/wifi_msg.h b/ap/app/include/wifi_msg.h
index 83ae376..4f7b354 100755
--- a/ap/app/include/wifi_msg.h
+++ b/ap/app/include/wifi_msg.h
@@ -677,12 +677,17 @@
 
 #define CAP_WIFI_MAX_SCAN_CNT 30
 
-#define CAP_WIFI_AUTH_UNSUP -1 //"not support");
-#define CAP_WIFI_AUTH_OPEN 0 //"OPEN");
-#define CAP_WIFI_AUTH_WPA2 1 //"WPA2PSK");
-#define CAP_WIFI_AUTH_WPA3 2 //"WPA3Personal");
-#define CAP_WIFI_AUTH_WPA12 3 //"WPAPSKWPA2PSK");
-#define CAP_WIFI_AUTH_WPA23 4 //"WPA2WPA3");
+#define CAP_WIFI_AUTH_UNSUP -1 //"not support"
+#define CAP_WIFI_AUTH_OPEN 0 //"OPEN"
+#define CAP_WIFI_AUTH_WPA2 1 //"WPA2PSK"
+#define CAP_WIFI_AUTH_WPA3 2 //"WPA3Personal"
+#define CAP_WIFI_AUTH_WPA12 3 //"WPAPSKWPA2PSK"
+#define CAP_WIFI_AUTH_WPA23 4 //"WPA2WPA3"
+
+#define CAP_WIFI_ENCRYPT_UNSUP -1 //"not support"
+#define CAP_WIFI_ENCRYPT_AUTO 0 //"TKIPCCMP"
+#define CAP_WIFI_ENCRYPT_TKIP 1 //"TKIP"
+#define CAP_WIFI_ENCRYPT_AES 2 //"CCMP"
 
 //sc_wifi_sta_scan_info_t
 typedef struct
@@ -694,6 +699,7 @@
 	//int frequency;
 	unsigned char channel; //1-13
 	unsigned char auth;
+	unsigned char cipher;
 } wlan_sta_scan_info_t;
 
 //sc_wifi_sta_scan_list_t