diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
index c289c0f..c116e65 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
@@ -35,6 +35,20 @@
     }
 }
 
+static void print_lynq_lanhost_t(lynq_lanhost_ts lynq_arrays) 
+{
+	int i = 0;
+	for (i = 0; i < lynq_arrays.array_len; i++) {
+		printf("Element %d:\n", i);
+		printf("addr: %s\n", lynq_arrays.array[i].addr);
+		printf("macaddr: %s\n", lynq_arrays.array[i].macaddr);
+		printf("name: %s\n", lynq_arrays.array[i].name);
+		printf("ifname: %s\n", lynq_arrays.array[i].ifname);
+		printf("uptime: %d\n", lynq_arrays.array[i].uptime);
+		printf("\n");
+	}
+}
+
 int main(int argc, char *argv[])
 {
     lynq_wifi_ap_index_e type;
@@ -94,6 +108,7 @@
             lynq_wifi_work_mode_e work_type;
             lynq_wifi_ap_status_t stat = {0};
             lynq_wifi_sta_status_t status_stat = {0};
+            lynq_wifi_pkt_stats_t pkt_stat = {0};
             lynq_wifi_bandwidth_type_e bandwidth;
             int ret = -1;
             qser_wifi_enable();                      // enable wifi
@@ -120,18 +135,47 @@
             ret = qser_wifi_sta_get_status(&status_stat); // Gets the status value associated with sta
             printf("[lynq-wifi-demo]  status = %d ifname = %s ap_bssid = %s signal_level = %d reason_code = %d\n", status_stat.status, status_stat.ifname, status_stat.ap_bssid, status_stat.signal_level, status_stat.reason_code);
             if (status_stat.has_addr == 1)
-                printf("[lynq-wifi-demo]addr inet_ntop: %s\n", status_stat.addr);
+                printf("[lynq-wifi-demo]addr ip:%s, netmask:%s, subnet_bits:%d, gateway:%s, dnsp:%s, dnss:%s\n",
+                       status_stat.addr.addr, status_stat.addr.netmask, status_stat.addr.subnet_bits,
+                       status_stat.addr.gateway, status_stat.addr.dnsp, status_stat.addr.dnss);
             if (status_stat.has_addr6 == 1)
-                printf("[lynq-wifi-demo]addr6 inet_ntop: %s\n", status_stat.addr6);
+                printf("[lynq-wifi-demo]addr6 ip:%s, prefix:%s, prefix_bits:%d, gateway:%s, dnsp:%s, dnss:%s\n",
+                       status_stat.addr6.addr, status_stat.addr6.prefix, status_stat.addr6.prefix_bits,
+                       status_stat.addr6.gateway, status_stat.addr6.dnsp, status_stat.addr6.dnss);
+            ret = qser_wifi_get_ap_pkt_stats(type, &pkt_stat); // Obtain data packets sent and received by ap
+            printf("[lynq-wifi-demo]ap_pkt_get rx[%llu, %llu, %llu, %llu] tx[%llu, %llu, %llu, %llu] ret=%d\n",
+                   pkt_stat.rx_packets, pkt_stat.rx_bytes, pkt_stat.rx_errors, pkt_stat.rx_dropped,
+                   pkt_stat.tx_packets, pkt_stat.tx_bytes, pkt_stat.tx_errors, pkt_stat.tx_dropped, ret);
         }
         else if (strcmp(argv[1], "3") == 0) //Enable the callback query only when WiFi is used as an ap
         {
+            int ret = -1;
+            int args = 3;       // enable ap_sta callback
             qser_wifi_enable(); // enable wifi
-            int args = 3; //enable ap_sta callback
             qser_wifi_register_handle(lynq_wifi_event_handle_demo, NULL, (void *)&args);
             while (1)
             {
-                sleep(1);
+                char cmdstr[128] = {0};
+                printf("[lynq-wifi-demo]Get sta device information received as an ap :ap_lanhost\n");
+                if (NULL != fgets(cmdstr, sizeof(cmdstr) - 1, stdin))
+                {
+                    if (1 >= strlen(cmdstr))
+                    {
+                        continue;
+                    }
+                    if (0 == strncmp(cmdstr, "ap_lanhost", strlen(cmdstr) - 1))
+                    {
+                        lynq_lanhost_ts ap_lanhost = {0};
+                        ret = qser_wifi_lanhost_get_list(&ap_lanhost);
+                        printf("[lynq-wifi-demo]ret = %d\n",ret);
+                        print_lynq_lanhost_t(ap_lanhost);
+                        continue;
+                    }
+                }
+                else
+                {
+                    printf("  [lynq-wifi-demo]Parameter error, please re-enter\n");
+                }
             }
         }
         else if (strcmp(argv[1], "4") == 0) //Overlay WiFi callback as ap and scan callback as sta
