From ae246927851f30d1f437b0dd7f41110abc854657 Mon Sep 17 00:00:00 2001 From: xiehang Date: Thu, 24 Dec 2020 11:56:18 +0800 Subject: [PATCH] esp_wifi: Update WiFi lib 1. Add check CSA state before CSA timer process 2. Change wifi scan duration from 120ms to 100ms 3. Using deport reg instead of ahb 4. Check TID in ieee80211_recv_bar() 5. Revert to report specific reason code when receiving deauth during 4-way-handshark 6. Fix the bug that tx ampdu parameter is not from peer device 7. Refactor wifi_interface_t 8. Faster WiFi station connect improvement, avoid 100ms passive scan 9. Add FCS failed packets filter 10.Update esp32 phy lib to v4660 11.Fix csa timer issue 12.Fix country code last byte to space instead of NULL 13.Fix softap cannot forward A-MSDU 14.Fix max tx power to 20dBm 15.Fix the issue that the esp_wifi_sta_get_ap_info can't get country --- components/esp32/include/esp_wifi_types.h | 9 +++++---- components/esp32/lib | 2 +- components/lwip/port/esp32/netif/wlanif.c | 2 +- .../protocols/asio/chat_client/components/wifi_asio.cpp | 2 +- .../protocols/asio/chat_server/components/wifi_asio.cpp | 2 +- .../asio/tcp_echo_server/components/wifi_asio.cpp | 2 +- .../asio/udp_echo_server/components/wifi_asio.cpp | 2 +- examples/protocols/asio/wifi_init/wifi_asio.cpp | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/components/esp32/include/esp_wifi_types.h b/components/esp32/include/esp_wifi_types.h index 9b6b08e777..5725cf8516 100644 --- a/components/esp32/include/esp_wifi_types.h +++ b/components/esp32/include/esp_wifi_types.h @@ -33,10 +33,10 @@ typedef enum { WIFI_MODE_MAX } wifi_mode_t; -typedef esp_interface_t wifi_interface_t; - -#define WIFI_IF_STA ESP_IF_WIFI_STA -#define WIFI_IF_AP ESP_IF_WIFI_AP +typedef enum { + WIFI_IF_STA = ESP_IF_WIFI_STA, + WIFI_IF_AP = ESP_IF_WIFI_AP, +} wifi_interface_t; typedef enum { WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */ @@ -364,6 +364,7 @@ typedef enum { #define WIFI_PROMIS_FILTER_MASK_MISC (1<<3) /**< filter the packets with type of WIFI_PKT_MISC */ #define WIFI_PROMIS_FILTER_MASK_DATA_MPDU (1<<4) /**< filter the MPDU which is a kind of WIFI_PKT_DATA */ #define WIFI_PROMIS_FILTER_MASK_DATA_AMPDU (1<<5) /**< filter the AMPDU which is a kind of WIFI_PKT_DATA */ +#define WIFI_PROMIS_FILTER_MASK_FCSFAIL (1<<6) /**< filter the FCS failed packets, do not open it in general */ #define WIFI_PROMIS_CTRL_FILTER_MASK_ALL (0xFF800000) /**< filter all control packets */ #define WIFI_PROMIS_CTRL_FILTER_MASK_WRAPPER (1<<23) /**< filter the control packets with subtype of Control Wrapper */ diff --git a/components/esp32/lib b/components/esp32/lib index a88a4f3101..c323de3a27 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit a88a4f31015e667fa6ca93aca38a86d85e90aa9d +Subproject commit c323de3a272ff064f72fdb99f45d2e3ec32f6b88 diff --git a/components/lwip/port/esp32/netif/wlanif.c b/components/lwip/port/esp32/netif/wlanif.c index ed5e13ed12..8966297b05 100644 --- a/components/lwip/port/esp32/netif/wlanif.c +++ b/components/lwip/port/esp32/netif/wlanif.c @@ -114,7 +114,7 @@ low_level_output(struct netif *netif, struct pbuf *p) struct pbuf *q = p; err_t ret; - if (wifi_if >= ESP_IF_MAX) { + if (wifi_if > WIFI_IF_AP) { return ERR_IF; } diff --git a/examples/protocols/asio/chat_client/components/wifi_asio.cpp b/examples/protocols/asio/chat_client/components/wifi_asio.cpp index c8d6832a32..f2a0325f22 100644 --- a/examples/protocols/asio/chat_client/components/wifi_asio.cpp +++ b/examples/protocols/asio/chat_client/components/wifi_asio.cpp @@ -95,7 +95,7 @@ void wifi_init_sta() strcpy((char*)(wifi_config.sta.password), EXAMPLE_ESP_WIFI_PASS); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished."); diff --git a/examples/protocols/asio/chat_server/components/wifi_asio.cpp b/examples/protocols/asio/chat_server/components/wifi_asio.cpp index c8d6832a32..f2a0325f22 100644 --- a/examples/protocols/asio/chat_server/components/wifi_asio.cpp +++ b/examples/protocols/asio/chat_server/components/wifi_asio.cpp @@ -95,7 +95,7 @@ void wifi_init_sta() strcpy((char*)(wifi_config.sta.password), EXAMPLE_ESP_WIFI_PASS); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished."); diff --git a/examples/protocols/asio/tcp_echo_server/components/wifi_asio.cpp b/examples/protocols/asio/tcp_echo_server/components/wifi_asio.cpp index c8d6832a32..f2a0325f22 100644 --- a/examples/protocols/asio/tcp_echo_server/components/wifi_asio.cpp +++ b/examples/protocols/asio/tcp_echo_server/components/wifi_asio.cpp @@ -95,7 +95,7 @@ void wifi_init_sta() strcpy((char*)(wifi_config.sta.password), EXAMPLE_ESP_WIFI_PASS); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished."); diff --git a/examples/protocols/asio/udp_echo_server/components/wifi_asio.cpp b/examples/protocols/asio/udp_echo_server/components/wifi_asio.cpp index c8d6832a32..f2a0325f22 100644 --- a/examples/protocols/asio/udp_echo_server/components/wifi_asio.cpp +++ b/examples/protocols/asio/udp_echo_server/components/wifi_asio.cpp @@ -95,7 +95,7 @@ void wifi_init_sta() strcpy((char*)(wifi_config.sta.password), EXAMPLE_ESP_WIFI_PASS); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished."); diff --git a/examples/protocols/asio/wifi_init/wifi_asio.cpp b/examples/protocols/asio/wifi_init/wifi_asio.cpp index c8d6832a32..f2a0325f22 100644 --- a/examples/protocols/asio/wifi_init/wifi_asio.cpp +++ b/examples/protocols/asio/wifi_init/wifi_asio.cpp @@ -95,7 +95,7 @@ void wifi_init_sta() strcpy((char*)(wifi_config.sta.password), EXAMPLE_ESP_WIFI_PASS); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished.");