Merge "[Bugfix][T106][bug-view-134] Add log for sending buffer fill issue"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
index a3df67f..f4e38fc 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
@@ -1,68 +1,48 @@
 inherit externalsrc package systemd
 
 DESCRIPTION = "autosuspend.service"
+LICENSE = "CLOSED"
 
-LICENSE = "MobileTekProprietary"
 LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=44d8d2b6296ca24bcd4894bb7155bf27"
+DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg liblynq-sim"
 
-SRC_URI = "file://autosuspend.c file://LICENSE \
-           file://autosuspend.h \
-           file://autosuspend_ops.h \
-           file://autosuspend_wakeup_count.c \
-           file://main.c \
-           file://autosuspend.service \
-           file://lynq-autosuspend.sh \
-           file://makefile \
-"
-
+WORKONSRC = "${TOPDIR}/../src/lynq/framework/lynq-autosuspend"
+FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/framework/:"
+SRC_URI = " \
+          file://lynq-autosuspend \
+          "
+SRC-DIR = "${S}/../lynq-autosuspend"
 EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
-
-LOCAL_C_INCLUDES = "-I. "
-
-DEPENDS = "liblynq-log liblynq-uci"
-DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg liblynq-sim"
-LOCAL_LIBS = "-L. -ldl -lstdc++ -lpthread -llog"
-SOURCES = "$(wildcard *.c )"
-
-OBJECTS = "$(SOURCES:.c=.o)"
-
-EXECUTABLE = "autosuspend"
-S = "${WORKDIR}"
-TARGET_CC_ARCH += "${LDFLAGS}"
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE_${PN} = "autosuspend.service"
 FILES_${PN} += "${systemd_unitdir}/system/autosuspend.service"
+
 #INHIBIT_PACKAGE_STRIP = "1"
 do_compile () {
 
 	#${CXX} -Wall ${LOCAL_C_INCLUDES} autosuspend.c autosuspend_wakeup_count.c main.c ${LOCAL_LIBS} -o ${EXECUTABLE}
 	if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
-		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
+		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
 	else
-		oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
+		oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
 	fi
 }
 
 do_install() {
 	install -d ${D}${bindir}/
-	echo "Installing image PN ${PN}"
-	echo "Installing image systemd_unitdir ${systemd_unitdir}"
-	echo "Installing image D ${D}"
-	echo "Installing image B ${B}"
+	install -m 0755 ${SRC-DIR}/autosuspend ${D}${bindir}/
 	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
 		install -d ${D}${systemd_unitdir}/system/
 		install -m 0644 ${B}/autosuspend.service ${D}${systemd_unitdir}/system
-    else
+        else
 		install -d ${D}${sysconfdir}/init.d
-        install -m 0755  ${S}/lynq-autosuspend.sh ${D}${sysconfdir}/init.d/
-        install -d ${D}${sysconfdir}/rcS.d
-        ln -s ../init.d/lynq-autosuspend.sh ${D}${sysconfdir}/rcS.d/S82lynq-autosuspend-service
+        	install -m 0755  ${SRC-DIR}/lynq-autosuspend.sh ${D}${sysconfdir}/init.d/
+        	install -d ${D}${sysconfdir}/rcS.d
+        	ln -s ../init.d/lynq-autosuspend.sh ${D}${sysconfdir}/rcS.d/S82lynq-autosuspend-service
 	fi
 
-	install -m 0755 ${S}/autosuspend ${D}${bindir}/
-	install -d ${D}${includedir}
 }
 
 
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
index ef22244..49e7188 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
@@ -156,7 +156,7 @@
 CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
-# CONFIG_SHMEM is not set
+CONFIG_SHMEM=y
 CONFIG_AIO=y
 CONFIG_IO_URING=y
 CONFIG_ADVISE_SYSCALLS=y
