lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @file Wifi_msg.h |
| 3 | * @brief ÌṩwifiÉèÖõÄÏûÏ¢½Ó¿Ú |
| 4 | * |
| 5 | * Copyright (C) 2017 Sanechips Technology Co., Ltd. |
| 6 | * @author Linxu Gebin |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | ************************************************************************ |
| 13 | */ |
| 14 | |
| 15 | #ifndef __WIFI_MSG_H__ |
| 16 | #define __WIFI_MSG_H__ |
| 17 | |
| 18 | #include "message.h" |
| 19 | #include "wifi.h" |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * @brief ¶¨ÒåwifiÏûÏ¢ |
| 24 | * @param MSG_CMD_WIFI_BASE ÉèÖÃÖ÷ssidµÄ»ù±¾²ÎÊýÏûÏ¢ |
| 25 | * @param MSG_CMD_WIFI_SSID_M ÉèÖø±ssidµÄ»ù±¾²ÎÊýÏûÏ¢ |
| 26 | * @param MSG_CMD_WIFI_CLOSE ¹Ø±ÕwifiÏûÏ¢ |
| 27 | * @param MSG_CMD_WIFI_OPEN ¿ªÆôwifiÏûÏ¢ |
| 28 | * @param MSG_CMD_WIFI_RESTART ÖØÆôwifiÏûÏ¢ |
| 29 | * @param MSG_CMD_WIFI_ADVANCED wifiµÄ¸ß¼¶²ÎÊýÉèÖÃÏûÏ¢ |
| 30 | * @param MSG_CMD_WIFI_WPS ¿ªÆôWPS¹¦ÄÜÏûÏ¢ |
| 31 | * @param MSG_CMD_WIFI_WPS_UP WPSÄ£¿é·¢À´µÄWPSÆô¶¯ÏûÏ¢ |
| 32 | * @param MSG_CMD_WIFI_WPS_DOWN WPSÄ£¿é·¢À´µÄWPS ¹Ø±ÕÏûÏ¢ |
| 33 | * @param MSG_CMD_WIFI_SLEEP WEBUIÉèÖÃ˯Ãßʱ³¤ÏûÏ¢ |
| 34 | * @param MSG_CMD_CAPTURE_STATION ²éѯstaµÄÁ¬½ÓÇé¿öÏûÏ¢ |
| 35 | * @param MSG_CMD_WIFI_COVERAGE ÉèÖÃwifiµÄ¸²¸Ç·¶Î§ÏûÏ¢ |
| 36 | * @param MSG_CMD_WIFI_MAC ÉèÖÃmac¹ýÂ˹¦ÄÜÏûÏ¢ |
| 37 | * @param MSG_CMD_USB_CHARGING_CHANGED Çý¶¯¼ì²âµ½usb³äµç״̬±ä»¯Éϱ¨ÏûÏ¢ |
| 38 | * @param MSG_CMD_WIFI_STATION_OPEN ´ò¿ªapsta¹¦ÄÜÏûÏ¢ |
| 39 | * @param MSG_CMD_WIFI_STATION_CLOSE ¹Ø±Õapsta¹¦ÄÜÏûÏ¢ |
| 40 | * @param MSG_CMD_WIFI_STATION_CLOSE_OPEN_MSSID ´ò¿ªapsta£¬¹Ø±Õ¶àssidÏûÏ¢ |
| 41 | * @param MSG_CMD_WIFI_STATION_SCAN ɨÃèÈȵãÏûÏ¢ |
| 42 | * @param MSG_CMD_WIFI_STATION_CONNECT Á¬½ÓÈȵãÏûÏ¢ |
| 43 | * @param MSG_CMD_WIFI_STATION_CONNECT_TIMEOUT Á¬½Ó³¬Ê±µÄ´¦ÀíÏûÏ¢ |
| 44 | * @param MSG_CMD_WIFI_STATION_SIM_INIT_TIMER_PROCESS ²éѯsim¿¨ÓÐÎÞÆôÓõĶ¨Ê±Æ÷ÏûÏ¢ |
| 45 | * @param MSG_CMD_WIFI_STATION_GET_SCAN_RESULTS_TIMER_PROCESS wpa_supplicantÖ÷¶¯É¨ÃèÏûÏ¢ |
| 46 | * @param MSG_CMD_WIFI_STATION_DISCONNECT Ö÷¶¯¶Ï¿ªÕýÔÚÁ¬½ÓµÄÈȵãÏûÏ¢ |
| 47 | * @param MSG_CMD_WIFI_STATION_SPOT_UPDATE ¸üÐÂÈȵãÁбíÏûÏ¢ |
| 48 | * @param MSG_CMD_WIFI_STATION_EVENT_CONNECTING wpa_supplicantÕýÔÚ³¢ÊÔÁ¬½ÓʼþÏûÏ¢ |
| 49 | * @param MSG_CMD_WIFI_STATION_EVENT_CONNECTED apstaÓëÈȵãÁ¬½Ó³É¹¦Í¨ÖªÏûÏ¢ |
| 50 | * @param MSG_CMD_WIFI_STATION_EVENT_DISCONNECTED apstaÓëÈȵã¶Ï¿ªÁ¬½Ó֪ͨÏûÏ¢ |
| 51 | * @param MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS blc·¢Ë͵ÄÁ¬½Ó³É¹¦£¬stationµÄipÒÑ·ÖÅäµ½ÏûÏ¢ |
| 52 | * @param MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS blc·¢À´ÏûÏ¢´ò¿ªapstaÁ¬½ÓÏûÏ¢ |
| 53 | * @param MSG_CMD_BLC_CLOSE_WIFISTATION_ACCESS blc·¢À´ÏûÏ¢¶Ï¿ªapstaÁ¬½ÓÏûÏ¢ |
| 54 | * @param MSG_CMD_WIFI_STATION_NO_AVAILABLE_AP apstaÎÞЧÏûÏ¢ |
| 55 | * @param MSG_CMD_WIFI_STATION_END apstationµÄÏûÏ¢·¶Î§end |
| 56 | * @param MSG_CMD_WIFI_TSW_SET ÉèÖö¨Ê±Ë¯Ãß»½ÐѵÄÏûÏ¢ |
| 57 | * @param MSG_CMD_WIFI_TSW_CLOSE ¹Ø±Õ¶¨Ê±Ë¯Ãß»½Ðѹ¦ÄܵÄÏûÏ¢ |
| 58 | * @param MSG_CMD_RTC_TIME_UPDATE ¸üÐÂÐèÖØÐÂÉèÖö¨Ê±Ë¯Ãß»½ÐÑÏûÏ¢ |
| 59 | * @param MSG_CMD_WIFI_RESET_TIMER mmi°´¼üÖØÐÂÉèÖÃ˯Ãßtimer |
| 60 | */ |
| 61 | enum wifi_msg_cmd { |
| 62 | MSG_CMD_WIFI_CFG_AP = MSG_CMD_WIFI_BASE, //ÉèÖÃÖ÷ssidµÄ»ù±¾²ÎÊýµÄÏûÏ¢4001 |
| 63 | MSG_CMD_WIFI_CFG_AP2, //ÉèÖø±ssidµÄ»ù±¾²ÎÊýµÄÏûÏ¢ |
| 64 | //³ýMMIÆäËûÄ£¿é²»Ó¦¸Ã´¦Àí¼Ù¹Ø»úµÄÂß¼£¬ÓÉMMIÌṩ1¸ö¹Ø»ú²»±£´æNV£¬ÐèÒªµÄÄ£¿é¶ÁÈ¡ÅжÏÊÇ·ñ¼Ù¹Ø»ú¼´¿É |
| 65 | //MSG_CMD_WIFI_CLOSE_FAST, //ÉèÖÿìËٹػúµÄÏûÏ¢ |
| 66 | MSG_CMD_WIFI_CLOSE, //¹Ø±ÕwifiµÄÏûÏ¢ |
| 67 | MSG_CMD_WIFI_OPEN, //¿ªÆôwifiµÄÏûÏ¢ |
| 68 | MSG_CMD_WIFI_FORCE_RESTART, //CrashºóÇ¿ÖÆÖØÆôwifiµÄÏûÏ¢ |
| 69 | MSG_CMD_WIFI_ADVANCED, //wifiµÄ¸ß¼¶²ÎÊýÉèÖÃÏûÏ¢ |
| 70 | MSG_CMD_WIFI_WPS, //¿ªÆôWPS¹¦ÄÜ£¬2·ÖÖÓ×Ô¶¯¹Ø£¬¹Ê²»ÐèÒª¹Ø±ÕÏûÏ¢ |
| 71 | MSG_CMD_WIFI_WPS_UP, //WPSÄ£¿é·¢À´µÄWPSÆô¶¯µÄÏûÏ¢ |
| 72 | MSG_CMD_WIFI_WPS_DOWN, //WPSÄ£¿é·¢À´µÄWPS ¹Ø±ÕµÄÏûÏ¢ |
| 73 | MSG_CMD_WIFI_SLEEP, //WEBUIÉèÖÃ˯Ãßʱ³¤µÄÏûÏ¢ |
| 74 | MSG_CMD_CAPTURE_STATION, //²éѯstaµÄÁ¬½ÓÇé¿ö |
| 75 | MSG_CMD_WIFI_COVERAGE, //ÉèÖÃwifiµÄ¸²¸Ç·¶Î§ |
| 76 | MSG_CMD_WIFI_MAC, //ÉèÖÃmac¹ýÂ˹¦ÄÜ |
| 77 | MSG_CMD_WIFI_CHANNEL_FOLLOW, //ÉèÖÃwifi APÐŵÀ¸úËæSTA |
| 78 | |
| 79 | MSG_CMD_USB_CHARGING_CHANGED, //Çý¶¯¼ì²âµ½usb³äµç״̬±ä»¯Éϱ¨ÏûÏ¢ |
| 80 | |
| 81 | //for apstation |
| 82 | MSG_CMD_WIFI_STATION_OPEN, //´ò¿ªapsta¹¦ÄÜ |
| 83 | MSG_CMD_WIFI_STATION_OPEN_SUCCESS, //0x4010 |
| 84 | MSG_CMD_WIFI_STATION_OPEN_FAIL, |
| 85 | MSG_CMD_WIFI_STATION_CLOSE, //¹Ø±Õapsta¹¦ÄÜ |
| 86 | MSG_CMD_WIFI_STATION_CLOSE_SUCCESS, |
| 87 | MSG_CMD_WIFI_STATION_CLOSE_OPEN_MSSID, //´ò¿ªapsta£¬¹Ø±Õ¶àssid |
| 88 | MSG_CMD_WIFI_STATION_SCAN, //ɨÃèÈȵã |
| 89 | MSG_CMD_WIFI_STATION_CONNECT, //Á¬½ÓÈȵã |
| 90 | MSG_CMD_WIFI_STATION_CONNECT_TIMEOUT, //Á¬½Ó³¬Ê±µÄ´¦ÀíÏûÏ¢ |
| 91 | |
| 92 | MSG_CMD_WIFI_STATION_SIM_INIT_TIMER_PROCESS, //eap-sim/aka¹¦ÄÜ£¬²éѯsim¿¨ÓÐÎÞÆôÓõĶ¨Ê±Æ÷ÏûÏ¢ |
| 93 | MSG_CMD_WIFI_STATION_GET_SCAN_RESULTS, // wpa_supplicantÖ÷¶¯É¨Ãè8sÒ»´Î |
| 94 | MSG_CMD_WIFI_STATION_DISCONNECT, //Ö÷¶¯¶Ï¿ªÕýÔÚÁ¬½ÓµÄÈȵã |
| 95 | MSG_CMD_WIFI_STATION_SPOT_UPDATE, //¸üÐÂÈȵãÁбí |
| 96 | MSG_CMD_WIFI_STATION_EVENT_CONNECTING, //wpa_supplicantÕýÔÚ³¢ÊÔÁ¬½ÓʼþÏûÏ¢ |
| 97 | MSG_CMD_WIFI_STATION_EVENT_CONNECTED, //apstaÓëÈȵãÁ¬½Ó³É¹¦Í¨ÖªÏûÏ¢ |
| 98 | MSG_CMD_WIFI_STATION_EVENT_DISCONNECTED, //apstaÓëÈȵã¶Ï¿ªÁ¬½Ó֪ͨÏûÏ¢ |
| 99 | MSG_CMD_WIFI_STATION_BLC_CONNECTED, //blc·¢Ë͵ÄÁ¬½Ó³É¹¦£¬stationµÄipÒÑ·ÖÅäµ½ |
| 100 | MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS, //blc·¢À´ÏûÏ¢´ò¿ªapstaÁ¬½Ó//0x4020 |
| 101 | MSG_CMD_BLC_CLOSE_WIFISTATION_ACCESS, //blc·¢À´ÏûÏ¢¶Ï¿ªapstaÁ¬½Ó |
| 102 | MSG_CMD_WIFI_STATION_NO_AVAILABLE_AP, |
| 103 | MSG_CMD_WIFI_STATION_FORGET, // |
| 104 | MSG_CMD_WIFI_STATION_INDICATE_SCAN_RESULTS, |
| 105 | MSG_CMD_WIFI_STATION_CONNECT_FAIL, |
| 106 | MSG_CMD_WIFI_STATION_SUPPLICANT_EVT, // |
| 107 | MSG_CMD_WIFI_STATION_TEMP_DISABLED, //apstaδ³É¹¦Á¬½ÓÉÏÈȵãµÄ¹ý¶Éʼþ£¬Ö®ºó»á×Ô¶¯ÖØÁ¬ |
| 108 | MSG_CMD_WIFI_STATION_FAILED_SET, //apstaδ³É¹¦Á¬½ÓÉÏÈȵãµÄ¼øÈ¨Ê§°Üʼþ£¬Ö®ºó²»ÖØÁ¬ |
| 109 | |
| 110 | MSG_CMD_WIFI_STATION_DEBUG_DUMP, |
| 111 | MSG_CMD_WIFI_STATION_WPA_CMD, |
| 112 | MSG_CMD_WIFI_STATION_CONNECTED_ENABLE_AP_CMD, //apstaÁ¬½ÓÈȵã³É¹¦Æô¶¯ap |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 113 | |
| 114 | //cap->ap |
| 115 | MSG_CMD_CAP_STA_SET_PARAM, //sta ssid auth pw |
| 116 | MSG_CMD_CAP_STA_ENABLE, //ap on off |
| 117 | MSG_CMD_CAP_STA_SCAN, //scan |
| 118 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 119 | MSG_CMD_WIFI_STATION_END, //apstationµÄÏûÏ¢·¶Î§end |
| 120 | |
| 121 | //timing of sleep wake up |
| 122 | MSG_CMD_WIFI_TSW_SET, //ÉèÖö¨Ê±Ë¯Ãß»½ÐѵÄÏûÏ¢ |
| 123 | MSG_CMD_WIFI_TSW_CLOSE, //¹Ø±Õ¶¨Ê±Ë¯Ãß»½Ðѹ¦ÄܵÄÏûÏ¢ |
| 124 | MSG_CMD_RTC_TIME_UPDATE, //rtcʱ¼ä ¸üÐÂÐèÖØÐÂÉèÖö¨Ê±Ë¯Ãß»½ÐÑ |
| 125 | MSG_CMD_WIFI_RESET_TIMER, //mmi°´¼üÖØÐÂÉèÖÃ˯Ãßtimer |
| 126 | |
| 127 | |
| 128 | /***************wifi OPENCPUÏûÏ¢****************/ |
| 129 | MSG_CMD_WIFI_SWITCH_REQ, |
| 130 | MSG_CMD_WIFI_SWITCH_RSP, |
| 131 | MSG_CMD_WIFI_CFG_SSID_REQ, //0x4030 |
| 132 | MSG_CMD_WIFI_CFG_SSID_RSP, |
| 133 | MSG_CMD_WIFI_CFG_PWD_REQ, |
| 134 | MSG_CMD_WIFI_CFG_PWD_RSP, |
| 135 | /***************wifi OPENCPUÏûÏ¢****************/ |
zw.wang | c08ce04 | 2024-08-08 18:42:05 +0800 | [diff] [blame] | 136 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 137 | MSG_CMD_AP_STA_CONNECTED, |
| 138 | MSG_CMD_AP_STA_DISCONNECTED, |
| 139 | |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 140 | //cap recv |
| 141 | MSG_CMD_CAP_WIFI_STATUS, |
| 142 | MSG_CMD_CAP_AP_STATUS, |
| 143 | MSG_CMD_CAP_AP_STA_CHANGE, |
| 144 | MSG_CMD_CAP_STA_STATUS, |
| 145 | MSG_CMD_CAP_STA_SCAN_RES, |
| 146 | |
| 147 | //cap send |
| 148 | MSG_CMD_CAP_WIFI_ENABLE, //wifiÇý¶¯³õʼ»¯, wlan up |
| 149 | MSG_CMD_CAP_WIFI_DISABLE, //wifiÇý¶¯È¥³õʼ»¯, wlan down |
| 150 | MSG_CMD_CAP_WIFI_WORK_MODE, //wifi¹¤×÷ģʽÉèÖà |
| 151 | MSG_CMD_CAP_WIFI_SET_SSID, // |
| 152 | MSG_CMD_CAP_WIFI_SET_HIDESSID, //0 not hide, 1 hide |
| 153 | MSG_CMD_CAP_WIFI_SET_MODE, //80211 mode bgn... |
| 154 | MSG_CMD_CAP_WIFI_SET_BANDWIDTH, //0 20M, 1 20/40M |
| 155 | //MSG_CMD_CAP_WIFI_SET_CHANNEL, //0 - 13 |
| 156 | MSG_CMD_CAP_WIFI_SET_MAXSTANUM, //0 - 32 |
| 157 | MSG_CMD_CAP_WIFI_SET_CC_CH, //country code, channel |
| 158 | MSG_CMD_CAP_WIFI_SET_ACL, |
| 159 | MSG_CMD_CAP_WIFI_SET_AUTH, //wpa |
| 160 | MSG_CMD_CAP_WIFI_AP_ENABLE, //ap on off |
| 161 | |
zw.wang | c08ce04 | 2024-08-08 18:42:05 +0800 | [diff] [blame] | 162 | MSG_CMD_CAP_WIFI_TEST_ENABLE, //wifi²âÊÔģʽÇý¶¯³õʼ»¯, 1 insmod/0 rmmod |
| 163 | |
| 164 | //for cap sync API |
| 165 | MSG_CMD_CAP_WIFI_STA_STAT_REQ, |
| 166 | MSG_CMD_CAP_WIFI_STA_STAT_RSP, |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 167 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 168 | }; |
| 169 | |
| 170 | |
| 171 | #define WIFI_SSID_LEN 33 |
| 172 | #define WLAN_PSK_LEN 65 |
| 173 | #define WLAN_SECURITY_LEN 20 |
| 174 | #define WLAN_ENCRYPT_LEN 10 |
| 175 | #define WLAN_DEFAULTID_LEN 4 |
| 176 | #define WLAN_WEPKEY_LEN 32 |
| 177 | #define WLAN_ENCODE_PSK_LEN 100 |
| 178 | #define WLAN_MAX_ACCESS_NUM_LEN 4 |
| 179 | #define WLAN_HIDESSID_LEN 4 |
| 180 | #define WF_AUTH_OPEN "OPEN" |
| 181 | #define WF_AUTH_SHARE "SHARED" |
| 182 | #define WF_AUTH_WEPAUTO "WEPAUTO" |
| 183 | #define WF_AUTH_WPA "WPAPSK" |
| 184 | #define WF_AUTH_WPA2 "WPA2PSK" |
| 185 | #define WF_AUTH_WPA_WPA2 "WPAPSKWPA2PSK" |
| 186 | #define WF_AUTH_WAPIPSK "WAPIPSK" |
| 187 | #define WF_ENCRP_NONE "NONE" //encrypt |
| 188 | #define WF_ENCRP_WEP "WEP" |
| 189 | #define WF_ENCRP_TKIP "TKIP" |
| 190 | #define WF_ENCRP_CCMP "CCMP" |
| 191 | #define WF_ENCRP_AES "AES" |
| 192 | #define WF_ENCRP_TKIP_CCMP "TKIPCCMP" |
| 193 | #define WF_ENCRP_TKIP_AES "TKIPAES" |
| 194 | |
| 195 | /** |
| 196 | * @brief ¶¨ÒåMSG_CMD_WIFI_CFG_AP ,MSG_CMD_WIFI_CFG_AP2 ÏûÏ¢¸½´øÊý¾Ý½á¹¹Ìå |
| 197 | * |
| 198 | * |
| 199 | * |
| 200 | */ |
| 201 | typedef struct wlan_cfg_basic { |
| 202 | char ssid[WIFI_SSID_LEN]; //ssid should be less than 32 bytes |
| 203 | char pwd[WLAN_PSK_LEN]; //pwd len should be in 8~64 bytes |
| 204 | char authmode[WLAN_SECURITY_LEN]; |
| 205 | char encrypt[WLAN_ENCRYPT_LEN]; |
| 206 | char max_access_num[WLAN_MAX_ACCESS_NUM_LEN]; |
| 207 | char hidessid[WLAN_HIDESSID_LEN]; |
| 208 | } wlan_basic_info; |
| 209 | |
| 210 | typedef struct _wlan_mac_info{ |
| 211 | char hostname[32]; |
| 212 | char mac[20]; |
| 213 | }wlan_mac_info; |
| 214 | |
| 215 | typedef struct _wlan_mac_info_list{ |
| 216 | wlan_mac_info mac_info[MAX_NUMBER_OF_MAC]; |
| 217 | int access_count; |
| 218 | }wlan_mac_info_list; |
| 219 | |
| 220 | /** |
| 221 | * @brief ¶¨Òåwifi״̬ÃüÁî |
| 222 | * @param WIFI_ADVANCED_CLOSE ¹Ø±ÕwifiµÄÏûÏ¢ |
| 223 | * @param WIFI_ADVANCED_OPEN ¿ªÆôwifiµÄÏûÏ¢ |
| 224 | * @param WIFI_ADVANCED_OPEN_VA01 ͬʱ¿ªÆôÖ÷¡¢¸±ssidµÄÏûÏ¢ |
| 225 | * @param WIFI_ADVANCED_CLOSE_MSSID ¹Ø±Õ¸±ssidµÄÏûÏ¢ |
| 226 | * @param WIFI_ADVANCED_OPEN_VA1 ´ò¿ª¸±ssidµÄÏûÏ¢ |
| 227 | * @param WIFI_ADVANCED_RF ÉèÖÃÉ䯵²ÎÊýµÄÏûÏ¢ |
| 228 | * @param WIFI_ADVANCED_RESTART Ð¾Æ¬ÖØÆôµÄÏûÏ¢ |
| 229 | */ |
| 230 | enum { |
| 231 | WIFI_ADVANCED_CLOSE = 0, // 0 ¹Ø±Õwifi |
| 232 | WIFI_ADVANCED_OPEN, // 1 ¿ªÆôva0 |
| 233 | WIFI_ADVANCED_OPEN_VA01, // 2 ͬʱ¿ªÆôÖ÷¡¢¸±ssid |
| 234 | WIFI_ADVANCED_CLOSE_MSSID, // 3¹Ø±Õ¸±ssid |
| 235 | WIFI_ADVANCED_OPEN_VA1, // 4 ´ò¿ª¸±ssid |
| 236 | WIFI_ADVANCED_RF, // 5 ÉèÖÃÉ䯵²ÎÊý |
| 237 | WIFI_ADVANCED_RESTART, // 6 Ð¾Æ¬ÖØÆô |
| 238 | }; |
| 239 | |
| 240 | /**********wlan atate***************/ |
| 241 | #define WIFI_OPENED "1" //ÒÑ»½ÐÑ |
| 242 | #define WIFI_CLOSED "0" //ÒÑ¹Ø±Õ |
| 243 | |
| 244 | #define WLAN_ON 1 //ÒÑ»½ÐÑ |
| 245 | #define WLAN_OFF 0 |
| 246 | |
| 247 | /** |
| 248 | * @brief ¶¨Òåwifi apstation SIM¿¨×´Ì¬ |
| 249 | * @param CARD_MODE_NO_SIM ûÓÐSIMµÄÏûÏ¢ |
| 250 | * @param WCARD_MODE_SIM ´æÔÚSIMµÄÏûÏ¢ |
| 251 | * @param CARD_MODE_USIM ´æÔÚUSIMµÄÏûÏ¢ |
| 252 | */ |
| 253 | //ÓÃÓÚapsta¹¦ÄÜÀïʶ±ðsim¿¨ |
| 254 | enum CardMode_Def { |
| 255 | /*T_zUfi_CardMode*/ |
| 256 | CARD_MODE_NO_SIM = 0x1b00, |
| 257 | CARD_MODE_SIM, |
| 258 | CARD_MODE_USIM, |
| 259 | /*--------------------*/ |
| 260 | }; |
| 261 | |
| 262 | |
| 263 | /** |
| 264 | * @brief ¶¨Òåwifi PIN״̬ |
| 265 | * @param PIN_STATUS_NO_PIN ûÓÐPINÂëµÄÏûÏ¢ |
| 266 | * @param PIN_STATUS_PIN1 PIN1ÂëµÄÏûÏ¢ |
| 267 | * @param PIN_STATUS_PIN2 PIN2ÂëµÄÏûÏ¢ |
| 268 | * @param PIN_STATUS_PUK1 PUK1ÂëµÄÏûÏ¢ |
| 269 | * @param PIN_STATUS_PUK2 PUK2ÂëµÄÏûÏ¢ |
| 270 | */ |
| 271 | enum PinStatus_Def { |
| 272 | /*T_zUfi_PinStatus*/ |
| 273 | PIN_STATUS_NO_PIN = 0x1c00, |
| 274 | PIN_STATUS_PIN1, |
| 275 | PIN_STATUS_PIN2, |
| 276 | PIN_STATUS_PUK1, |
| 277 | PIN_STATUS_PUK2, |
| 278 | /*--------------------*/ |
| 279 | }; |
| 280 | |
| 281 | /*********************station begin****************/ |
| 282 | |
| 283 | //#ifndef __REALTEK_8192_CHIP__ |
| 284 | #if !(defined(__REALTEK_8192_CHIP__) || defined(__SSV_6X5X_CHIP__) || defined(__AIC_8800DW_CHIP__)) |
| 285 | |
| 286 | |
| 287 | #define WIFI_STATION_MAC_LEN 20 |
| 288 | #define WIFI_STATION_SSID_LEN 128 |
| 289 | #define WIFI_STATION_AUTH_MODE_LEN 20 |
| 290 | #define WIFI_STATION_ENCRYPT_TYPE_LEN 20 |
| 291 | #define WIFI_STATION_SPOT_PASSWORD_LEN 128 |
| 292 | |
| 293 | typedef struct scan_result { |
| 294 | char mac[WIFI_STATION_MAC_LEN]; |
| 295 | char ssid[WIFI_STATION_SSID_LEN]; |
| 296 | char auth_mode[WIFI_STATION_AUTH_MODE_LEN]; |
| 297 | char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN]; |
| 298 | short connect_status; |
| 299 | short channel; |
| 300 | short signal; |
| 301 | short network_id; |
| 302 | } scan_result_t; |
| 303 | |
| 304 | typedef struct spot { |
| 305 | char mac[WIFI_STATION_MAC_LEN]; |
| 306 | char ssid[WIFI_STATION_SSID_LEN]; |
| 307 | char auth_mode[WIFI_STATION_AUTH_MODE_LEN]; |
| 308 | char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN]; |
| 309 | char password[WIFI_STATION_SPOT_PASSWORD_LEN]; |
| 310 | short network_id; |
| 311 | } spot_t; |
| 312 | |
| 313 | typedef enum{ |
| 314 | SAVE_ACTION, |
| 315 | DEL_ACTION, |
| 316 | CONNECTING_ACTION, |
| 317 | DHCPING_ACTION, |
| 318 | CONNECTED_ACTION, |
| 319 | DISCONNECT_ACTION, |
| 320 | |
| 321 | //kw 3 |
| 322 | ACTION_MAX |
| 323 | }spot_action_t; |
| 324 | |
| 325 | typedef struct msg_act_spot { |
| 326 | spot_action_t act; |
| 327 | char mac[WIFI_STATION_MAC_LEN]; |
| 328 | char ssid[WIFI_STATION_SSID_LEN]; |
| 329 | int network_id; |
| 330 | } msg_act_spot_t; |
| 331 | |
| 332 | typedef enum scan_content { |
| 333 | WIFI_STATION_AP_CONTENT_UNDEFINED, |
| 334 | WIFI_STATION_AP_MAC, |
| 335 | WIFI_STATION_AP_SSID, |
| 336 | WIFI_STATION_AP_AUTH_MODE, |
| 337 | WIFI_STATION_AP_ENCRYPT_TYPE, |
| 338 | WIFI_STATION_AP_CHANNEL, |
| 339 | WIFI_STATION_AP_SIGNAL, |
| 340 | WIFI_STATION_AP_CONNECT_STATUS, |
| 341 | WIFI_STATION_AP_NETWORK_ID, |
| 342 | } scan_content_t; |
| 343 | |
| 344 | typedef enum{ |
| 345 | DISCONNECT_STATUS, |
| 346 | CONNECTING_STATUS, |
| 347 | DHCPING_STATUS, |
| 348 | CONNECTED_STATUS, |
| 349 | }connect_status_t; |
| 350 | |
| 351 | typedef enum { |
| 352 | WIFI_STATION_WRONG_KEY, |
| 353 | WIFI_STATION_IP_FAIL, |
| 354 | WIFI_STATION_AUTH_FAIL, |
| 355 | WIFI_STATION_OTHER, |
| 356 | }conn_fail_reason_t; |
| 357 | |
| 358 | #else |
| 359 | |
| 360 | #define WIFI_STATION_SPOT_ACTION_LEN 32 |
| 361 | #define WIFI_STATION_SPOT_LEN 256 |
| 362 | #define WIFI_STATION_SPOT_LIST_NUM 10 |
| 363 | #define WIFI_STATION_SPOT_PROFILE_NAME_LEN 30 |
| 364 | #define WIFI_STATION_SPOT_PASSWORD_LEN 128 |
| 365 | #define WIFI_STATION_SPOT_KEY_ID_LEN 10 |
| 366 | #define WIFI_STATION_PROFILE_NV_NAME_LEN 20 |
| 367 | |
| 368 | #define WIFI_STATION_WPA_STATUS_LEN 30 |
| 369 | #define WIFI_STATION_MAC_LEN 20 |
| 370 | #define WIFI_STATION_SSID_LEN 128 |
| 371 | #define WIFI_STATION_AUTH_MODE_LEN 20 |
| 372 | #define WIFI_STATION_ENCRYPT_TYPE_LEN 20 |
| 373 | #define WIFI_STATION_FLAGS_LEN 128 |
| 374 | |
| 375 | typedef struct update_spot_info { |
xf.li | 0f7a036 | 2024-09-30 02:46:48 -0700 | [diff] [blame] | 376 | char spot[WIFI_STATION_SPOT_LEN]; |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 377 | char action[WIFI_STATION_SPOT_ACTION_LEN]; |
xf.li | 0f7a036 | 2024-09-30 02:46:48 -0700 | [diff] [blame] | 378 | char ssid[WIFI_SSID_LEN]; //ssid should be less than 32 bytes |
| 379 | char pwd[WLAN_PSK_LEN]; //pwd len should be in 8~64 bytes |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 380 | } updateinfo_t; |
| 381 | |
| 382 | typedef enum wifi_profile_content { |
| 383 | WIFI_STATION_CONTENT_UNDEFINED, |
| 384 | WIFI_STATION_PROFILE_NAME, |
| 385 | WIFI_STATION_FROM_PROVIDER, |
| 386 | WIFI_STATION_CONNECT_STATUS, |
| 387 | WIFI_STATION_SIGNAL, |
| 388 | WIFI_STATION_SSID, |
| 389 | WIFI_STATION_AUTH_MODE, |
| 390 | WIFI_STATION_ENCRYPT_TYPE, |
| 391 | WIFI_STATION_PASSWORD, |
| 392 | WIFI_STATION_KEY_ID, |
| 393 | WIFI_STATION_AP_MAC |
| 394 | } wifi_profile_content_t; |
| 395 | |
| 396 | typedef struct scan_result { |
| 397 | char mac[WIFI_STATION_MAC_LEN]; |
| 398 | char ssid[WIFI_STATION_SSID_LEN]; |
| 399 | char auth_mode[WIFI_STATION_AUTH_MODE_LEN]; |
| 400 | char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN]; |
| 401 | short from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ |
| 402 | short connect_status; |
| 403 | short channel; |
| 404 | short signal; |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 405 | #ifdef USE_CAP_SUPPORT |
| 406 | //short ch_freq; |
| 407 | signed char signal_db; |
| 408 | #endif |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 409 | } scan_result_t; |
| 410 | |
| 411 | |
| 412 | typedef struct spot { |
| 413 | char profile_name[WIFI_STATION_SPOT_PROFILE_NAME_LEN]; |
| 414 | short from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ |
| 415 | short connect_status; |
| 416 | short signal; |
| 417 | char ssid[WIFI_STATION_SSID_LEN]; |
| 418 | char auth_mode[WIFI_STATION_AUTH_MODE_LEN]; |
| 419 | char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN]; |
| 420 | char password[WIFI_STATION_SPOT_PASSWORD_LEN]; |
| 421 | short keyID; |
| 422 | char mac[WIFI_STATION_MAC_LEN]; |
| 423 | BOOL is_tried_connect; |
| 424 | short network_id; |
| 425 | } spot_t; |
| 426 | |
| 427 | |
| 428 | typedef struct spot_ssid_id { |
| 429 | int id; |
| 430 | char ssid[WIFI_STATION_SSID_LEN]; |
| 431 | } spot_ssid_id_t; |
| 432 | #endif |
| 433 | |
| 434 | /*********************station end****************/ |
| 435 | |
| 436 | /*nv set flags */ |
| 437 | |
| 438 | //wifi |
| 439 | |
| 440 | #define NVIO_WIFI_MAX_LEN 200 /*write or read nv length*/ |
| 441 | #define WIFI_PSW_DEFAULT_LENGTH 65 |
| 442 | #define WIFI_STATUS_LEN 2 |
| 443 | #define WIFI_PSW_MIN_LEN 1 |
| 444 | #define WIFI_PSW_MAN_LEN 64 |
| 445 | #define WIFI_CONFIG_DEFAULT_LENGTH 128 |
| 446 | #define WF_WPS_KEY_INDEX_LEN 2 |
| 447 | #define WF_KEY_MODE_LEN 3 |
| 448 | #define WF_WEP_KEY_MAX_LEN 27 |
| 449 | #define WF_WPA_KEY_MAX_LEN 65 |
| 450 | #define WF_ENCRY_TYPE_LEN 16 |
| 451 | #define WF_AU_MODE_LEN 16 |
| 452 | #define WPS_MODE_PIN "PIN" //wps mode |
| 453 | #define WPS_MODE_PBC "PBC" |
| 454 | #define WPS_MODE_AP_PIN "APPIN" |
| 455 | #define WF_AU_OPEN "OPEN" //wifi auth mode? |
| 456 | #define WF_AU_SHARE "SHARED" |
| 457 | #define WF_AU_WEPAUTO "WEPAUTO" |
| 458 | #define WF_AU_WPA "WPAPSK" |
| 459 | #define WF_AU_WPA2 "WPA2PSK" |
| 460 | #define WF_AU_WPA_WPA2 "WPAPSKWPA2PSK" |
| 461 | #define WF_AU_WPA3 "WPA3Personal" |
| 462 | #define WF_AU_WPA2_WPA3 "WPA2WPA3" |
| 463 | #define WF_AU_WAPIPSK "WAPIPSK" |
| 464 | #define WF_ENCRY_NONE "NONE" //encrypt |
| 465 | #define WF_ENCRY_WEP "WEP" |
| 466 | #define WF_ENCRY_TKIP "TKIP" |
| 467 | #define WF_ENCRY_CCMP "CCMP" |
| 468 | #define WF_ENCRY_AES "AES" |
| 469 | #define WF_ENCRY_TKIP_CCMP "TKIPCCMP" |
| 470 | #define WF_ENCRY_TKIP_AES "TKIPAES" |
| 471 | #define WIFI_SSID_INDEX "ssid_index" |
| 472 | #define WIFI_STATION_MAC "mac_addr" |
| 473 | #define WIFI_STATION_HOSTNAME "hostname" |
| 474 | #define WIFI_STATION_IPADDR "ip_addr" |
| 475 | #define WIFI_STATION_CONNECTTIME "connect_time" |
| 476 | #define WIFI_STATION_VALIDTIME "valid_time" |
| 477 | #define WIFI_STATION_IPTYPE "ip_type" |
| 478 | #define WIFI_STATION_DEVTYPE "dev_type" |
| 479 | #define WIFI_NV_ITEM_WIFI_SET_FLAGS "wifi_set_flags" |
| 480 | #define NV_WIFI_SCAN_FINISH "scan_finish" |
| 481 | |
| 482 | #define NV_WIFI_WPA_PASS "WPAPSK1" |
| 483 | #define NV_WIFI_WPA_PASS_ENCODE "WPAPSK1_encode" |
| 484 | #define NV_WIFI_WPA_PASS_M "m_WPAPSK1" |
| 485 | #define NV_WIFI_WPA_PASS_M_ENCODE "m_WPAPSK1_encode" |
| 486 | #define NV_WIFI_COVERAGE "wifi_coverage" |
| 487 | #define NV_WIFI_WPS_STATE "WscModeOption" |
| 488 | #define NV_WIFI_WPS_MODE "wps_mode" |
| 489 | #define NV_WIFI_WPS_SSID "WPS_SSID" |
| 490 | #define NV_WIFI_WPS_INDEX "wifi_wps_index" |
| 491 | #define NV_WIFI_WPS_PIN "wps_pin" |
| 492 | #define NV_WIFI_WPS_AP_PIN "wifi_ap_pin" |
| 493 | #define NV_WIFI_WPS_DEF_PIN "wifi_def_pin" |
| 494 | #define CMD_WIFI_STATION_LIST "station_list" |
| 495 | #define CMD_HOSTNAME_LIST "hostNameList" |
| 496 | #define CMD_WIFI_WPS_AP_PIN "wifi_ap_pin" |
| 497 | #define CMD_WIFI_WPS_AP_DEF_PIN "wifi_def_pin" |
| 498 | |
| 499 | typedef enum { |
| 500 | ZTE_WLAN_SSID_SET = 0x1, |
| 501 | ZTE_WLAN_BROADCAST_SET = 0x2, |
| 502 | ZTE_WLAN_BASIC_SECURITY_SET = 0x4, |
| 503 | ZTE_WLAN_MAX_ACCESS_NUM_SET = 0x8, |
| 504 | |
| 505 | |
| 506 | ZTE_WLAN_ON_OFF_SET = 0x10, |
| 507 | ZTE_WLAN_WIRELESS_MODE_SET = 0x20, |
| 508 | ZTE_WLAN_CHANNEL_SET = 0x40, |
| 509 | ZTE_WLAN_COUNTRY_SET = 0x80, |
| 510 | ZTE_WLAN_WIFI_BAND_SET = 0x100, |
| 511 | |
| 512 | ZTE_WLAN_POWER_SET = 0x1000, |
| 513 | ZTE_WLAN_ACL_SET = 0x2000, |
| 514 | ZTE_WLAN_WPS_SET = 0x4000, |
| 515 | ZTE_WLAN_SET_AP_SLEEPTIMER = 0x8000, |
| 516 | |
| 517 | |
| 518 | ZTE_WLAN_SET_AP_MSSID = 0x10000, |
| 519 | |
| 520 | } zte_wlan_set_e_flags; |
| 521 | |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 522 | |
| 523 | //cap:api->wlan_proxy->ap:wlan_server |
| 524 | typedef enum |
| 525 | { |
zw.wang | c08ce04 | 2024-08-08 18:42:05 +0800 | [diff] [blame] | 526 | IN_WIFI_STATUS_DISABLED = 0, |
| 527 | IN_WIFI_STATUS_ENABLED, |
| 528 | IN_WIFI_STATUS_INVALID_MAC, |
| 529 | IN_WIFI_STATUS_DEV_INIT_FAIL, |
| 530 | IN_WIFI_STATUS_FIRMWARE_CRASH, |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 531 | } inner_wifi_status_e; |
| 532 | |
| 533 | //nei bu zhuan huan yong |
| 534 | //same as sc_wifi_ap_index_e |
| 535 | typedef enum |
| 536 | { |
| 537 | IN_WIFI_AP_INDEX_MIN = -1, |
xf.li | 8402749 | 2024-04-09 00:17:51 -0700 | [diff] [blame] | 538 | IN_WIFI_AP_INDEX_AP0 = 0, //2.4G |
| 539 | IN_WIFI_AP_INDEX_AP1, //5G |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 540 | IN_WIFI_AP_INDEX_MAX |
| 541 | } inner_wifi_ap_id_e; |
| 542 | |
| 543 | typedef struct { |
| 544 | int idx; //refers to: wlan0,1... |
| 545 | char ssid[WIFI_SSID_LEN]; //ssid should be less than 32 bytes |
| 546 | } wlan_ap_ssid_t; |
| 547 | |
| 548 | typedef struct { |
| 549 | int idx; //refers to: wlan0,1... |
| 550 | int ssid_hide; //0 not hide, 1 hide |
| 551 | } wlan_ap_ssid_hide_t; |
| 552 | |
| 553 | typedef struct { |
| 554 | int idx; //refers to: wlan0,1... |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 555 | int wl_mode; //2.4G: 6 bgnax, 4 bgn; 5G: 6 a/n/ac/ax, 5 a/n/ac, 4 a/n |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 556 | } wlan_ap_wl_mode_t; |
| 557 | |
| 558 | typedef struct { |
| 559 | int idx; //refers to: wlan0,1... |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 560 | int htMode; //4 20/40/80M, 1 20/40M, 0 20M |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 561 | //int force_40m; |
| 562 | } wlan_ap_bandwidth_t; |
| 563 | |
| 564 | typedef struct { |
| 565 | int idx; //refers to: wlan0,1... |
| 566 | int max_sta_num; //1-32 |
| 567 | } wlan_ap_max_sta_t; |
| 568 | |
| 569 | typedef struct { |
| 570 | int idx; //refers to: wlan0,1... |
| 571 | char countrycode[3]; //default CN |
| 572 | int channel; //0-13 |
| 573 | } wlan_ap_cc_ch_t; |
| 574 | |
| 575 | typedef struct { |
| 576 | int idx; //refers to: wlan0,1... |
| 577 | int acl_rule; //0 none, 1 white, 2 black |
| 578 | char acl_list[360]; //max 10 mac1;mac2... |
| 579 | } wlan_ap_acl_t; |
| 580 | |
| 581 | typedef struct { |
| 582 | int idx; //refers to: wlan0,1... |
| 583 | char authmode[WLAN_SECURITY_LEN]; |
| 584 | char encrypt[WLAN_ENCRYPT_LEN]; //realtek use |
| 585 | char pwd[WLAN_PSK_LEN]; //max 64 |
| 586 | } wlan_ap_auth_t; |
| 587 | |
| 588 | typedef struct { |
| 589 | int idx; //refers to: wlan0,1... |
| 590 | int enable; //1 ap on , 0 ap off |
| 591 | } wlan_ap_enable_t; |
| 592 | |
| 593 | //station |
| 594 | typedef struct { |
| 595 | int enable; //1 ap on , 0 ap off |
| 596 | } wlan_sta_enable_t; |
| 597 | |
| 598 | |
| 599 | //ap->cap:ind |
| 600 | //½á¹¹Ìå,ºÃÀ©Õ¹ |
| 601 | typedef struct { |
| 602 | int wifi_status; |
| 603 | } wlan_status_t; |
| 604 | |
| 605 | //same as sc_wifi_work_mode_e to do: hu huan |
| 606 | typedef enum |
| 607 | { |
| 608 | IN_WIFI_WORK_MODE_MIN = -1, |
xf.li | 8402749 | 2024-04-09 00:17:51 -0700 | [diff] [blame] | 609 | IN_WIFI_WORK_MODE_AP0 = 0, //2.4G single ap / ap+sta |
| 610 | IN_WIFI_WORK_MODE_AP1, //5G single ap / ap+sta |
zw.wang | c08ce04 | 2024-08-08 18:42:05 +0800 | [diff] [blame] | 611 | IN_WIFI_WORK_MODE_STA, |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 612 | IN_WIFI_WORK_MODE_MAX |
| 613 | } inner_wifi_work_mode_e; |
| 614 | |
| 615 | //same as sc_wifi_ap_status_e |
| 616 | typedef enum |
| 617 | { |
| 618 | IN_WIFI_AP_STATUS_NONE = 0, |
| 619 | IN_WIFI_AP_STATUS_IDLE, //or disable |
| 620 | IN_WIFI_AP_STATUS_ENABLING, |
| 621 | IN_WIFI_AP_STATUS_ENABLED, |
| 622 | IN_WIFI_AP_STATUS_DISABLING, |
| 623 | IN_WIFI_AP_STATUS_ERROR |
| 624 | } inner_wifi_ap_status_e; |
| 625 | |
| 626 | typedef struct { |
| 627 | int idx; |
| 628 | int pre_status; //½öcap×ÔÐи³Öµ |
| 629 | int status; |
| 630 | char ifname[32]; |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 631 | char bssid[18]; //½öcap×ÔÐи³Öµ |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 632 | } wlan_ap_status_t; |
| 633 | |
| 634 | //sc_wifi_sta_connect_status_t |
| 635 | typedef struct { |
| 636 | int idx; |
| 637 | int is_connected; |
| 638 | char macaddr[18]; |
| 639 | } wlan_sta_connect_status_t; |
| 640 | |
| 641 | //cap station |
| 642 | typedef struct { |
| 643 | char ssid[WIFI_SSID_LEN]; //ssid should be less than 32 bytes |
| 644 | char authmode[WLAN_SECURITY_LEN]; |
| 645 | char encrypt[WLAN_ENCRYPT_LEN]; //realtek use |
| 646 | char pwd[WLAN_PSK_LEN]; //max 64 |
| 647 | } wlan_sta_param_t; |
| 648 | |
| 649 | //same as sc_wifi_sta_status_e |
| 650 | typedef enum |
| 651 | { |
| 652 | IN_WIFI_STA_STATUS_NONE, //close |
| 653 | IN_WIFI_STA_STATUS_IDLE, |
| 654 | IN_WIFI_STA_STATUS_CONNECTING, //Trying to associate with |
| 655 | IN_WIFI_STA_STATUS_ASSOCIATED, //dhcping |
| 656 | IN_WIFI_STA_STATUS_CONNECTED, |
| 657 | IN_WIFI_STA_STATUS_DISCONNECTED, |
| 658 | IN_WIFI_STA_STATUS_ERROR |
| 659 | } in_wifi_sta_status_e; |
| 660 | |
| 661 | //same as sc_wifi_reason_code_e |
| 662 | typedef enum |
| 663 | { |
| 664 | IN_WIFI_REASON_CODE_NONE, |
| 665 | IN_WIFI_REASON_CODE_WRONG_KEY, |
| 666 | IN_WIFI_REASON_CODE_AUTH_FAILED, |
| 667 | IN_WIFI_REASON_CODE_CONN_FAILED, |
| 668 | IN_WIFI_REASON_CODE_SET_FAILED, |
| 669 | IN_WIFI_REASON_CODE_DHCP_FAILED |
| 670 | } in_wifi_reason_code_e; |
| 671 | |
xf.li | be70461 | 2024-05-28 19:09:12 -0700 | [diff] [blame] | 672 | typedef struct |
| 673 | { |
| 674 | char addr[16]; //255.255.255.255 16 IPV4ADDLEN_MAX |
| 675 | char netmask[16]; |
| 676 | unsigned char subnet_bits; //255.255.255.0 is 24 |
| 677 | char gateway[16]; |
| 678 | char dnsp[16]; //primary DNS |
| 679 | char dnss[16]; //secondary DNS |
| 680 | } in_wifi_net_addr_t; |
| 681 | |
| 682 | typedef struct |
| 683 | { |
| 684 | char addr[48]; //0001:0002:0003:0004:0001:0002:0003:0004 40 (+8:, 48) |
| 685 | char prefix[48]; |
| 686 | unsigned char prefix_bits; |
| 687 | char gateway[48]; |
| 688 | char dnsp[48]; //primary DNS |
| 689 | char dnss[48]; //secondary DNS |
| 690 | } in_wifi_net_addr6_t; |
| 691 | |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 692 | //same as sc_wifi_sta_status_t |
| 693 | typedef struct { |
| 694 | int pre_status; //proxy record |
| 695 | |
| 696 | int status; //in_wifi_sta_status_e |
| 697 | char ifname[32]; |
| 698 | char ap_bssid[18]; //cur ap mac |
xf.li | be70461 | 2024-05-28 19:09:12 -0700 | [diff] [blame] | 699 | int rssi; |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 700 | unsigned char signal_level; |
| 701 | unsigned char has_addr; |
xf.li | be70461 | 2024-05-28 19:09:12 -0700 | [diff] [blame] | 702 | in_wifi_net_addr_t addr; |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 703 | unsigned char has_addr6; |
xf.li | be70461 | 2024-05-28 19:09:12 -0700 | [diff] [blame] | 704 | in_wifi_net_addr6_t addr6; |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 705 | int reason_code; //in_wifi_reason_code_e |
| 706 | } wlan_sta_status_t; |
| 707 | |
| 708 | typedef struct { |
zw.wang | c08ce04 | 2024-08-08 18:42:05 +0800 | [diff] [blame] | 709 | int rssi; |
| 710 | } wlan_sta_stat_sync_t; |
| 711 | |
| 712 | |
| 713 | typedef struct { |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 714 | int result; |
| 715 | wlan_sta_status_t status; |
| 716 | } scwifi_sta_stat_res_t; |
| 717 | |
| 718 | |
| 719 | #define CAP_WIFI_MAX_SCAN_CNT 30 |
| 720 | |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 721 | #define CAP_WIFI_AUTH_UNSUP -1 //"not support" |
| 722 | #define CAP_WIFI_AUTH_OPEN 0 //"OPEN" |
| 723 | #define CAP_WIFI_AUTH_WPA2 1 //"WPA2PSK" |
| 724 | #define CAP_WIFI_AUTH_WPA3 2 //"WPA3Personal" |
| 725 | #define CAP_WIFI_AUTH_WPA12 3 //"WPAPSKWPA2PSK" |
| 726 | #define CAP_WIFI_AUTH_WPA23 4 //"WPA2WPA3" |
| 727 | |
| 728 | #define CAP_WIFI_ENCRYPT_UNSUP -1 //"not support" |
| 729 | #define CAP_WIFI_ENCRYPT_AUTO 0 //"TKIPCCMP" |
| 730 | #define CAP_WIFI_ENCRYPT_TKIP 1 //"TKIP" |
| 731 | #define CAP_WIFI_ENCRYPT_AES 2 //"CCMP" |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 732 | |
| 733 | //sc_wifi_sta_scan_info_t |
| 734 | typedef struct |
| 735 | { |
| 736 | char bssid[18];//mac |
| 737 | char essid[33]; |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 738 | signed char signal; //dbm |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 739 | unsigned char signal_level; //0-5, max 5 |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 740 | unsigned char channel; //1-13, 36... |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 741 | unsigned char auth; |
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 742 | unsigned char cipher; |
xf.li | f233062 | 2024-05-15 18:17:18 -0700 | [diff] [blame] | 743 | //int frequency; //Hz |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 744 | } wlan_sta_scan_info_t; |
| 745 | |
| 746 | //sc_wifi_sta_scan_list_t |
| 747 | typedef struct |
| 748 | { |
| 749 | int cnt; |
| 750 | wlan_sta_scan_info_t info[CAP_WIFI_MAX_SCAN_CNT]; |
| 751 | } wlan_sta_scan_list_t; |
| 752 | |
xf.li | 8402749 | 2024-04-09 00:17:51 -0700 | [diff] [blame] | 753 | typedef struct { |
zw.wang | c08ce04 | 2024-08-08 18:42:05 +0800 | [diff] [blame] | 754 | int work_mode; //inner_wifi_work_mode_e |
xf.li | 8402749 | 2024-04-09 00:17:51 -0700 | [diff] [blame] | 755 | } wlan_work_mode_t;//scwifi_workmode_t |
| 756 | |
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 757 | #endif |