add S300AI

Change-Id: Ice89434e8dc7b3be506380729d716f50aa75df14
diff --git a/lynq/S300AI/ap/app/include/wifi_msg.h b/lynq/S300AI/ap/app/include/wifi_msg.h
new file mode 100755
index 0000000..df25cfd
--- /dev/null
+++ b/lynq/S300AI/ap/app/include/wifi_msg.h
@@ -0,0 +1,493 @@
+/**
+* @file Wifi_msg.h
+* @brief ÌṩwifiÉèÖõÄÏûÏ¢½Ó¿Ú
+*
+* Copyright (C) 2017 Sanechips Technology Co., Ltd.
+* @author Linxu Gebin
+*
+* 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.
+*
+************************************************************************
+*/
+
+#ifndef __WIFI_MSG_H__
+#define __WIFI_MSG_H__
+
+#include "message.h"
+#include "wifi.h"
+
+
+/**
+* @brief ¶¨ÒåwifiÏûÏ¢
+ * @param MSG_CMD_WIFI_BASE ÉèÖÃÖ÷ssidµÄ»ù±¾²ÎÊýÏûÏ¢
+ * @param MSG_CMD_WIFI_SSID_M ÉèÖø±ssidµÄ»ù±¾²ÎÊýÏûÏ¢
+ * @param MSG_CMD_WIFI_CLOSE ¹Ø±ÕwifiÏûÏ¢
+ * @param MSG_CMD_WIFI_OPEN ¿ªÆôwifiÏûÏ¢
+ * @param MSG_CMD_WIFI_RESTART ÖØÆôwifiÏûÏ¢
+ * @param MSG_CMD_WIFI_ADVANCED wifiµÄ¸ß¼¶²ÎÊýÉèÖÃÏûÏ¢
+ * @param MSG_CMD_WIFI_WPS ¿ªÆôWPS¹¦ÄÜÏûÏ¢
+ * @param MSG_CMD_WIFI_WPS_UP WPSÄ£¿é·¢À´µÄWPSÆô¶¯ÏûÏ¢
+ * @param MSG_CMD_WIFI_WPS_DOWN WPSÄ£¿é·¢À´µÄWPS ¹Ø±ÕÏûÏ¢
+ * @param MSG_CMD_WIFI_SLEEP WEBUIÉèÖÃ˯Ãßʱ³¤ÏûÏ¢
+ * @param MSG_CMD_CAPTURE_STATION ²éѯstaµÄÁ¬½ÓÇé¿öÏûÏ¢
+ * @param MSG_CMD_WIFI_COVERAGE ÉèÖÃwifiµÄ¸²¸Ç·¶Î§ÏûÏ¢
+ * @param MSG_CMD_WIFI_MAC ÉèÖÃmac¹ýÂ˹¦ÄÜÏûÏ¢
+ * @param MSG_CMD_USB_CHARGING_CHANGED Çý¶¯¼ì²âµ½usb³äµç״̬±ä»¯Éϱ¨ÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_OPEN ´ò¿ªapsta¹¦ÄÜÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_CLOSE ¹Ø±Õapsta¹¦ÄÜÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_CLOSE_OPEN_MSSID ´ò¿ªapsta£¬¹Ø±Õ¶àssidÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_SCAN ɨÃèÈȵãÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_CONNECT Á¬½ÓÈȵãÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_CONNECT_TIMEOUT Á¬½Ó³¬Ê±µÄ´¦ÀíÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_SIM_INIT_TIMER_PROCESS ²éѯsim¿¨ÓÐÎÞÆôÓõĶ¨Ê±Æ÷ÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_GET_SCAN_RESULTS_TIMER_PROCESS wpa_supplicantÖ÷¶¯É¨ÃèÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_DISCONNECT Ö÷¶¯¶Ï¿ªÕýÔÚÁ¬½ÓµÄÈȵãÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_SPOT_UPDATE ¸üÐÂÈȵãÁбíÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_EVENT_CONNECTING wpa_supplicantÕýÔÚ³¢ÊÔÁ¬½ÓʼþÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_EVENT_CONNECTED apstaÓëÈȵãÁ¬½Ó³É¹¦Í¨ÖªÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_EVENT_DISCONNECTED apstaÓëÈȵã¶Ï¿ªÁ¬½Ó֪ͨÏûÏ¢
+ * @param MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS blc·¢Ë͵ÄÁ¬½Ó³É¹¦£¬stationµÄipÒÑ·ÖÅäµ½ÏûÏ¢
+ * @param MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS blc·¢À´ÏûÏ¢´ò¿ªapstaÁ¬½ÓÏûÏ¢
+ * @param MSG_CMD_BLC_CLOSE_WIFISTATION_ACCESS blc·¢À´ÏûÏ¢¶Ï¿ªapstaÁ¬½ÓÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_NO_AVAILABLE_AP apstaÎÞЧÏûÏ¢
+ * @param MSG_CMD_WIFI_STATION_END apstationµÄÏûÏ¢·¶Î§end
+ * @param MSG_CMD_WIFI_TSW_SET ÉèÖö¨Ê±Ë¯Ãß»½ÐѵÄÏûÏ¢
+ * @param MSG_CMD_WIFI_TSW_CLOSE ¹Ø±Õ¶¨Ê±Ë¯Ãß»½Ðѹ¦ÄܵÄÏûÏ¢
+ * @param MSG_CMD_RTC_TIME_UPDATE ¸üÐÂÐèÖØÐÂÉèÖö¨Ê±Ë¯Ãß»½ÐÑÏûÏ¢
+ * @param MSG_CMD_WIFI_RESET_TIMER mmi°´¼üÖØÐÂÉèÖÃ˯Ãßtimer
+*/
+enum wifi_msg_cmd {
+	MSG_CMD_WIFI_CFG_AP = MSG_CMD_WIFI_BASE, //ÉèÖÃÖ÷ssidµÄ»ù±¾²ÎÊýµÄÏûÏ¢4001
+	MSG_CMD_WIFI_CFG_AP2, //ÉèÖø±ssidµÄ»ù±¾²ÎÊýµÄÏûÏ¢
+	//³ýMMIÆäËûÄ£¿é²»Ó¦¸Ã´¦Àí¼Ù¹Ø»úµÄÂß¼­£¬ÓÉMMIÌṩ1¸ö¹Ø»ú²»±£´æNV£¬ÐèÒªµÄÄ£¿é¶ÁÈ¡ÅжÏÊÇ·ñ¼Ù¹Ø»ú¼´¿É
+	//MSG_CMD_WIFI_CLOSE_FAST,             //ÉèÖÿìËٹػúµÄÏûÏ¢
+	MSG_CMD_WIFI_CLOSE,                    //¹Ø±ÕwifiµÄÏûÏ¢
+	MSG_CMD_WIFI_OPEN,                     //¿ªÆôwifiµÄÏûÏ¢
+	MSG_CMD_WIFI_FORCE_RESTART,            //CrashºóÇ¿ÖÆÖØÆôwifiµÄÏûÏ¢
+	MSG_CMD_WIFI_ADVANCED,                 //wifiµÄ¸ß¼¶²ÎÊýÉèÖÃÏûÏ¢
+	MSG_CMD_WIFI_WPS,                      //¿ªÆôWPS¹¦ÄÜ£¬2·ÖÖÓ×Ô¶¯¹Ø£¬¹Ê²»ÐèÒª¹Ø±ÕÏûÏ¢
+	MSG_CMD_WIFI_WPS_UP,                   //WPSÄ£¿é·¢À´µÄWPSÆô¶¯µÄÏûÏ¢
+	MSG_CMD_WIFI_WPS_DOWN,                 //WPSÄ£¿é·¢À´µÄWPS ¹Ø±ÕµÄÏûÏ¢
+	MSG_CMD_WIFI_SLEEP,                    //WEBUIÉèÖÃ˯Ãßʱ³¤µÄÏûÏ¢
+	MSG_CMD_CAPTURE_STATION,               //²éѯstaµÄÁ¬½ÓÇé¿ö
+	MSG_CMD_WIFI_COVERAGE,                 //ÉèÖÃwifiµÄ¸²¸Ç·¶Î§
+	MSG_CMD_WIFI_MAC,                      //ÉèÖÃmac¹ýÂ˹¦ÄÜ
+	MSG_CMD_WIFI_CHANNEL_FOLLOW,           //ÉèÖÃwifi APÐŵÀ¸úËæSTA
+
+	MSG_CMD_USB_CHARGING_CHANGED,          //Çý¶¯¼ì²âµ½usb³äµç״̬±ä»¯Éϱ¨ÏûÏ¢
+
+	//for apstation
+	MSG_CMD_WIFI_STATION_OPEN,             //´ò¿ªapsta¹¦ÄÜ
+	MSG_CMD_WIFI_STATION_OPEN_SUCCESS,   //0x4010
+	MSG_CMD_WIFI_STATION_OPEN_FAIL,
+	MSG_CMD_WIFI_STATION_CLOSE,            //¹Ø±Õapsta¹¦ÄÜ
+	MSG_CMD_WIFI_STATION_CLOSE_SUCCESS,
+	MSG_CMD_WIFI_STATION_CLOSE_OPEN_MSSID, //´ò¿ªapsta£¬¹Ø±Õ¶àssid
+	MSG_CMD_WIFI_STATION_SCAN,             //ɨÃèÈȵã
+	MSG_CMD_WIFI_STATION_CONNECT,          //Á¬½ÓÈȵã
+	MSG_CMD_WIFI_STATION_CONNECT_TIMEOUT,  //Á¬½Ó³¬Ê±µÄ´¦ÀíÏûÏ¢
+
+	MSG_CMD_WIFI_STATION_SIM_INIT_TIMER_PROCESS,   //eap-sim/aka¹¦ÄÜ£¬²éѯsim¿¨ÓÐÎÞÆôÓõĶ¨Ê±Æ÷ÏûÏ¢
+	MSG_CMD_WIFI_STATION_GET_SCAN_RESULTS,         // wpa_supplicantÖ÷¶¯É¨Ãè8sÒ»´Î
+	MSG_CMD_WIFI_STATION_DISCONNECT,               //Ö÷¶¯¶Ï¿ªÕýÔÚÁ¬½ÓµÄÈȵã
+	MSG_CMD_WIFI_STATION_SPOT_UPDATE,              //¸üÐÂÈȵãÁбí
+	MSG_CMD_WIFI_STATION_EVENT_CONNECTING,         //wpa_supplicantÕýÔÚ³¢ÊÔÁ¬½ÓʼþÏûÏ¢
+	MSG_CMD_WIFI_STATION_EVENT_CONNECTED,          //apstaÓëÈȵãÁ¬½Ó³É¹¦Í¨ÖªÏûÏ¢
+	MSG_CMD_WIFI_STATION_EVENT_DISCONNECTED,       //apstaÓëÈȵã¶Ï¿ªÁ¬½Ó֪ͨÏûÏ¢
+	MSG_CMD_WIFI_STATION_BLC_CONNECTED,            //blc·¢Ë͵ÄÁ¬½Ó³É¹¦£¬stationµÄipÒÑ·ÖÅäµ½
+	MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS,           //blc·¢À´ÏûÏ¢´ò¿ªapstaÁ¬½Ó//0x4020
+	MSG_CMD_BLC_CLOSE_WIFISTATION_ACCESS,          //blc·¢À´ÏûÏ¢¶Ï¿ªapstaÁ¬½Ó
+	MSG_CMD_WIFI_STATION_NO_AVAILABLE_AP,
+	MSG_CMD_WIFI_STATION_FORGET,               //
+	MSG_CMD_WIFI_STATION_INDICATE_SCAN_RESULTS,
+	MSG_CMD_WIFI_STATION_CONNECT_FAIL,
+	MSG_CMD_WIFI_STATION_SUPPLICANT_EVT, //
+	MSG_CMD_WIFI_STATION_TEMP_DISABLED,         //apstaδ³É¹¦Á¬½ÓÉÏÈȵãµÄ¹ý¶Éʼþ£¬Ö®ºó»á×Ô¶¯ÖØÁ¬
+	MSG_CMD_WIFI_STATION_FAILED_SET,         //apstaδ³É¹¦Á¬½ÓÉÏÈȵãµÄ¼øÈ¨Ê§°Üʼþ£¬Ö®ºó²»ÖØÁ¬
+	
+	MSG_CMD_WIFI_STATION_DEBUG_DUMP,
+	MSG_CMD_WIFI_STATION_WPA_CMD,
+	MSG_CMD_WIFI_STATION_CONNECTED_ENABLE_AP_CMD, //apstaÁ¬½ÓÈȵã³É¹¦Æô¶¯ap
+	MSG_CMD_WIFI_STATION_END,                      //apstationµÄÏûÏ¢·¶Î§end
+
+	//timing of sleep wake up
+	MSG_CMD_WIFI_TSW_SET,         //ÉèÖö¨Ê±Ë¯Ãß»½ÐѵÄÏûÏ¢
+	MSG_CMD_WIFI_TSW_CLOSE,       //¹Ø±Õ¶¨Ê±Ë¯Ãß»½Ðѹ¦ÄܵÄÏûÏ¢
+	MSG_CMD_RTC_TIME_UPDATE,      //rtcʱ¼ä ¸üÐÂÐèÖØÐÂÉèÖö¨Ê±Ë¯Ãß»½ÐÑ
+	MSG_CMD_WIFI_RESET_TIMER,     //mmi°´¼üÖØÐÂÉèÖÃ˯Ãßtimer
+
+
+	/***************wifi OPENCPUÏûÏ¢****************/
+	MSG_CMD_WIFI_SWITCH_REQ,
+	MSG_CMD_WIFI_SWITCH_RSP,
+	MSG_CMD_WIFI_CFG_SSID_REQ,  //0x4030
+	MSG_CMD_WIFI_CFG_SSID_RSP,
+	MSG_CMD_WIFI_CFG_PWD_REQ,
+	MSG_CMD_WIFI_CFG_PWD_RSP,
+	/***************wifi OPENCPUÏûÏ¢****************/
+	MSG_CMD_AP_STA_CONNECTED,
+	MSG_CMD_AP_STA_DISCONNECTED,
+
+	MSG_CMD_WIFI_TESTMODE_REQ,
+	MSG_CMD_WIFI_TESTMODE_RSP,
+};
+
+
+#define WIFI_SSID_LEN			33
+#define WLAN_PSK_LEN 			65
+#define WLAN_SECURITY_LEN		20
+#define WLAN_ENCRYPT_LEN		10
+#define WLAN_DEFAULTID_LEN		4
+#define WLAN_WEPKEY_LEN			32
+#define WLAN_ENCODE_PSK_LEN		100
+#define WLAN_MAX_ACCESS_NUM_LEN 4
+#define WLAN_HIDESSID_LEN		4
+#define WF_AUTH_OPEN			"OPEN"
+#define WF_AUTH_SHARE			"SHARED"
+#define WF_AUTH_WEPAUTO			"WEPAUTO"
+#define WF_AUTH_WPA				"WPAPSK"
+#define WF_AUTH_WPA2			"WPA2PSK"
+#define WF_AUTH_WPA_WPA2		"WPAPSKWPA2PSK"
+#define WF_AUTH_WAPIPSK			"WAPIPSK"
+#define WF_ENCRP_NONE			"NONE"   //encrypt
+#define WF_ENCRP_WEP			"WEP"
+#define WF_ENCRP_TKIP			"TKIP"
+#define WF_ENCRP_CCMP			"CCMP"
+#define WF_ENCRP_AES			"AES"
+#define WF_ENCRP_TKIP_CCMP		"TKIPCCMP"
+#define WF_ENCRP_TKIP_AES		"TKIPAES"
+
+/**
+* @brief ¶¨ÒåMSG_CMD_WIFI_CFG_AP ,MSG_CMD_WIFI_CFG_AP2 ÏûÏ¢¸½´øÊý¾Ý½á¹¹Ìå
+*
+*
+*
+*/
+typedef struct wlan_cfg_basic {
+	char ssid[WIFI_SSID_LEN];			//ssid should be less than 32 bytes
+	char pwd[WLAN_PSK_LEN];				//pwd len should be in 8~64 bytes
+	char authmode[WLAN_SECURITY_LEN];
+	char encrypt[WLAN_ENCRYPT_LEN];
+	char max_access_num[WLAN_MAX_ACCESS_NUM_LEN];
+	char hidessid[WLAN_HIDESSID_LEN];
+} wlan_basic_info;
+
+typedef struct _wlan_mac_info{
+	char hostname[32];
+	char mac[20];
+}wlan_mac_info;
+
+typedef struct _wlan_mac_info_list{
+	wlan_mac_info mac_info[MAX_NUMBER_OF_MAC];
+	int access_count;
+}wlan_mac_info_list;
+
+/**
+* @brief ¶¨Òåwifi״̬ÃüÁî
+ * @param WIFI_ADVANCED_CLOSE ¹Ø±ÕwifiµÄÏûÏ¢
+ * @param WIFI_ADVANCED_OPEN ¿ªÆôwifiµÄÏûÏ¢
+ * @param WIFI_ADVANCED_OPEN_VA01 ͬʱ¿ªÆôÖ÷¡¢¸±ssidµÄÏûÏ¢
+ * @param WIFI_ADVANCED_CLOSE_MSSID ¹Ø±Õ¸±ssidµÄÏûÏ¢
+ * @param WIFI_ADVANCED_OPEN_VA1 ´ò¿ª¸±ssidµÄÏûÏ¢
+ * @param WIFI_ADVANCED_RF ÉèÖÃÉ䯵²ÎÊýµÄÏûÏ¢
+ * @param WIFI_ADVANCED_RESTART Ð¾Æ¬ÖØÆôµÄÏûÏ¢
+*/
+enum {
+	WIFI_ADVANCED_CLOSE = 0,	// 0 ¹Ø±Õwifi
+	WIFI_ADVANCED_OPEN,			// 1 ¿ªÆôva0
+	WIFI_ADVANCED_OPEN_VA01,	// 2 ͬʱ¿ªÆôÖ÷¡¢¸±ssid
+	WIFI_ADVANCED_CLOSE_MSSID,	// 3¹Ø±Õ¸±ssid
+	WIFI_ADVANCED_OPEN_VA1,		// 4 ´ò¿ª¸±ssid
+	WIFI_ADVANCED_RF,			// 5 ÉèÖÃÉ䯵²ÎÊý
+	WIFI_ADVANCED_RESTART,		// 6 Ð¾Æ¬ÖØÆô
+	WIFI_ADVANCED_BAND_SWITCH,	// 7 ap 2.4G/5GÇл»
+};
+
+/**********wlan atate***************/
+#define WIFI_OPENED        "1"    //ÒÑ»½ÐÑ
+#define WIFI_CLOSED        "0"    //ÒѹرÕ
+
+#define WLAN_ON             1    //ÒÑ»½ÐÑ
+#define WLAN_OFF            0
+
+/**
+* @brief ¶¨Òåwifi apstation SIM¿¨×´Ì¬
+ * @param CARD_MODE_NO_SIM ûÓÐSIMµÄÏûÏ¢
+ * @param WCARD_MODE_SIM ´æÔÚSIMµÄÏûÏ¢
+ * @param CARD_MODE_USIM ´æÔÚUSIMµÄÏûÏ¢
+*/
+//ÓÃÓÚapsta¹¦ÄÜÀïʶ±ðsim¿¨
+enum CardMode_Def {
+	/*T_zUfi_CardMode*/
+	CARD_MODE_NO_SIM = 0x1b00,
+	CARD_MODE_SIM,
+	CARD_MODE_USIM,
+	/*--------------------*/
+};
+
+
+/**
+* @brief ¶¨Òåwifi PIN״̬
+ * @param PIN_STATUS_NO_PIN ûÓÐPINÂëµÄÏûÏ¢
+ * @param PIN_STATUS_PIN1 PIN1ÂëµÄÏûÏ¢
+ * @param PIN_STATUS_PIN2 PIN2ÂëµÄÏûÏ¢
+ * @param PIN_STATUS_PUK1 PUK1ÂëµÄÏûÏ¢
+ * @param PIN_STATUS_PUK2 PUK2ÂëµÄÏûÏ¢
+*/
+enum PinStatus_Def {
+	/*T_zUfi_PinStatus*/
+	PIN_STATUS_NO_PIN = 0x1c00,
+	PIN_STATUS_PIN1,
+	PIN_STATUS_PIN2,
+	PIN_STATUS_PUK1,
+	PIN_STATUS_PUK2,
+	/*--------------------*/
+};
+
+/*********************station begin****************/
+
+//#ifndef  __REALTEK_8192_CHIP__
+#if !(defined(__REALTEK_8192_CHIP__) || defined(__SSV_6X5X_CHIP__) || defined(__AIC_8800DW_CHIP__))
+
+
+#define WIFI_STATION_MAC_LEN                20
+#define WIFI_STATION_SSID_LEN               128
+#define WIFI_STATION_AUTH_MODE_LEN  		20
+#define WIFI_STATION_ENCRYPT_TYPE_LEN  		20
+#define WIFI_STATION_SPOT_PASSWORD_LEN  	128
+
+typedef struct scan_result {
+	char     mac[WIFI_STATION_MAC_LEN];
+	char     ssid[WIFI_STATION_SSID_LEN];
+	char     auth_mode[WIFI_STATION_AUTH_MODE_LEN];
+	char     encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
+	short    connect_status;
+	short    channel;
+	short    signal;
+	short    network_id;
+} scan_result_t;
+
+typedef struct spot {
+	char     mac[WIFI_STATION_MAC_LEN];
+	char     ssid[WIFI_STATION_SSID_LEN];
+	char     auth_mode[WIFI_STATION_AUTH_MODE_LEN];
+	char     encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
+	char     password[WIFI_STATION_SPOT_PASSWORD_LEN];
+	short    network_id;
+} spot_t;
+
+typedef enum{
+	SAVE_ACTION,
+	DEL_ACTION,
+	CONNECTING_ACTION,
+	DHCPING_ACTION,
+	CONNECTED_ACTION,
+	DISCONNECT_ACTION,
+	
+	//kw 3
+	ACTION_MAX
+}spot_action_t;
+
+typedef struct  msg_act_spot {
+	spot_action_t  act;
+	char  mac[WIFI_STATION_MAC_LEN];
+	char  ssid[WIFI_STATION_SSID_LEN];
+	int network_id;
+} msg_act_spot_t;
+
+typedef enum scan_content {	
+	WIFI_STATION_AP_CONTENT_UNDEFINED,
+	WIFI_STATION_AP_MAC,
+	WIFI_STATION_AP_SSID,
+	WIFI_STATION_AP_AUTH_MODE,
+	WIFI_STATION_AP_ENCRYPT_TYPE,	
+	WIFI_STATION_AP_CHANNEL,
+	WIFI_STATION_AP_SIGNAL,
+	WIFI_STATION_AP_CONNECT_STATUS,
+	WIFI_STATION_AP_NETWORK_ID,
+} scan_content_t;
+
+typedef enum{
+	DISCONNECT_STATUS,
+	CONNECTING_STATUS,
+	DHCPING_STATUS,
+	CONNECTED_STATUS,
+}connect_status_t;
+
+typedef enum {
+	WIFI_STATION_WRONG_KEY,
+	WIFI_STATION_IP_FAIL,
+	WIFI_STATION_AUTH_FAIL,
+	WIFI_STATION_OTHER,
+}conn_fail_reason_t;
+
+#else
+
+#define WIFI_STATION_SPOT_ACTION_LEN             32
+#define WIFI_STATION_SPOT_LEN  256
+#define WIFI_STATION_SPOT_LIST_NUM  10
+#define WIFI_STATION_SPOT_PROFILE_NAME_LEN  30
+#define WIFI_STATION_SPOT_PASSWORD_LEN  128
+#define WIFI_STATION_SPOT_KEY_ID_LEN  10
+#define WIFI_STATION_PROFILE_NV_NAME_LEN  20
+
+#define WIFI_STATION_WPA_STATUS_LEN         30
+#define WIFI_STATION_MAC_LEN                20
+#define WIFI_STATION_SSID_LEN               128
+#define WIFI_STATION_AUTH_MODE_LEN  20
+#define WIFI_STATION_ENCRYPT_TYPE_LEN  20
+#define WIFI_STATION_FLAGS_LEN    128
+
+typedef struct  update_spot_info {
+	char  spot[WIFI_STATION_SPOT_LEN];
+	char action[WIFI_STATION_SPOT_ACTION_LEN];
+} updateinfo_t;
+
+typedef enum wifi_profile_content {
+	WIFI_STATION_CONTENT_UNDEFINED,
+	WIFI_STATION_PROFILE_NAME,
+	WIFI_STATION_FROM_PROVIDER,
+	WIFI_STATION_CONNECT_STATUS,
+	WIFI_STATION_SIGNAL,
+	WIFI_STATION_SSID,
+	WIFI_STATION_AUTH_MODE,
+	WIFI_STATION_ENCRYPT_TYPE,
+	WIFI_STATION_PASSWORD,
+	WIFI_STATION_KEY_ID,
+	WIFI_STATION_AP_MAC
+} wifi_profile_content_t;
+
+typedef struct scan_result {
+	char     mac[WIFI_STATION_MAC_LEN];
+	char     ssid[WIFI_STATION_SSID_LEN];
+	char     auth_mode[WIFI_STATION_AUTH_MODE_LEN];
+	char     encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
+	short    from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ
+	short    connect_status;
+	short    channel;
+	short    signal;
+} scan_result_t;
+
+
+typedef struct spot {
+	char      profile_name[WIFI_STATION_SPOT_PROFILE_NAME_LEN];
+	short    from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ
+	short    connect_status;
+	short    signal;
+	char      ssid[WIFI_STATION_SSID_LEN];
+	char      auth_mode[WIFI_STATION_AUTH_MODE_LEN];
+	char      encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
+	char      password[WIFI_STATION_SPOT_PASSWORD_LEN];
+	short    keyID;
+	char     mac[WIFI_STATION_MAC_LEN];
+	BOOL    is_tried_connect;
+	short    network_id;
+} spot_t;
+
+
+typedef struct  spot_ssid_id {
+	int  id;
+	char  ssid[WIFI_STATION_SSID_LEN];
+} spot_ssid_id_t;
+#endif
+
+/*********************station end****************/
+
+/*nv   set flags */
+
+//wifi
+
+#define NVIO_WIFI_MAX_LEN  				200 /*write or read nv length*/
+#define WIFI_PSW_DEFAULT_LENGTH  		65
+#define WIFI_STATUS_LEN					 2
+#define WIFI_PSW_MIN_LEN 				1
+#define WIFI_PSW_MAN_LEN 				64
+#define WIFI_CONFIG_DEFAULT_LENGTH  	128
+#define WF_WPS_KEY_INDEX_LEN  			2
+#define WF_KEY_MODE_LEN  				3
+#define WF_WEP_KEY_MAX_LEN  			27
+#define WF_WPA_KEY_MAX_LEN  			65
+#define WF_ENCRY_TYPE_LEN 				16
+#define WF_AU_MODE_LEN  				16
+#define WPS_MODE_PIN 					"PIN"      //wps mode 
+#define WPS_MODE_PBC  					"PBC"
+#define WPS_MODE_AP_PIN   				"APPIN"
+#define WF_AU_OPEN            				"OPEN"            //wifi auth mode?
+#define WF_AU_SHARE           				"SHARED"
+#define WF_AU_WEPAUTO         				"WEPAUTO"
+#define WF_AU_WPA             				"WPAPSK"
+#define WF_AU_WPA2            				"WPA2PSK"
+#define WF_AU_WPA_WPA2  	  			"WPAPSKWPA2PSK"
+#define WF_AU_WPA3            				"WPA3Personal"
+#define WF_AU_WPA2_WPA3            				"WPA2WPA3"
+#define WF_AU_WAPIPSK	      				"WAPIPSK"
+#define WF_ENCRY_NONE      				"NONE"   //encrypt
+#define WF_ENCRY_WEP      				 "WEP"
+#define WF_ENCRY_TKIP      				"TKIP"
+#define WF_ENCRY_CCMP     				 "CCMP"
+#define WF_ENCRY_AES       				"AES"
+#define WF_ENCRY_TKIP_CCMP 				"TKIPCCMP"
+#define WF_ENCRY_TKIP_AES  				"TKIPAES"
+#define WIFI_SSID_INDEX 					"ssid_index"
+#define WIFI_STATION_MAC 				"mac_addr"
+#define WIFI_STATION_HOSTNAME 			"hostname"
+#define WIFI_STATION_IPADDR 				"ip_addr"
+#define WIFI_STATION_CONNECTTIME 		"connect_time"
+#define WIFI_STATION_VALIDTIME 			"valid_time"
+#define WIFI_STATION_IPTYPE 				"ip_type"
+#define WIFI_STATION_DEVTYPE 			"dev_type"
+#define WIFI_NV_ITEM_WIFI_SET_FLAGS 	"wifi_set_flags"
+#define NV_WIFI_SCAN_FINISH         			"scan_finish"
+
+#define NV_WIFI_WPA_PASS            			"WPAPSK1"
+#define NV_WIFI_WPA_PASS_ENCODE     		"WPAPSK1_encode"
+#define NV_WIFI_WPA_PASS_M          		"m_WPAPSK1"
+#define NV_WIFI_WPA_PASS_M_ENCODE   	"m_WPAPSK1_encode"
+#define NV_WIFI_COVERAGE  				"wifi_coverage"
+#define NV_WIFI_WPS_STATE 				 "WscModeOption"
+#define NV_WIFI_WPS_MODE      			"wps_mode"
+#define NV_WIFI_WPS_SSID       			"WPS_SSID"
+#define NV_WIFI_WPS_INDEX   				"wifi_wps_index"
+#define NV_WIFI_WPS_PIN   				"wps_pin"
+#define NV_WIFI_WPS_AP_PIN   			"wifi_ap_pin"
+#define NV_WIFI_WPS_DEF_PIN   			"wifi_def_pin"
+#define CMD_WIFI_STATION_LIST 			"station_list"
+#define CMD_HOSTNAME_LIST 				"hostNameList"
+#define CMD_WIFI_WPS_AP_PIN 			"wifi_ap_pin"
+#define CMD_WIFI_WPS_AP_DEF_PIN 		"wifi_def_pin"
+
+typedef enum {
+	ZTE_WLAN_SSID_SET = 0x1,
+	ZTE_WLAN_BROADCAST_SET = 0x2,
+	ZTE_WLAN_BASIC_SECURITY_SET = 0x4,
+	ZTE_WLAN_MAX_ACCESS_NUM_SET = 0x8,
+
+
+	ZTE_WLAN_ON_OFF_SET = 0x10,
+	ZTE_WLAN_WIRELESS_MODE_SET = 0x20,	
+	ZTE_WLAN_CHANNEL_SET = 0x40,	
+	ZTE_WLAN_COUNTRY_SET = 0x80,
+	ZTE_WLAN_WIFI_BAND_SET = 0x100,
+
+	ZTE_WLAN_POWER_SET = 0x1000,	
+	ZTE_WLAN_ACL_SET = 0x2000,	
+	ZTE_WLAN_WPS_SET = 0x4000,	
+	ZTE_WLAN_SET_AP_SLEEPTIMER = 0x8000,
+
+
+	ZTE_WLAN_SET_AP_MSSID = 0x10000,	
+
+} zte_wlan_set_e_flags;
+
+//same as sc_wifi_work_mode_e  to do: hu huan
+typedef enum
+{
+	IN_WIFI_WORK_MODE_MIN = -1,
+	IN_WIFI_WORK_MODE_AP0 = 0, 	//2.4G single ap / ap+sta
+	IN_WIFI_WORK_MODE_AP1, 		//5G single ap / ap+sta
+	IN_WIFI_WORK_MODE_STA,
+	IN_WIFI_WORK_MODE_MAX
+} inner_wifi_work_mode_e;
+#endif