From de6b7d6520e1759bffb16d2084ea90c8009d067a Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Mon, 15 Apr 2019 16:10:25 +0800 Subject: [PATCH] fix wifi scan and connect bugs: 1. fix the bug block scan tiemout before scan finish 2. make menuconfig can set the WiFi mgmt short buffer num 3. modify wifi reason code 4. fix the bug PMK recal too long --- components/esp32/Kconfig | 7 +++++++ components/esp32/include/esp_wifi.h | 8 ++++++++ components/esp32/include/esp_wifi_types.h | 1 + components/esp32/lib | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 56a743416..a94106aec 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -1180,6 +1180,13 @@ config ESP32_WIFI_IRAM_OPT Select this option to place frequently called Wi-Fi library functions in IRAM. When this option is disabled, more than 10Kbytes of IRAM memory will be saved but Wi-Fi throughput will be reduced. +config ESP32_WIFI_MGMT_SBUF_NUM + int "WiFi mgmt short buffer number" + range 6 32 + default 32 + help + Set the number of WiFi management short buffer. + endmenu # Wi-Fi menu PHY diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index c9899fa7c..3348f8f4e 100644 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -110,6 +110,7 @@ typedef struct { int rx_ba_win; /**< WiFi Block Ack RX window size */ int wifi_task_core_id; /**< WiFi Task Core ID */ int beacon_max_len; /**< WiFi softAP maximum length of the beacon */ + int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */ int magic; /**< WiFi init magic number, it should be the last field */ } wifi_init_config_t; @@ -183,6 +184,12 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; #define WIFI_SOFTAP_BEACON_MAX_LEN 752 #endif +#ifdef CONFIG_ESP32_WIFI_MGMT_SBUF_NUM +#define WIFI_MGMT_SBUF_NUM CONFIG_ESP32_WIFI_MGMT_SBUF_NUM +#else +#define WIFI_MGMT_SBUF_NUM 32 +#endif + #define WIFI_INIT_CONFIG_DEFAULT() { \ .event_handler = &esp_event_send, \ .osi_funcs = &g_wifi_osi_funcs, \ @@ -201,6 +208,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; .rx_ba_win = WIFI_DEFAULT_RX_BA_WIN,\ .wifi_task_core_id = WIFI_TASK_CORE_ID,\ .beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \ + .mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \ .magic = WIFI_INIT_CONFIG_MAGIC\ }; diff --git a/components/esp32/include/esp_wifi_types.h b/components/esp32/include/esp_wifi_types.h index e16ca19bd..f3ccaddce 100644 --- a/components/esp32/include/esp_wifi_types.h +++ b/components/esp32/include/esp_wifi_types.h @@ -93,6 +93,7 @@ typedef enum { WIFI_REASON_AUTH_FAIL = 202, WIFI_REASON_ASSOC_FAIL = 203, WIFI_REASON_HANDSHAKE_TIMEOUT = 204, + WIFI_REASON_CONNECTION_FAIL = 205, } wifi_err_reason_t; typedef enum { diff --git a/components/esp32/lib b/components/esp32/lib index 4b59590d3..1ea7cb773 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 4b59590d302c7cd467d719168185612ce87cbfb8 +Subproject commit 1ea7cb7731136c2f59c9e335e8b490a11773c348