@@ -2491,6 +2491,10 @@
 # CONFIG_PROC_CHILDREN is not set
 CONFIG_KERNFS=y
 CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_TMPFS_XATTR=y
+CONFIG_MEMFD_CREATE=y
 # CONFIG_CONFIGFS_FS is not set
 # end of Pseudo filesystems
 
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/LICENSE b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/LICENSE
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/LICENSE
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/LICENSE
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.c b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend.c
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.c
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend.c
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.h b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend.h
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.h
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend.h
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.service b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend.service
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend.service
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend.service
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_ops.h b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend_ops.h
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_ops.h
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend_ops.h
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend_wakeup_count.c
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/autosuspend_wakeup_count.c
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/lynq-autosuspend.sh b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/lynq-autosuspend.sh
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/lynq-autosuspend.sh
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/lynq-autosuspend.sh
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/main.c b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/main.c
similarity index 100%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/main.c
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/main.c
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/makefile
similarity index 94%
rename from cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
rename to cap/zx297520v3/src/lynq/framework/lynq-autosuspend/makefile
index ca263bf..7878aff 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
+++ b/cap/zx297520v3/src/lynq/framework/lynq-autosuspend/makefile
@@ -34,7 +34,9 @@
 LOCAL_PATH   = .
 
 LOCAL_C_INCLUDES = \
-  -I.   -I$(ROOT)$(includedir)/liblog -I$(ROOT)$(includedir) \
+  -I.   \
+  -I$(ROOT)$(includedir)/liblog \
+  -I$(ROOT)$(includedir) \
 
 
 
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp
index 877afb9..f3cb0bf 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp
@@ -18,6 +18,14 @@
 static lynq_wifi_event_handle_sta wifi_event_handle_sta = NULL;
 static void *global_arg = NULL;
 static int wifi_enable_flag = WIFI_ENABLE_FLAG_DEFAULT;
+static bool lynq_wifi_enable = false;
+#define WIFI_ENABLE_JUDGE() do{ \
+    if(lynq_wifi_enable == false) \
+    { \
+        LYINFLOG("[%s ] wifi not enable\n", __func__); \
+        return -1;  \
+    } \
+}while (0);
 
 /********************************************************************
 * @brief: lynq_to_sc_auth_mode, The encryption mode of wifi is changed from api to platform
@@ -396,6 +404,7 @@
 *********************************************************************/
 int qser_wifi_work_mode_set(lynq_wifi_work_mode_e type)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_work_mode_e mode;
     ret = sc_wifi_work_mode_get(&mode);
@@ -428,6 +437,7 @@
 *********************************************************************/
 int qser_wifi_work_mode_get(lynq_wifi_work_mode_e *type)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_work_mode_e mode;
     ret = sc_wifi_work_mode_get(&mode);
@@ -478,6 +488,11 @@
 *********************************************************************/
 int qser_wifi_enable(void)
 {
+    if(lynq_wifi_enable)
+    {
+        LYERRLOG("[%s ] The wifi is enabled\n", __func__);
+        return -1;
+    }
     wifi_enable_flag = WIFI_ENABLE_FLAG_DEFAULT;
     char wifiAvailable[8] = {0};
     sc_cfg_get("wifiAvailable", wifiAvailable, sizeof(wifiAvailable));
@@ -571,7 +586,17 @@
         ret = -1;
         break;
     }
-    LYINFLOG("[%s ]\n", __func__);
+    LYINFLOG("[%s ] ret = %d\n", __func__,ret);
+    if(ret != 0)
+    {
+        int ret_uninit = sc_wifi_uninit();
+        if (0 != ret_uninit)
+        {
+            LYERRLOG("[%s ] uninit ret = %d\n", __func__,ret_uninit);
+        }
+    }
+    else
+        lynq_wifi_enable = true;
     return ret;
 }
 
