Merge branch 'bugfix/multiple_wifi_fixes_v5.0_wave2' into 'release/v5.0'

esp_wifi : update wifi lib

See merge request espressif/esp-idf!21427
This commit is contained in:
Jiang Jiang Jian 2022-12-06 15:25:55 +08:00
commit 4757c9e389
16 changed files with 69 additions and 33 deletions

View File

@ -1716,7 +1716,7 @@ ic_reset_rx_ba = 0x4000184c;
ieee80211_align_eb = 0x40001850;
ieee80211_ampdu_reorder = 0x40001854;
ieee80211_ampdu_start_age_timer = 0x40001858;
ieee80211_encap_esfbuf = 0x4000185c;
/*ieee80211_encap_esfbuf = 0x4000185c;*/
ieee80211_is_tx_allowed = 0x40001860;
ieee80211_output_pending_eb = 0x40001864;
ieee80211_output_process = 0x40001868;

View File

@ -385,4 +385,19 @@ menu "Wi-Fi"
Delta timeout time for rf phy off, When the beacon is lost, the next rf phy off will
be delayed for the time specified by the configuration item. Unit: 1024 microsecond.
config ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM
int "Maximum espnow encrypt peers number"
range 0 4 if IDF_TARGET_ESP32C2
range 0 16 if (!IDF_TARGET_ESP32C2)
default 2 if IDF_TARGET_ESP32C2
default 6 if !IDF_TARGET_ESP32C2
help
Maximum number of encrypted peers supported by espnow.
The number of hardware keys for encryption is fixed. And the espnow and SoftAP share the same
hardware keys. So this configuration will affect the maximum connection number of SoftAP.
Maximum espnow encrypted peers number + maximum number of connections of SoftAP = Max hardware keys number.
When using ESP mesh, this value should be set to a maximum of 6.
endmenu # Wi-Fi

View File

@ -1,16 +1,8 @@
// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __ESP_MESH_INTERNAL_H__
#define __ESP_MESH_INTERNAL_H__
@ -107,6 +99,9 @@ typedef struct {
mesh_chain_layer_t chain;
} __attribute__((packed)) mesh_chain_assoc_t;
/* mesh max connections */
#define MESH_MAX_CONNECTIONS (10)
/**
* @brief Mesh PS duties
*/
@ -117,7 +112,7 @@ typedef struct {
bool used;
uint8_t duty;
uint8_t mac[6];
} child[ESP_WIFI_MAX_CONN_NUM];
} child[MESH_MAX_CONNECTIONS];
} esp_mesh_ps_duties_t;
/*******************************************************

View File

@ -107,6 +107,7 @@ typedef struct {
int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */
uint64_t feature_caps; /**< Enables additional WiFi features and capabilities */
bool sta_disconnected_pm; /**< WiFi Power Management for station at disconnected status */
int espnow_max_encrypt_num; /**< Maximum encrypt number of peers supported by espnow */
int magic; /**< WiFi init magic number, it should be the last field */
} wifi_init_config_t;
@ -225,6 +226,7 @@ extern uint64_t g_wifi_feature_caps;
.mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \
.feature_caps = g_wifi_feature_caps, \
.sta_disconnected_pm = WIFI_STA_DISCONNECTED_PM_ENABLED, \
.espnow_max_encrypt_num = CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM, \
.magic = WIFI_INIT_CONFIG_MAGIC\
}

View File