@@ -154,7 +198,7 @@
 
             while (1)
             {
-                printf("[lynq-wifi-demo]Enter the ssid and password as shown in the following example:ssid auth paris pw ||sta_param_get || sta_scan ||sta_stop\n");
+                printf("[lynq-wifi-demo]Enter the ssid and password as shown in the following example:ssid auth paris pw ||sta_pkt_get ||sta_param_get || sta_scan ||sta_stop\n");
                 if (NULL != fgets(cmdstr, sizeof(cmdstr) - 1, stdin))
                 {
                     if (1 >= strlen(cmdstr))
@@ -167,6 +211,15 @@
                         printf("[lynq-wifi-demo]sta_param_get[%s, %d, %d, %s] ret=%d\n", stat.ssid, stat.auth, stat.pairwise, stat.passwd, ret);
                         continue;
                     }
+                    if (0 == strncmp(cmdstr, "sta_pkt_get", strlen(cmdstr) - 1))
+                    {
+                        lynq_wifi_pkt_stats_t pkt_stat = {0};
+                        ret = qser_wifi_get_sta_pkt_stats(&pkt_stat); // Obtain data packets sent and received by ap
+                        printf("[lynq-wifi-demo]sta_pkt_get rx[%llu, %llu, %llu, %llu] tx[%llu, %llu, %llu, %llu] ret=%d\n",
+                               pkt_stat.rx_packets, pkt_stat.rx_bytes, pkt_stat.rx_errors, pkt_stat.rx_dropped,
+                               pkt_stat.tx_packets, pkt_stat.tx_bytes, pkt_stat.tx_errors, pkt_stat.tx_dropped, ret);
+                        continue;
+                    }
                     else if (0 == strncmp(cmdstr, "sta_scan", strlen(cmdstr) - 1))
                     {
                         qser_wifi_sta_start_scan(); // When this function is executed once, sta's scan is called once
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h
index 8b839fd..9f97c14 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h
@@ -174,15 +174,35 @@
 
 typedef struct
 {
+	char addr[16];
+	char netmask[16];
+	unsigned char subnet_bits; //255.255.255.0 is 24
+	char gateway[16];
+	char dnsp[16]; //primary DNS
+	char dnss[16]; //secondary DNS
+} lynq_wifi_net_addr_t;
+
+typedef struct
+{
+	char addr[48];
+	char prefix[48];
+	unsigned char prefix_bits;
+	char gateway[48];
+	char dnsp[48]; //primary DNS
+	char dnss[48]; //secondary DNS
+} lynq_wifi_net_addr6_t;
+
+typedef struct
+{
 	lynq_wifi_sta_status_e status;
 	char ifname[32];
 	char ap_bssid[18]; //cur ap mac
 	//int rssi;
 	unsigned char signal_level;
 	unsigned char has_addr;
-	char addr[48]; //(addr.s_addr)
+	lynq_wifi_net_addr_t addr; //(addr.s_addr)
 	unsigned char has_addr6;
-	char addr6[48]; //
+	lynq_wifi_net_addr6_t addr6; //
 	lynq_wifi_reason_code_e reason_code;
 } lynq_wifi_sta_status_t;
 
@@ -204,6 +224,32 @@
 	lynq_wifi_sta_scan_info_t info[LYNQ_WIFI_MAX_SCAN_INFO_CNT];
 }lynq_wifi_sta_scan_list_t;
 
+typedef struct {
+	unsigned long long	rx_packets;
+	unsigned long long	rx_bytes;
+	unsigned long long	rx_errors;
+	unsigned long long	rx_dropped;
+	unsigned long long	tx_packets;
+	unsigned long long	tx_bytes;
+	unsigned long long	tx_errors;
+	unsigned long long	tx_dropped;
+} lynq_wifi_pkt_stats_t;
+
+typedef struct
+{
+    char addr[16]; 		/**< IPV4 address format string */
+    char macaddr[18]; 	/**< MAC address, format: XX:XX:XX:XX:XX:XX */
+    char name[20]; 		/**< hostname */
+    char ifname[18]; 	/**< device name */
+    int  uptime; 		/**< online time in sec */
+} lynq_lanhost_t;
+
+typedef struct
+{
+	int array_len;
+    lynq_lanhost_t array[32];
+} lynq_lanhost_ts;
+
 typedef void (*lynq_wifi_event_handle)(lynq_wifi_event_s *event, void *arg);
 typedef void (*lynq_wifi_event_handle_sta)(lynq_wifi_sta_scan_list_t *event);
 
@@ -229,6 +275,8 @@
 int  qser_wifi_ap_auth_get_s(lynq_wifi_ap_index_e idx, lynq_wifi_ap_auth_t *auth_mode);
 int  qser_wifi_ap_max_sta_set(lynq_wifi_ap_index_e idx, int max_sta_num);
 int  qser_wifi_ap_max_sta_get(lynq_wifi_ap_index_e idx, int *max_sta_num);
+int  qser_wifi_lanhost_get_list(lynq_lanhost_ts *lynq_arrays);
+int  qser_wifi_get_ap_pkt_stats(lynq_wifi_ap_index_e idx, lynq_wifi_pkt_stats_t *pkt_stat);
 int  qser_wifi_ap_start(lynq_wifi_ap_index_e idx);
 int  qser_wifi_ap_stop(lynq_wifi_ap_index_e idx);
 int  qser_wifi_ap_restart(lynq_wifi_ap_index_e idx);
@@ -236,6 +284,7 @@
 int  qser_wifi_sta_param_set(lynq_wifi_sta_param_t *param_stat);
 int  qser_wifi_sta_param_get(lynq_wifi_sta_param_t *param_stat);
 int  qser_wifi_sta_get_status(lynq_wifi_sta_status_t *status_stat);
+int  qser_wifi_get_sta_pkt_stats(lynq_wifi_pkt_stats_t *pkt_stat);
 int  qser_wifi_sta_start_scan(void);
 int  qser_wifi_sta_start(void);
 int  qser_wifi_sta_stop(void);
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 da282c8..2b23394 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
@@ -251,34 +251,26 @@
 * @see: NA
 * @warning: NA
 *********************************************************************/
-/*
 static void print_sta_status(sc_wifi_sta_status_t *p_msg)
 {
-	LYINFLOG("%s: %d, %s, %s, %d, %d\n", __func__, p_msg->status, p_msg->ifname, p_msg->ap_bssid, 
-	p_msg->signal_level, p_msg->reason_code);
+    LYINFLOG("%s: %d, %s, %s, %d, %d\n", __func__, p_msg->status, p_msg->ifname, p_msg->ap_bssid,
+             p_msg->signal_level, p_msg->reason_code);
 
-	if (p_msg->has_addr == 1) {
-		char addrtxt[48] = {0};
-		inet_ntop(AF_INET, &p_msg->addr, addrtxt, sizeof(addrtxt));
-		LYINFLOG("%s : addr inet_ntop: %s\n", __func__, addrtxt);
+    if (p_msg->has_addr == 1)
+    {
+        LYINFLOG("[%s]addr ip:%s, netmask:%s, subnet_bits:%d, gateway:%s, dnsp:%s, dnss:%s\n", __func__,
+                 p_msg->addr.addr, p_msg->addr.netmask, p_msg->addr.subnet_bits,
+                 p_msg->addr.gateway, p_msg->addr.dnsp, p_msg->addr.dnss);
+    }
 
-		LYINFLOG("%s : addr: %08X\n", __func__, p_msg->addr.s_addr);
-	}
-
-	if (p_msg->has_addr6 == 1) {
-		char addrtxt[48] = {0};
-		inet_ntop(AF_INET6, &p_msg->addr6, addrtxt, sizeof(addrtxt));
-		LYINFLOG("%s : addr6 inet_ntop: %s\n", __func__, addrtxt);
-
-		LYINFLOG("%s : addr6: %02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X\n",__func__, 
-		p_msg->addr6.s6_addr[0], p_msg->addr6.s6_addr[1], p_msg->addr6.s6_addr[2], p_msg->addr6.s6_addr[3], 
-		p_msg->addr6.s6_addr[4], p_msg->addr6.s6_addr[5], p_msg->addr6.s6_addr[6], p_msg->addr6.s6_addr[7], 
-		p_msg->addr6.s6_addr[8], p_msg->addr6.s6_addr[9], p_msg->addr6.s6_addr[10], p_msg->addr6.s6_addr[11], 
-		p_msg->addr6.s6_addr[12], p_msg->addr6.s6_addr[13], p_msg->addr6.s6_addr[14], p_msg->addr6.s6_addr[15]);
-	}
-	LYINFLOG("%s : sta_status end\n",__func__);
+    if (p_msg->has_addr6 == 1)
+    {
+        LYINFLOG("[%s]addr6 ip:%s, prefix:%s, prefix_bits:%d, gateway:%s, dnsp:%s, dnss:%s\n", __func__,
+                 p_msg->addr6.addr, p_msg->addr6.prefix, p_msg->addr6.prefix_bits,
+                 p_msg->addr6.gateway, p_msg->addr6.dnsp, p_msg->addr6.dnss);
+    }
+    LYINFLOG("%s : sta_status end\n", __func__);
 }
-*/
 
 /********************************************************************
 * @brief: lynq_user_sta_status_ind, wifi gets the status callback in sta mode
@@ -291,7 +283,7 @@
   sc_wifi_sta_status_t *p_msg)
 {	 
 	 LYINFLOG("%s : user_sta_status_ind_cb pre:%d, cur:%d\n", __func__, pre_status, p_msg->status);
-	 //print_sta_status(p_msg);
+	 print_sta_status(p_msg);
 }
 
 /********************************************************************
@@ -1013,6 +1005,84 @@
 }
 
 /********************************************************************
+* @brief: qser_wifi_lanhost_get_list, Get sta device information received as an ap for 2.4G or 5G
+* @param lynq_arrays [OUT]: lynq_lanhost_ts *, Get sta device information received as an ap
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_lanhost_get_list(lynq_lanhost_ts *lynq_arrays)
+{
+    int ret = -1;
+    int i = 0;
+    sc_lanhost_t array[32] = {0};
+    if (lynq_arrays == NULL)
+    {
+        LYERRLOG("[%s ] Null pointer lynq_arrays = 0x%p\n", __func__, lynq_arrays);
+        return ret;
+    }
+    lynq_arrays->array_len = 32;
+    ret = ret = sc_wifi_lanhost_get_list(array, &lynq_arrays->array_len);
+    if (0 != ret)
+    {
+        LYERRLOG("[%s ] ret = %d\n", __func__, ret);
+        return ret;
+    }
+    LYINFLOG("[%s]ap_lanhost len[%d]\n", __func__, lynq_arrays->array_len);
+    for (i = 0; i < lynq_arrays->array_len; i++)
+    {
+        LYINFLOG("[%s]Element : [%d] ifname = %s  macaddr = %s addr = %s name = %s uptime = %d\n", __func__, i,
+                 array[i].ifname, array[i].macaddr, array[i].addr, array[i].name, array[i].uptime);
+        strncpy(lynq_arrays->array[i].ifname, array[i].ifname, sizeof(lynq_arrays->array[i].ifname) - 1);
+        strncpy(lynq_arrays->array[i].macaddr, array[i].macaddr, sizeof(lynq_arrays->array[i].macaddr) - 1);
+        strncpy(lynq_arrays->array[i].addr, array[i].addr, sizeof(lynq_arrays->array[i].addr) - 1);
+        strncpy(lynq_arrays->array[i].name, array[i].name, sizeof(lynq_arrays->array[i].name) - 1);
+        lynq_arrays->array[i].uptime = array[i].uptime;
+    }
+    return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_get_ap_pkt_stats, Obtain data packets sent and received by ap for 2.4G or 5G
+* @param idx [IN]: int, Set 2.4G or 5G
+* @param pkt_stat [OUT]: lynq_wifi_pkt_stats_t *, Obtain data packets sent and received by ap
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_get_ap_pkt_stats(lynq_wifi_ap_index_e idx, lynq_wifi_pkt_stats_t *pkt_stat)
+{
+    int ret = -1;
+    sc_wifi_pkt_stats_t stat = {0};
+    if (pkt_stat == NULL)
+    {
+        LYERRLOG("[%s ] Null pointer pkt_stat = 0x%p\n", __func__, pkt_stat);
+        return ret;
+    }
+    idx = LYNQ_WIFI_AP_INDEX_AP0;
+    ret = sc_wifi_get_ap_pkt_stats((sc_wifi_ap_index_e)idx, &stat);
+    if (0 != ret)
+    {
+        LYERRLOG("[%s ] ret = %d\n", __func__, ret);
+        return ret;
+    }
+    LYINFLOG("[%s ]ap_pkt_get[%d] rx[%llu, %llu, %llu, %llu] tx[%llu, %llu, %llu, %llu]\n", __func__, idx,
+             stat.rx_packets, stat.rx_bytes, stat.rx_errors, stat.rx_dropped,
+             stat.tx_packets, stat.tx_bytes, stat.tx_errors, stat.tx_dropped);
+    pkt_stat->rx_packets = stat.rx_packets;
+    pkt_stat->rx_bytes = stat.rx_bytes;
+    pkt_stat->rx_errors = stat.rx_errors;
+    pkt_stat->rx_dropped = stat.rx_dropped;
+    pkt_stat->tx_packets = stat.tx_packets;
+    pkt_stat->tx_bytes = stat.tx_bytes;
+    pkt_stat->tx_errors = stat.tx_errors;
+    pkt_stat->tx_dropped = stat.tx_dropped;
+    return 0;
+}
+
+/********************************************************************
 * @brief: qser_wifi_ap_start, Set the ap mode of 2.4G or 5G to enable
 * @param idx [IN]: int, Set 2.4G or 5G
 * @return : int, If equal to 0 succeeds, others fail
@@ -1141,17 +1211,17 @@
 * @see: NA
 * @warning: NA
 *********************************************************************/
-int  qser_wifi_sta_get_status(lynq_wifi_sta_status_t *status_stat)
+int qser_wifi_sta_get_status(lynq_wifi_sta_status_t *status_stat)
 {
     int ret = -1;
     sc_wifi_sta_status_t stat;
     ret = sc_wifi_sta_get_status(&stat);
     if (0 != ret)
     {
-        LYERRLOG("[%s ] sta_param_get ret = %d\n", __func__,ret);
+        LYERRLOG("[%s ] sta_param_get ret = %d\n", __func__, ret);
         return ret;
     }
-    //print_sta_status(&stat);
+    print_sta_status(&stat);
     status_stat->status = (lynq_wifi_sta_status_e)stat.status;
     status_stat->signal_level = stat.signal_level;
     status_stat->has_addr = stat.has_addr;
@@ -1161,17 +1231,64 @@
     strncpy(status_stat->ap_bssid, stat.ap_bssid, sizeof(stat.ap_bssid) - 1);
     if (status_stat->has_addr == 1)
     {
-        //inet_ntop(AF_INET, &stat.addr, status_stat->addr, sizeof(status_stat->addr));
+        strncpy(status_stat->addr.addr, stat.addr.addr, sizeof(status_stat->addr.addr) - 1);
+        strncpy(status_stat->addr.netmask, stat.addr.netmask, sizeof(status_stat->addr.netmask) - 1);
+        status_stat->addr.subnet_bits = stat.addr.subnet_bits;
+        strncpy(status_stat->addr.gateway, stat.addr.gateway, sizeof(status_stat->addr.gateway) - 1);
+        strncpy(status_stat->addr.dnsp, stat.addr.dnsp, sizeof(status_stat->addr.dnsp) - 1);
+        strncpy(status_stat->addr.dnss, stat.addr.dnss, sizeof(status_stat->addr.dnss) - 1);
     }
     if (status_stat->has_addr6 == 1)
     {
-        //inet_ntop(AF_INET6, &stat.addr6, status_stat->addr6, sizeof(status_stat->addr6));
+        strncpy(status_stat->addr6.addr, stat.addr6.addr, sizeof(status_stat->addr6.addr) - 1);
+        strncpy(status_stat->addr6.prefix, stat.addr6.prefix, sizeof(status_stat->addr6.prefix) - 1);
+        status_stat->addr6.prefix_bits = stat.addr6.prefix_bits;
+        strncpy(status_stat->addr6.gateway, stat.addr6.gateway, sizeof(status_stat->addr6.gateway) - 1);
+        strncpy(status_stat->addr6.dnsp, stat.addr6.dnsp, sizeof(status_stat->addr6.dnsp) - 1);
+        strncpy(status_stat->addr6.dnss, stat.addr6.dnss, sizeof(status_stat->addr6.dnss) - 1);
     }
     LYINFLOG("[%s ] ret = %d \n", __func__, ret);
     return 0;
 }
 
 /********************************************************************
+* @brief: qser_wifi_get_sta_pkt_stats, Obtain data packets sent and received by sta for 2.4G or 5G
+* @param pkt_stat [OUT]: lynq_wifi_pkt_stats_t *, Obtain data packets sent and received by sta
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_get_sta_pkt_stats(lynq_wifi_pkt_stats_t *pkt_stat)
+{
+    int ret = -1;
+    sc_wifi_pkt_stats_t stat = {0};
+    if (pkt_stat == NULL)
+    {
+        LYERRLOG("[%s ] Null pointer pkt_stat = 0x%p\n", __func__, pkt_stat);
+        return ret;
+    }
+    ret = sc_wifi_get_sta_pkt_stats(&stat);
+    if (0 != ret)
+    {
+        LYERRLOG("[%s ] ret = %d\n", __func__, ret);
+        return ret;
+    }
+    LYINFLOG("[%s ]sta_pkt_get rx[%llu, %llu, %llu, %llu] tx[%llu, %llu, %llu, %llu]\n", __func__, 
+             stat.rx_packets, stat.rx_bytes, stat.rx_errors, stat.rx_dropped,
+             stat.tx_packets, stat.tx_bytes, stat.tx_errors, stat.tx_dropped);
+    pkt_stat->rx_packets = stat.rx_packets;
+    pkt_stat->rx_bytes = stat.rx_bytes;
+    pkt_stat->rx_errors = stat.rx_errors;
+    pkt_stat->rx_dropped = stat.rx_dropped;
+    pkt_stat->tx_packets = stat.tx_packets;
+    pkt_stat->tx_bytes = stat.tx_bytes;
+    pkt_stat->tx_errors = stat.tx_errors;
+    pkt_stat->tx_dropped = stat.tx_dropped;
+    return 0;
+}
+
+/********************************************************************
 * @brief: qser_wifi_sta_start_scan, Scan for ap nodes and return them through callback
 * @return : int, If equal to 0 succeeds, others fail
 * @todo: NA
