From 2130416e2e5610dc54cb91b5804bdeff32642d7b Mon Sep 17 00:00:00 2001 From: aditi_lonkar Date: Mon, 6 Nov 2023 11:17:01 +0530 Subject: [PATCH 01/10] fix(wifi):Fix for setting wps status fail when connection fails --- .../esp_wifi/include/esp_wifi_types_generic.h | 1 + components/esp_wifi/lib | 2 +- .../esp_supplicant/src/esp_wpa_main.c | 6 +++++ .../esp_supplicant/src/esp_wps.c | 23 +++++++++++++++++++ .../esp_supplicant/src/esp_wps_i.h | 5 ++++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index 97bb8542ed..d1ea00f9a2 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -879,6 +879,7 @@ typedef struct { typedef enum { WPS_FAIL_REASON_NORMAL = 0, /**< WPS normal fail reason */ WPS_FAIL_REASON_RECV_M2D, /**< WPS receive M2D frame */ + WPS_FAIL_REASON_RECV_DEAUTH, /**< Recv deauth from AP while wps handshake */ WPS_FAIL_REASON_MAX } wifi_event_sta_wps_fail_reason_t; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 17509c30ae..7fbc7d9f5a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 17509c30aecde2c38bf4d3cc3e860b9297cf23e8 +Subproject commit 7fbc7d9f5a205177f28c4ce48e67d9eaa28908d8 diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c index 8dd2596ed7..7972a6c93f 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c @@ -33,6 +33,7 @@ #include "esp_owe_i.h" #include "esp_wps.h" +#include "esp_wps_i.h" #include "eap_server/eap.h" #include "eapol_auth/eapol_auth_sm.h" #include "ap/ieee802_1x.h" @@ -303,6 +304,11 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code) } break; } + + struct wps_sm_funcs *wps_sm_cb = wps_get_wps_sm_cb(); + if (wps_sm_cb && wps_sm_cb->wps_sm_notify_deauth) { + wps_sm_cb->wps_sm_notify_deauth(); + } #ifdef CONFIG_OWE_STA owe_deinit(); #endif /* CONFIG_OWE_STA */ diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 54a01e741b..b68c2403c1 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -45,6 +45,7 @@ struct wps_rx_param { }; static STAILQ_HEAD(, wps_rx_param) s_wps_rxq; +static struct wps_sm_funcs *s_wps_sm_cb = NULL; static void *s_wps_task_hdl = NULL; static void *s_wps_queue = NULL; static void *s_wps_data_lock = NULL; @@ -839,6 +840,13 @@ int wps_finish(void) return ret; } +static void wps_sm_notify_deauth(void) +{ + if (gWpsSm && gWpsSm->wps->state != WPS_FINISHED) { + wps_stop_process(WPS_FAIL_REASON_RECV_DEAUTH); + } +} + /* Add current ap to discard ap list */ void wps_add_discard_ap(u8 *bssid) { @@ -1385,6 +1393,11 @@ int wps_init_cfg_pin(struct wps_config *cfg) return 0; } +struct wps_sm_funcs* wps_get_wps_sm_cb(void) +{ + return s_wps_sm_cb; +} + static int wifi_station_wps_init(const esp_wps_config_t *config) { struct wps_funcs *wps_cb; @@ -1466,6 +1479,12 @@ static int wifi_station_wps_init(const esp_wps_config_t *config) wps_cb->wps_start_pending = wps_start_pending; esp_wifi_set_wps_cb_internal(wps_cb); + s_wps_sm_cb = os_malloc(sizeof(struct wps_sm_funcs)); + if (s_wps_sm_cb == NULL) { + goto _err; + } + s_wps_sm_cb->wps_sm_notify_deauth = wps_sm_notify_deauth; + return ESP_OK; _err: @@ -1539,6 +1558,10 @@ wifi_station_wps_deinit(void) wps_deinit(sm->wps); sm->wps = NULL; } + if (s_wps_sm_cb) { + os_free(s_wps_sm_cb); + s_wps_sm_cb = NULL; + } os_free(gWpsSm); gWpsSm = NULL; diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps_i.h b/components/wpa_supplicant/esp_supplicant/src/esp_wps_i.h index a59dc897f9..4ffbb8b4dd 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps_i.h +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps_i.h @@ -118,6 +118,11 @@ int wps_sm_rx_eapol(u8 *src_addr, u8 *buf, u32 len); int wps_dev_deinit(struct wps_device_data *dev); int wps_dev_init(void); int wps_set_factory_info(const esp_wps_config_t *config); +struct wps_sm_funcs { + void (*wps_sm_notify_deauth)(void); +}; + +struct wps_sm_funcs* wps_get_wps_sm_cb(void); static inline int wps_get_type(void) { From 20932eceaf8efecd5ee79e9d31b1a9873868a908 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 28 May 2024 20:15:52 +0800 Subject: [PATCH 02/10] fix(wifi): annotate a rom function --- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 2 +- components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld | 2 +- components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index 6d813e541d..3079594ffa 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -1517,7 +1517,7 @@ trc_SetTxAmpduState = 0x40001ccc; trc_tid_isTxAmpduOperational = 0x40001cd0; trcAmpduSetState = 0x40001cd4; wDevCheckBlockError = 0x40001cd8; -wDev_AppendRxBlocks = 0x40001cdc; +/*wDev_AppendRxBlocks = 0x40001cdc;*/ wDev_DiscardFrame = 0x40001ce0; wDev_GetNoiseFloor = 0x40001ce4; wDev_IndicateAmpdu = 0x40001ce8; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index 60c97f4923..4fd9d58bb3 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -1623,7 +1623,7 @@ TRC_PER_IS_GOOD = 0x400017a4; trc_SetTxAmpduState = 0x400017a8; trc_tid_isTxAmpduOperational = 0x400017ac; trcAmpduSetState = 0x400017b0; -wDev_AppendRxBlocks = 0x400017b8; +/*wDev_AppendRxBlocks = 0x400017b8;*/ wDev_DiscardFrame = 0x400017bc; wDev_GetNoiseFloor = 0x400017c0; wDev_IndicateAmpdu = 0x400017c4; diff --git a/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld b/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld index 30dedb924c..24ae23143f 100644 --- a/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld +++ b/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld @@ -145,7 +145,7 @@ trc_SetTxAmpduState = 0x40000dc4; trc_tid_isTxAmpduOperational = 0x40000dc8; trcAmpduSetState = 0x40000dcc; //wDevCheckBlockError = 0x40000dd0; -wDev_AppendRxBlocks = 0x40000dd4; +/*wDev_AppendRxBlocks = 0x40000dd4;*/ wDev_DiscardFrame = 0x40000dd8; wDev_GetNoiseFloor = 0x40000ddc; wDev_IndicateAmpdu = 0x40000de0; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index 9f23d00f6b..8fbddf7f02 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1904,7 +1904,7 @@ trc_SetTxAmpduState = 0x40005838; trc_tid_isTxAmpduOperational = 0x40005844; trcAmpduSetState = 0x40005850; wDevCheckBlockError = 0x4000585c; -wDev_AppendRxBlocks = 0x40005868; +/*wDev_AppendRxBlocks = 0x40005868;*/ wDev_DiscardFrame = 0x40005874; wDev_GetNoiseFloor = 0x40005880; wDev_IndicateAmpdu = 0x4000588c; From 9e0064ba208caaf761a8530c516f2ede1236e3fc Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Mon, 8 Jul 2024 14:01:31 +0800 Subject: [PATCH 03/10] fix(wifi/mesh): fix the issue that xon request timeout constantly when root reboot Closes https://github.com/espressif/esp-idf/issues/13212 --- components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld | 2 +- components/esp_wifi/lib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld b/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld index 7c961407ce..3a6126a907 100644 --- a/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld +++ b/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld @@ -142,7 +142,7 @@ pm_extend_tbtt_adaptive_servo = 0x40000dc8; /*pm_scale_listen_interval = 0x40000dcc;*/ pm_parse_mbssid_element = 0x40000dd0; pm_disconnected_wake = 0x40000dd4; -pm_tx_data_process = 0x40000dd8; +/*pm_tx_data_process = 0x40000dd8;*/ pm_is_twt_awake = 0x40000ddc; pm_enable_twt_keep_alive = 0x40000de0; pm_twt_on_tsf_timer = 0x40000de4; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 7fbc7d9f5a..d61cf9d3dd 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 7fbc7d9f5a205177f28c4ce48e67d9eaa28908d8 +Subproject commit d61cf9d3dd5ea1f080034335170b8b01be35bcb3 From 1191a9e1c5e3d968f0dddd5ad0c166be32d517cb Mon Sep 17 00:00:00 2001 From: Shreyas Sheth Date: Wed, 19 Jun 2024 17:10:19 +0530 Subject: [PATCH 04/10] fix(wifi): Ignore 11R, ENT AP when disabled in sdkconfig --- components/esp_wifi/include/esp_wifi.h | 18 +++++++++++++++++- components/esp_wifi/lib | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index b9589ad70d..7f8cde1c85 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -254,6 +254,18 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; #define WIFI_ENABLE_GMAC 0 #endif +#if CONFIG_ESP_WIFI_11R_SUPPORT +#define WIFI_ENABLE_11R (1<<6) +#else +#define WIFI_ENABLE_11R 0 +#endif + +#if CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT +#define WIFI_ENABLE_ENTERPRISE (1<<7) +#else +#define WIFI_ENABLE_ENTERPRISE 0 +#endif + #if CONFIG_ESP_WIFI_ENABLE_DUMP_HESIGB && !WIFI_CSI_ENABLED #define WIFI_DUMP_HESIGB_ENABLED true #else @@ -272,6 +284,8 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; #define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3) #define CONFIG_FEATURE_GCMP_BIT (1<<4) #define CONFIG_FEATURE_GMAC_BIT (1<<5) +#define CONFIG_FEATURE_11R_BIT (1<<6) +#define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7) /* Set additional WiFi features and capabilities */ #define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ @@ -279,7 +293,9 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; WIFI_FTM_INITIATOR | \ WIFI_FTM_RESPONDER | \ WIFI_ENABLE_GCMP | \ - WIFI_ENABLE_GMAC) + WIFI_ENABLE_GMAC | \ + WIFI_ENABLE_11R | \ + WIFI_ENABLE_ENTERPRISE) #define WIFI_INIT_CONFIG_DEFAULT() { \ .osi_funcs = &g_wifi_osi_funcs, \ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index d61cf9d3dd..4097d08195 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit d61cf9d3dd5ea1f080034335170b8b01be35bcb3 +Subproject commit 4097d0819517d34a6977d4159f5a1fb8a8a8ebdd From 6bb959e7ee011b85748d2a512a57c94cb0e9cf1c Mon Sep 17 00:00:00 2001 From: "wangtao@espressif.com" Date: Wed, 10 Jul 2024 10:51:44 +0800 Subject: [PATCH 05/10] fix(wifi):fix get softap dtim and csa config err --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 4097d08195..17ffa928bb 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 4097d0819517d34a6977d4159f5a1fb8a8a8ebdd +Subproject commit 17ffa928bbe8364a13689a77691bd1dbf294e211 From ecde808af9a3cc66994e04eb1d15246515ea38c2 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Wed, 10 Jul 2024 16:43:54 +0800 Subject: [PATCH 06/10] fix(wifi): fixed association refused temporarily issue 1. fixed association refused temporarily issue. 2. give some information when password length mismatch authmode threshold --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 17ffa928bb..08b353273e 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 17ffa928bbe8364a13689a77691bd1dbf294e211 +Subproject commit 08b353273e9190e1f8340b04b63d032c1f2c5516 From 240d300d6484a301347dda3b57a797ce00aa1e58 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Wed, 10 Jul 2024 20:37:50 +0800 Subject: [PATCH 07/10] fix(wifi): fix reset connection dns fail issue Closes https://github.com/espressif/esp-idf/issues/12315 --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 08b353273e..74f99e0833 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 08b353273e9190e1f8340b04b63d032c1f2c5516 +Subproject commit 74f99e08335671447b5eac243c8dd643c1405a63 From b072ccac62769c23f9a2a811b74ac8f8fedaf429 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 12 Jul 2024 17:51:35 +0800 Subject: [PATCH 08/10] fix(wifi): fix sta may join bad signal ap when set by signal Closes https://github.com/espressif/esp-idf/issues/13958 --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 74f99e0833..76bdd0b967 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 74f99e08335671447b5eac243c8dd643c1405a63 +Subproject commit 76bdd0b967afa7d75c9466ab0ad05601418a074d From 9db556c20e7290072d6ec9b21092dce7e030b1f1 Mon Sep 17 00:00:00 2001 From: sibeibei Date: Mon, 15 Jul 2024 16:20:01 +0800 Subject: [PATCH 09/10] fix(pm): ssn update failed when dut wakeup from lightsleep --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 76bdd0b967..eff8552fc2 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 76bdd0b967afa7d75c9466ab0ad05601418a074d +Subproject commit eff8552fc2c890de9304250192e542d7a38c3480 From 2c4812092d7d43f27d1edd9744bf0e721846056d Mon Sep 17 00:00:00 2001 From: liuning Date: Fri, 19 Jul 2024 19:23:58 +0800 Subject: [PATCH 10/10] fix(coex): fix esp32 crash issue, fix esp32c6 rx issue --- components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld | 2 +- components/esp_wifi/lib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld b/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld index 3a6126a907..54d3ae9e75 100644 --- a/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld +++ b/components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld @@ -260,7 +260,7 @@ trcAmpduSetState = 0x40000fa0; trc_set_bf_report_rate = 0x40000fa4; trc_onPPTxDone = 0x40000fa8; wDevCheckBlockError = 0x40000fac; -wDev_AppendRxBlocks = 0x40000fb0; +/*wDev_AppendRxBlocks = 0x40000fb0;*/ wDev_DiscardFrame = 0x40000fb4; wDev_GetNoiseFloor = 0x40000fb8; wDev_IndicateAmpdu = 0x40000fbc; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index eff8552fc2..ce181b3e94 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit eff8552fc2c890de9304250192e542d7a38c3480 +Subproject commit ce181b3e947d3d8495c17b9881930816bb94ed58