@ -284,7 +284,8 @@ typedef struct {
uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */
uint32_t ft_enabled:1; /**< Whether FT is enabled for the connection */
uint32_t owe_enabled:1; /**< Whether OWE is enabled for the connection */
uint32_t reserved:27; /**< Reserved for future feature set */
uint32_t transition_disable:1; /**< Whether to enable transition disable feature */
uint32_t reserved:26; /**< Reserved for future feature set */
wifi_sae_pwe_method_t sae_pwe_h2e; /**< Whether SAE hash to element is enabled */
uint8_t failure_retry_cnt; /**< Number of connection retries station will do before moving to next AP. scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. Note: Enabling this may cause connection time to increase incase best AP doesn't behave properly. */
} wifi_sta_config_t;
@ -315,7 +316,7 @@ typedef struct {
#if CONFIG_IDF_TARGET_ESP32C2
#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */
#else
#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32 soft-AP */
#define ESP_WIFI_MAX_CONN_NUM (16) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2/ESP32C3 soft-AP */
#endif
/** @brief List of stations associated with the ESP32 Soft-AP */

@ -1 +1 @@
Subproject commit b10fa11471b69b82f9599aa2941e1c353bd517c1
Subproject commit f3e2f7fac3b27671f45ef368b49264d1477efbd9

View File

@ -281,5 +281,6 @@ void esp_wifi_get_pmf_config_internal(wifi_pmf_config_t *pmf_cfg, uint8_t ifx);
bool esp_wifi_is_ft_enabled_internal(uint8_t if_index);
uint8_t esp_wifi_sta_get_config_sae_pwe_h2e_internal(void);
uint8_t esp_wifi_sta_get_use_h2e_internal(void);
void esp_wifi_sta_disable_wpa2_authmode_internal(void);
#endif /* _ESP_WIFI_DRIVER_H_ */

View File

@ -93,6 +93,15 @@ int hostapd_send_eapol(const u8 *source, const u8 *sta_addr,
}
void wpa_supplicant_transition_disable(void *sm, u8 bitmap)
{
wpa_printf(MSG_INFO, "TRANSITION_DISABLE %02x", bitmap);
if (bitmap & TRANSITION_DISABLE_WPA3_PERSONAL) {
esp_wifi_sta_disable_wpa2_authmode_internal();
}
}
u8 *wpa_sm_alloc_eapol(struct wpa_sm *sm, u8 type,
const void *data, u16 data_len,
size_t *msg_len, void **data_pos)

View File

@ -31,6 +31,8 @@ void wpa_free_eapol(u8 *buffer);
int wpa_ether_send(void *ctx, const u8 *dest, u16 proto,
const u8 *data, size_t data_len);
void wpa_supplicant_transition_disable(void *sm, u8 bitmap);
int hostapd_send_eapol(const u8 *source, const u8 *sta_addr,
const u8 *data, size_t data_len);
#endif /* WPAS_GLUE_H */

View File

@ -94,6 +94,8 @@ RSN_SELECTOR(0x00, 0x0f, 0xac, 13)
#define RSN_KEY_DATA_IGTK RSN_SELECTOR(0x00, 0x0f, 0xac, 9)
#endif /* CONFIG_IEEE80211W */
#define WFA_KEY_DATA_TRANSITION_DISABLE RSN_SELECTOR(0x50, 0x6f, 0x9a, 0x20)
#define WPA_OUI_TYPE RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
@ -305,6 +307,9 @@ struct rsn_rdie {
#endif /* CONFIG_IEEE80211R */
/* WFA Transition Disable KDE (using OUI_WFA) */
/* Transition Disable Bitmap bits */
#define TRANSITION_DISABLE_WPA3_PERSONAL BIT(0)
#ifdef CONFIG_IEEE80211R
int wpa_ft_mic(const u8 *kck, size_t kck_len, const u8 *sta_addr,

View File

@ -1305,6 +1305,10 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
goto failed;
}
if (ie.transition_disable) {
wpa_supplicant_transition_disable(sm, ie.transition_disable[0]);
}
if (sm->key_install && sm->key_info & WPA_KEY_INFO_INSTALL && sm->use_ext_key_id) {
wpa_supplicant_install_ptk(sm, KEY_FLAG_RX);
}

View File

@ -383,6 +383,15 @@ static int wpa_parse_generic(const u8 *pos, const u8 *end,
return 0;
}
#endif
if (pos[1] >= RSN_SELECTOR_LEN + 1 &&
RSN_SELECTOR_GET(pos + 2) == WFA_KEY_DATA_TRANSITION_DISABLE) {
ie->transition_disable = pos + 2 + RSN_SELECTOR_LEN;
ie->transition_disable_len = pos[1] - RSN_SELECTOR_LEN;
wpa_hexdump(MSG_DEBUG,
"WPA: Transition Disable KDE in EAPOL-Key",
pos, pos[1] + 2);
return 0;
}
return 0;
}

View File

@ -37,6 +37,8 @@ struct wpa_eapol_ie_parse {
const u8 *reassoc_deadline;
const u8 *key_lifetime;
#endif /* CONFIG_IEEE80211R */
const u8 *transition_disable;
size_t transition_disable_len;
const u8 *rsnxe;
size_t rsnxe_len;
};

View File

@ -68,15 +68,11 @@ Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list
.. only:: esp32c2
The maximum number of paired devices is 20, and the paired encryption devices are no more than 4, the default is 2.
The maximum number of paired devices is 20, and the paired encryption devices are no more than 4, the default is 2. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in WiFi component configuration menu.
.. only:: esp32c3
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3
The maximum number of paired devices is 20, and the paired encryption devices are no more than 10, the default is 6.
.. only:: esp32 or esp32s2 or esp32s3
The maximum number of paired devices is 20, and the paired encryption devices are no more than 16, the default is 6.
The maximum number of paired devices is 20, and the paired encryption devices are no more than 16, the default is 6. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in WiFi component configuration menu.
A device with a broadcast MAC address must be added before sending broadcast data. The range of the channel of paired devices is from 0 to 14. If the channel is set to 0, data will be sent on the current channel. Otherwise, the channel must be set as the channel that the local device is on.

View File

@ -68,15 +68,11 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参
.. only:: esp32c2
配对设备的最大数量是 20其中加密设备的数量不超过 4默认值是 2。
配对设备的最大数量是 20其中加密设备的数量不超过 4默认值是 2。如果想要修改加密设备的数量,在 WiFi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`
.. only:: esp32c3
.. only:: esp32 or esp32s2 or esp32s3 or esp32c3
配对设备的最大数量是 20其中加密设备的数量不超过 10默认值是 6。
.. only:: esp32 or esp32s2 or esp32s3
配对设备的最大数量是 20其中加密设备的数量不超过 16默认值是 6。
配对设备的最大数量是 20其中加密设备的数量不超过 16默认值是 6。如果想要修改加密设备的数量在 WiFi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`
在发送广播数据之前必须添加具有广播 MAC 地址的设备。配对设备的信道范围是从 0 14。如果信道设置为 0数据将在当前信道上发送。否则必须使用本地设备所在的通道。

View File

@ -656,7 +656,6 @@ components/esp_system/test_eh_frame_parser/eh_frame_parser_impl.h
components/esp_system/test_eh_frame_parser/esp_private/panic_internal.h
components/esp_system/test_eh_frame_parser/linker.ld
components/esp_system/ubsan.c
components/esp_wifi/include/esp_mesh_internal.h
components/esp_wifi/include/esp_private/esp_wifi_types_private.h
components/esp_wifi/include/esp_private/wifi_types.h
components/esp_wifi/include/esp_smartconfig.h