From 335faac23faf5a149d445488a74a4d0eec3c36fe Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 28 May 2024 20:15:52 +0800 Subject: [PATCH 1/5] 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 9a8620b288..79a010aab2 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -1591,7 +1591,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 77b4cfbdc6..9f5e8609e2 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 ce7c53ed88..69faa174c1 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 227e94f934..e17ca37881 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1927,7 +1927,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 c6880601425528668107bc056468403378cea147 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Mon, 4 Mar 2024 20:37:39 +0800 Subject: [PATCH 2/5] fix(doc): update api esp_wifi_sta_get_rssic docs Closes https://github.com/espressif/esp-idf/issues/12685 --- components/esp_wifi/include/esp_wifi.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 0672c01ec7..49cb82f1f6 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -397,6 +397,7 @@ esp_err_t esp_wifi_restore(void); * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_MODE: WiFi mode error * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong * - ESP_ERR_WIFI_SSID: SSID of AP which station connects is invalid */ @@ -1477,9 +1478,10 @@ esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); esp_err_t esp_wifi_set_dynamic_cs(bool enabled); /** - * @brief Get the rssi info after station connected to AP + * @brief Get the rssi information of AP to which the device is associated with * - * @attention This API should be called after station connected to AP. + * @attention 1. This API should be called after station connected to AP. + * @attention 2. Use this API only in WIFI_MODE_STA or WIFI_MODE_APSTA mode. * * @param rssi store the rssi info received from last beacon. * From cd7eb3621a35d3d1402c1d8621d7903b1a6d7626 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 31 May 2024 14:35:55 +0800 Subject: [PATCH 3/5] fix(wifi): fixed disable gcmp choose pairwise cipher wrong issue --- components/esp_wifi/include/esp_wifi.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 49cb82f1f6..9e426843aa 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -237,16 +237,24 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; #define WIFI_FTM_RESPONDER 0 #endif -#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0) +#if CONFIG_GCMP +#define WIFI_ENABLE_GCMP (1<<4) +#else +#define WIFI_ENABLE_GCMP 0 +#endif + +#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0) #define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1) #define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2) #define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3) +#define CONFIG_FEATURE_GCMP_BIT (1<<4) /* Set additional WiFi features and capabilities */ #define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ WIFI_ENABLE_SPIRAM | \ WIFI_FTM_INITIATOR | \ - WIFI_FTM_RESPONDER) + WIFI_FTM_RESPONDER | \ + WIFI_ENABLE_GCMP) #define WIFI_INIT_CONFIG_DEFAULT() { \ .osi_funcs = &g_wifi_osi_funcs, \ From 1f7433975675834916d87934f8a862954fdc02cc Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 4 Jun 2024 17:27:18 +0800 Subject: [PATCH 4/5] fix(wifi): fix configure gcmp failure issue --- components/esp_wifi/Kconfig | 2 +- components/esp_wifi/include/esp_wifi.h | 12 ++++++++++-- components/wpa_supplicant/src/crypto/crypto_ops.c | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index 07437eca57..b173d31f5c 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -385,7 +385,7 @@ menu "Wi-Fi" config ESP_WIFI_GMAC_SUPPORT bool "WiFi GMAC Support(GMAC128 and GMAC256)" - default n + default y help Select this option to enable GMAC support. GMAC support is compulsory for WiFi 192 bit certification. diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 9e426843aa..5c0ea154ef 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -237,24 +237,32 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; #define WIFI_FTM_RESPONDER 0 #endif -#if CONFIG_GCMP +#if CONFIG_ESP_WIFI_GCMP_SUPPORT #define WIFI_ENABLE_GCMP (1<<4) #else #define WIFI_ENABLE_GCMP 0 #endif +#if CONFIG_ESP_WIFI_GMAC_SUPPORT +#define WIFI_ENABLE_GMAC (1<<5) +#else +#define WIFI_ENABLE_GMAC 0 +#endif + #define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0) #define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1) #define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2) #define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3) #define CONFIG_FEATURE_GCMP_BIT (1<<4) +#define CONFIG_FEATURE_GMAC_BIT (1<<5) /* Set additional WiFi features and capabilities */ #define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ WIFI_ENABLE_SPIRAM | \ WIFI_FTM_INITIATOR | \ WIFI_FTM_RESPONDER | \ - WIFI_ENABLE_GCMP) + WIFI_ENABLE_GCMP | \ + WIFI_ENABLE_GMAC) #define WIFI_INIT_CONFIG_DEFAULT() { \ .osi_funcs = &g_wifi_osi_funcs, \ diff --git a/components/wpa_supplicant/src/crypto/crypto_ops.c b/components/wpa_supplicant/src/crypto/crypto_ops.c index 17c052c986..7b3f31a148 100644 --- a/components/wpa_supplicant/src/crypto/crypto_ops.c +++ b/components/wpa_supplicant/src/crypto/crypto_ops.c @@ -43,7 +43,7 @@ static int esp_aes_gmac(const u8 *key, size_t key_len, const u8 *iv, size_t iv_l #if CONFIG_GMAC return aes_gmac(key, key_len, iv, iv_len, aad, aad_len, tag); #else - return 0; + return -1; #endif } From 09054d31d8608174d9e03a05fb5d870c4e1c398f Mon Sep 17 00:00:00 2001 From: muhaidong Date: Fri, 12 Jul 2024 17:51:35 +0800 Subject: [PATCH 5/5] fix(wifi): fix some wifi bugs 240715 1. update api esp_wifi_sta_get_rssi docs 2. fix disable gcmp choose pairwise cipher wrong issue 3. fix sta may join bad signal ap when set by signal --- 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 519d013f59..01b13f0120 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 519d013f59f5ecfea26f32ae15ae948dc5f2b3d7 +Subproject commit 01b13f01207b5d1b2139827590a88c63fe4747fb