@@ -586,6 +611,11 @@
 {
     int ret = -1;
     wifi_enable_flag = WIFI_ENABLE_FLAG_DEFAULT;
+    if(lynq_wifi_enable == false)
+    {
+        LYERRLOG("[%s ] WiFi not turned on\n", __func__);
+        return -1;
+    }
     ret = sc_wifi_disable();
     if (0 != ret)
     {
@@ -622,6 +652,7 @@
         LYERRLOG("[%s ] disable ret = %d\n", __func__,ret);
         return ret;
     }
+    lynq_wifi_enable = false;
     ret = sc_wifi_uninit();
     if (0 != ret)
     {
@@ -642,6 +673,7 @@
 *********************************************************************/
 int qser_wifi_ap_get_status(lynq_wifi_ap_index_e idx, lynq_wifi_ap_status_t *ap_stat)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_status_t stat;
     ret = sc_wifi_ap_get_status((sc_wifi_ap_index_e)idx, &stat);
@@ -669,6 +701,7 @@
 *********************************************************************/
 int  qser_wifi_ap_acl_set(lynq_wifi_ap_index_e idx, lynq_wifi_mac_acl_rule_e acl_rule, char *mac_list)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     if (mac_list == NULL)
     {
@@ -699,6 +732,7 @@
 *********************************************************************/
 int  qser_wifi_ap_acl_get(lynq_wifi_ap_index_e idx, lynq_wifi_mac_acl_rule_e *acl_rule, char *mac_list)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (mac_list == NULL || acl_rule == NULL)
@@ -729,6 +763,7 @@
 *********************************************************************/
 int  qser_wifi_ap_ssid_set(lynq_wifi_ap_index_e idx, const char *ssid)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     if (ssid == NULL)
     {
@@ -756,6 +791,7 @@
 *********************************************************************/
 int  qser_wifi_ap_ssid_get(lynq_wifi_ap_index_e idx, char *ssid)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, &param);
@@ -780,6 +816,7 @@
 *********************************************************************/
 int  qser_wifi_ap_ssid_hide_set(lynq_wifi_ap_index_e idx, bool hide)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_ssid_hidden_set((sc_wifi_ap_index_e)idx, (int)hide);
     if (0 != ret)
@@ -802,6 +839,7 @@
 *********************************************************************/
 int  qser_wifi_ap_ssid_hide_get(lynq_wifi_ap_index_e idx, bool *hide)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (hide == NULL)
@@ -831,6 +869,7 @@
 *********************************************************************/
 int  qser_wifi_ap_mode_set(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e mode)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_mode_set((sc_wifi_ap_index_e)idx, lynq_to_sc_mode(mode));
     if (0 != ret)
@@ -853,6 +892,7 @@
 *********************************************************************/
 int  qser_wifi_ap_mode_get(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e *mode)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (mode == NULL)
@@ -882,6 +922,7 @@
 *********************************************************************/
 int  qser_wifi_ap_bandwidth_set(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e bandwidth)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_bandwidth_set((sc_wifi_ap_index_e)idx, (sc_wifi_bandwidth_e)bandwidth);
     if (0 != ret)
@@ -904,6 +945,7 @@
 *********************************************************************/
 int  qser_wifi_ap_bandwidth_get(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e *bandwidth)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (bandwidth == NULL)
@@ -934,6 +976,7 @@
 *********************************************************************/
 int  qser_wifi_ap_channel_set(lynq_wifi_ap_index_e idx, const char *country_code, int channel)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     if (country_code == NULL)
     {
@@ -962,6 +1005,7 @@
 *********************************************************************/
 int  qser_wifi_ap_channel_get(lynq_wifi_ap_index_e idx, char *country_code, int *channel)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (country_code == NULL || channel == NULL)
@@ -993,6 +1037,7 @@
 *********************************************************************/
 int qser_wifi_ap_auth_set(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e auth_mode, const char *auth_passwd)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     if (auth_passwd == NULL)
     {
@@ -1025,6 +1070,7 @@
 *********************************************************************/
 int qser_wifi_ap_auth_get(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e *auth_mode, char *auth_passwd)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (auth_mode == NULL || auth_passwd == NULL)
@@ -1056,6 +1102,7 @@
 *********************************************************************/
 int qser_wifi_ap_auth_get_s(lynq_wifi_ap_index_e idx, lynq_wifi_ap_auth_t *auth_mode)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (auth_mode == NULL)
@@ -1088,6 +1135,7 @@
 *********************************************************************/
 int  qser_wifi_ap_max_sta_set(lynq_wifi_ap_index_e idx, int max_sta_num)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_max_sta_num_set((sc_wifi_ap_index_e)idx, max_sta_num);
     if (0 != ret)
@@ -1110,6 +1158,7 @@
 *********************************************************************/
 int  qser_wifi_ap_max_sta_get(lynq_wifi_ap_index_e idx, int *max_sta_num)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_ap_param_t param = {0};
     if (max_sta_num == NULL)
@@ -1138,6 +1187,7 @@
 *********************************************************************/
 int qser_wifi_lanhost_get_list(lynq_lanhost_ts *lynq_arrays)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     int i = 0;
     sc_lanhost_t array[32] = {0};
@@ -1178,6 +1228,7 @@
 *********************************************************************/
 int qser_wifi_get_ap_pkt_stats(lynq_wifi_ap_index_e idx, lynq_wifi_pkt_stats_t *pkt_stat)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_pkt_stats_t stat = {0};
     if (pkt_stat == NULL)
@@ -1216,6 +1267,7 @@
 *********************************************************************/
 int  qser_wifi_ap_start(lynq_wifi_ap_index_e idx)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_start((sc_wifi_ap_index_e)idx);
     if (0 != ret)
@@ -1237,6 +1289,7 @@
 *********************************************************************/
 int  qser_wifi_ap_stop(lynq_wifi_ap_index_e idx)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_stop((sc_wifi_ap_index_e)idx);
     if (0 != ret)
@@ -1258,6 +1311,7 @@
 *********************************************************************/
 int  qser_wifi_ap_restart(lynq_wifi_ap_index_e idx)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_ap_stop((sc_wifi_ap_index_e)idx);
     if (0 != ret)
@@ -1285,6 +1339,7 @@
 *********************************************************************/
 int  qser_wifi_sta_param_set(lynq_wifi_sta_param_t *param_stat)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_sta_param_t stat = {0};
     stat.auth = lynq_to_sc_auth_mode(param_stat->auth);
@@ -1311,6 +1366,7 @@
 *********************************************************************/
 int  qser_wifi_sta_param_get(lynq_wifi_sta_param_t *param_stat)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_sta_param_t stat = {0};
     ret = sc_wifi_sta_param_get(&stat);
@@ -1337,6 +1393,7 @@
 *********************************************************************/
 int qser_wifi_sta_get_status(lynq_wifi_sta_status_t *status_stat)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_sta_status_t stat;
     ret = sc_wifi_sta_get_status(&stat);
@@ -1361,6 +1418,7 @@
 *********************************************************************/
 int qser_wifi_get_sta_pkt_stats(lynq_wifi_pkt_stats_t *pkt_stat)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     sc_wifi_pkt_stats_t stat = {0};
     if (pkt_stat == NULL)
@@ -1397,6 +1455,7 @@
 *********************************************************************/
 int  qser_wifi_sta_start_scan(void)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_sta_start_scan();
     if (0 != ret)
@@ -1417,6 +1476,7 @@
 *********************************************************************/
 int  qser_wifi_sta_start(void)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_sta_start();
     if (0 != ret)
@@ -1437,6 +1497,7 @@
 *********************************************************************/
 int  qser_wifi_sta_stop(void)
 {
+    WIFI_ENABLE_JUDGE();
     int ret = -1;
     ret = sc_wifi_sta_stop();
     if (0 != ret)