Merge branch 'bugfix/backport_wifi_fixes_v5.2' into 'release/v5.2'

fix(wifi): optimize wifi bin size and fix some issue

See merge request espressif/esp-idf!26894
This commit is contained in:
Jiang Jiang Jian
2023-11-03 21:08:39 +08:00
17 changed files with 118 additions and 57 deletions

View File

@ -1516,7 +1516,7 @@ mac_tx_set_htsig = 0x40001b5c;
mac_tx_set_plcp0 = 0x40001b60;
mac_tx_set_plcp1 = 0x40001b64;
mac_tx_set_plcp2 = 0x40001b68;
pm_check_state = 0x40001b6c;
/* pm_check_state = 0x40001b6c; */
pm_disable_dream_timer = 0x40001b70;
pm_disable_sleep_delay_timer = 0x40001b74;
pm_dream = 0x40001b78;
@ -1540,10 +1540,10 @@ pm_on_tbtt = 0x40001ba8;
pm_sleep_for = 0x40001bc0;
/* pm_tbtt_process = 0x40001bc4; */
ppAMPDU2Normal = 0x40001bc8;
ppAssembleAMPDU = 0x40001bcc;
/*ppAssembleAMPDU = 0x40001bcc;*/
ppCalFrameTimes = 0x40001bd0;
ppCalSubFrameLength = 0x40001bd4;
ppCalTxAMPDULength = 0x40001bd8;
/*ppCalTxAMPDULength = 0x40001bd8;*/
ppCheckTxAMPDUlength = 0x40001bdc;
ppDequeueRxq_Locked = 0x40001be0;
ppDequeueTxQ = 0x40001be4;
@ -1563,8 +1563,8 @@ ppRecycleAmpdu = 0x40001c18;
ppRecycleRxPkt = 0x40001c1c;
ppResortTxAMPDU = 0x40001c20;
ppResumeTxAMPDU = 0x40001c24;
ppRxFragmentProc = 0x40001c28;
ppRxPkt = 0x40001c2c;
/*ppRxFragmentProc = 0x40001c28;*/
/* ppRxPkt = 0x40001c2c; */
ppRxProtoProc = 0x40001c30;
ppSearchTxQueue = 0x40001c34;
ppSearchTxframe = 0x40001c38;
@ -1592,7 +1592,7 @@ rcLowerSched = 0x40001c8c;
rcSetTxAmpduLimit = 0x40001c90;
/* rcTxUpdatePer = 0x40001c94;*/
rcUpdateAckSnr = 0x40001c98;
rcUpdateRate = 0x40001c9c;
/*rcUpdateRate = 0x40001c9c;*/
rcUpdateTxDone = 0x40001ca0;
rcUpdateTxDoneAmpdu2 = 0x40001ca4;
rcUpSched = 0x40001ca8;
@ -1667,7 +1667,7 @@ lmacRetryTxFrame = 0x40001db8;
lmacProcessCollisions_task = 0x40001dbc;
/*lmacProcessTxopQComplete = 0x40001dc0;*/
lmacInitAc = 0x40001dc4;
lmacInit = 0x40001dc8;
/*lmacInit = 0x40001dc8;*/
mac_tx_set_txop_q = 0x40001dcc;
/*hal_init = 0x40001dd0;*/
hal_mac_rx_set_policy = 0x40001dd4;
@ -1876,7 +1876,7 @@ ieee80211_recycle_cache_eb = 0x40001fe8;
ieee80211_search_node = 0x40001fec;
roundup2 = 0x40001ff0;
ieee80211_crypto_encap = 0x40001ff4;
ieee80211_crypto_decap = 0x40001ff8;
/* ieee80211_crypto_decap = 0x40001ff8; */
ieee80211_decap = 0x40001ffc;
ieee80211_set_tx_pti = 0x40002000;
wifi_is_started = 0x40002004;

View File

@ -14,6 +14,7 @@ lmacTxDone = 0x4000162c;
lmacTxFrame = 0x40001630;
mac_tx_set_htsig = 0x40001638;
mac_tx_set_plcp1 = 0x40001640;
pm_check_state = 0x40001648;
pm_on_beacon_rx = 0x4000167c;
/*pm_parse_beacon = 0x40001688;*/
pm_process_tim = 0x4000168c;
@ -23,7 +24,7 @@ pm_rx_data_process = 0x40001694;
/* pm_tbtt_process = 0x400016a0;*/
ppMapTxQueue = 0x400016d8;
ppProcTxSecFrame = 0x400016dc;
ppRxFragmentProc = 0x40001704;
/*ppRxFragmentProc = 0x40001704;*/
/* rcGetSched = 0x40001764;*/
rcTxUpdatePer = 0x40001770;
rcUpdateTxDone = 0x4000177c;

View File

@ -1535,7 +1535,7 @@ mac_tx_set_duration = 0x40001634;
mac_tx_set_plcp0 = 0x4000163c;
/* mac_tx_set_plcp1 = 0x40001640;*/
mac_tx_set_plcp2 = 0x40001644;
pm_check_state = 0x40001648;
/* pm_check_state = 0x40001648; */
pm_disable_dream_timer = 0x4000164c;
pm_disable_sleep_delay_timer = 0x40001650;
pm_dream = 0x40001654;
@ -1559,10 +1559,10 @@ pm_on_tbtt = 0x40001684;
pm_sleep_for = 0x4000169c;
/* pm_tbtt_process = 0x400016a0; */
ppAMPDU2Normal = 0x400016a4;
ppAssembleAMPDU = 0x400016a8;
/*ppAssembleAMPDU = 0x400016a8;*/
ppCalFrameTimes = 0x400016ac;
ppCalSubFrameLength = 0x400016b0;
ppCalTxAMPDULength = 0x400016b4;
/*ppCalTxAMPDULength = 0x400016b4;*/
ppCheckTxAMPDUlength = 0x400016b8;
ppDequeueRxq_Locked = 0x400016bc;
ppDequeueTxQ = 0x400016c0;
@ -1581,7 +1581,7 @@ ppRecycleRxPkt = 0x400016f8;
ppResortTxAMPDU = 0x400016fc;
ppResumeTxAMPDU = 0x40001700;
/* ppRxFragmentProc = 0x40001704; */
ppRxPkt = 0x40001708;
/* ppRxPkt = 0x40001708; */
ppRxProtoProc = 0x4000170c;
ppSearchTxQueue = 0x40001710;
ppSearchTxframe = 0x40001714;
@ -1608,7 +1608,7 @@ rcLowerSched = 0x40001768;
rcSetTxAmpduLimit = 0x4000176c;
/* rcTxUpdatePer = 0x40001770;*/
rcUpdateAckSnr = 0x40001774;
rcUpdateRate = 0x40001778;
/*rcUpdateRate = 0x40001778;*/
/* rcUpdateTxDone = 0x4000177c; */
rcUpdateTxDoneAmpdu2 = 0x40001780;
rcUpSched = 0x40001784;

View File

@ -48,7 +48,7 @@ ieee80211_copy_eb_header = 0x40000bb4;
ieee80211_recycle_cache_eb = 0x40000bb8;
ieee80211_search_node = 0x40000bbc;
ieee80211_crypto_encap = 0x40000bc0;
ieee80211_crypto_decap = 0x40000bc4;
/* ieee80211_crypto_decap = 0x40000bc4; */
ieee80211_decap = 0x40000bc8;
wifi_is_started = 0x40000bcc;
ieee80211_gettid = 0x40000bd0;

View File

@ -56,7 +56,7 @@ mac_tx_set_duration = 0x40000c60;
//mac_tx_set_plcp0 = 0x40000c64;
//mac_tx_set_plcp1 = 0x40000c68;
mac_tx_set_plcp2 = 0x40000c6c;
pm_check_state = 0x40000c70;
/* pm_check_state = 0x40000c70; */
/* pm_disable_dream_timer = 0x40000c74; */
pm_disable_sleep_delay_timer = 0x40000c78;
pm_dream = 0x40000c7c;
@ -100,7 +100,7 @@ ppRecycleAmpdu = 0x40000d10;
ppRecycleRxPkt = 0x40000d14;
//ppResortTxAMPDU = 0x40000d18;
ppResumeTxAMPDU = 0x40000d1c;
ppRxFragmentProc = 0x40000d20;
/*ppRxFragmentProc = 0x40000d20;*/
//ppRxPkt = 0x40000d24;
ppRxProtoProc = 0x40000d28;
ppSearchTxQueue = 0x40000d2c;
@ -129,7 +129,7 @@ rcLowerSched = 0x40000d84;
rcSetTxAmpduLimit = 0x40000d88;
rcTxUpdatePer = 0x40000d8c;
rcUpdateAckSnr = 0x40000d90;
rcUpdateRate = 0x40000d94;
/*rcUpdateRate = 0x40000d94;*/
rcUpdateTxDone = 0x40000d98;
rcUpdateTxDoneAmpdu2 = 0x40000d9c;
rcUpSched = 0x40000da0;

View File

@ -1837,7 +1837,7 @@ mac_tx_set_duration = 0x400053dc;
mac_tx_set_plcp0 = 0x400053f4;
/* mac_tx_set_plcp1 = 0x40005400;*/
mac_tx_set_plcp2 = 0x4000540c;
pm_check_state = 0x40005418;
/* pm_check_state = 0x40005418; */
pm_disable_dream_timer = 0x40005424;
pm_disable_sleep_delay_timer = 0x40005430;
pm_dream = 0x4000543c;
@ -1861,10 +1861,10 @@ pm_on_tbtt = 0x400054cc;
pm_sleep_for = 0x40005514;
/* pm_tbtt_process = 0x40005520; */
ppAMPDU2Normal = 0x4000552c;
ppAssembleAMPDU = 0x40005538;
/*ppAssembleAMPDU = 0x40005538;*/
ppCalFrameTimes = 0x40005544;
ppCalSubFrameLength = 0x40005550;
ppCalTxAMPDULength = 0x4000555c;
/*ppCalTxAMPDULength = 0x4000555c;*/
ppCheckTxAMPDUlength = 0x40005568;
ppDequeueRxq_Locked = 0x40005574;
ppDequeueTxQ = 0x40005580;
@ -1884,7 +1884,7 @@ ppRecycleRxPkt = 0x40005628;
ppResortTxAMPDU = 0x40005634;
ppResumeTxAMPDU = 0x40005640;
/* ppRxFragmentProc = 0x4000564c; */
ppRxPkt = 0x40005658;
/* ppRxPkt = 0x40005658; */
ppRxProtoProc = 0x40005664;
ppSearchTxQueue = 0x40005670;
ppSearchTxframe = 0x4000567c;
@ -1912,7 +1912,7 @@ rcLowerSched = 0x40005778;
rcSetTxAmpduLimit = 0x40005784;
/* rcTxUpdatePer = 0x40005790;*/
rcUpdateAckSnr = 0x4000579c;
rcUpdateRate = 0x400057a8;
/*rcUpdateRate = 0x400057a8;*/
/* rcUpdateTxDone = 0x400057b4; */
rcUpdateTxDoneAmpdu2 = 0x400057c0;
rcUpSched = 0x400057cc;

View File

@ -1191,7 +1191,8 @@ esp_err_t esp_wifi_statis_dump(uint32_t modules);
* @attention If the user wants to receive another WIFI_EVENT_STA_BSS_RSSI_LOW event after receiving one, this API needs to be
* called again with an updated/same RSSI threshold.
*
* @param rssi threshold value in dbm between -100 to 0
* @param rssi threshold value in dbm between -100 to 10
* Note that in some rare cases where signal strength is very strong, rssi values can be slightly positive.
*
* @return
* - ESP_OK: succeed

View File

@ -211,7 +211,7 @@ typedef struct {
uint8_t ssid[33]; /**< SSID of AP */
uint8_t primary; /**< channel of AP */
wifi_second_chan_t second; /**< secondary channel of AP */
int8_t rssi; /**< signal strength of AP */
int8_t rssi; /**< signal strength of AP. Note that in some rare cases where signal strength is very strong, rssi values can be slightly positive */
wifi_auth_mode_t authmode; /**< authmode of AP */
wifi_cipher_type_t pairwise_cipher; /**< pairwise cipher of AP */
wifi_cipher_type_t group_cipher; /**< group cipher of AP */

View File

@ -355,7 +355,77 @@ void ieee80211_ftm_attach(void)
#ifndef CONFIG_ESP_WIFI_SOFTAP_SUPPORT
void net80211_softap_funcs_init(void)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
}
bool ieee80211_ap_try_sa_query(void *p)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return false;
}
bool ieee80211_ap_sa_query_timeout(void *p)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return false;
}
int add_mic_ie_bip(void *p)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return 0;
}
void ieee80211_free_beacon_eb(void)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
}
int ieee80211_pwrsave(void *p1, void *p2)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return 0;
}
void cnx_node_remove(void *p)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
}
int ieee80211_set_tim(void *p, int arg)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return 0;
}
bool ieee80211_is_bufferable_mmpdu(void *p)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return false;
}
void cnx_node_leave(void *p, uint8_t arg)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
}
void ieee80211_beacon_construct(void *p1, void *p2, void *p3, void *p4)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
}
void * ieee80211_assoc_resp_construct(void *p, int arg)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return NULL;
}
void * ieee80211_alloc_proberesp(void *p, int arg)
{
/* Do not remove, stub to overwrite weak link in Wi-Fi Lib */
return NULL;
}
#endif
#ifndef CONFIG_ESP_WIFI_NAN_ENABLE

View File

@ -47,7 +47,7 @@ static bool s_supplicant_task_init_done;
#define SUPPLICANT_TASK_STACK_SIZE (6144 + TASK_STACK_SIZE_ADD)
static int handle_action_frm(u8 *frame, size_t len,
u8 *sender, u32 rssi, u8 channel)
u8 *sender, int8_t rssi, u8 channel)
{
struct ieee_mgmt_frame *frm = os_malloc(sizeof(struct ieee_mgmt_frame) + len);
@ -73,7 +73,7 @@ static int handle_action_frm(u8 *frame, size_t len,
#if defined(CONFIG_IEEE80211KV)
static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender,
u8 *payload, size_t len, u32 rssi)
u8 *payload, size_t len, int8_t rssi)
{
if (payload[0] == WLAN_RRM_NEIGHBOR_REPORT_RESPONSE) {
/* neighbor report parsing */
@ -89,7 +89,7 @@ static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender,
}
}
static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, u32 rssi, u8 channel)
static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 channel)
{
u8 category;
u8 bssid[ETH_ALEN];
@ -215,7 +215,7 @@ static void register_mgmt_frames(struct wpa_supplicant *wpa_s)
#ifdef CONFIG_IEEE80211R
static int handle_auth_frame(u8 *frame, size_t len,
u8 *sender, u32 rssi, u8 channel)
u8 *sender, int8_t rssi, u8 channel)
{
if (gWpaSm.key_mgmt == WPA_KEY_MGMT_FT_PSK) {
if (gWpaSm.ft_protocol) {
@ -230,7 +230,7 @@ static int handle_auth_frame(u8 *frame, size_t len,
}
static int handle_assoc_frame(u8 *frame, size_t len,
u8 *sender, u32 rssi, u8 channel)
u8 *sender, int8_t rssi, u8 channel)
{
if (gWpaSm.key_mgmt == WPA_KEY_MGMT_FT_PSK) {
if (gWpaSm.ft_protocol) {
@ -255,7 +255,7 @@ void esp_supplicant_unset_all_appie(void)
}
static int ieee80211_handle_rx_frm(u8 type, u8 *frame, size_t len, u8 *sender,
u32 rssi, u8 channel, u64 current_tsf)
int8_t rssi, u8 channel, u64 current_tsf)
{
int ret = 0;

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -16,7 +16,7 @@ extern struct wpa_supplicant g_wpa_supp;
struct ieee_mgmt_frame {
u8 sender[ETH_ALEN];
u8 channel;
u32 rssi;
int8_t rssi;
size_t len;
u8 payload[0];
};

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -114,7 +114,7 @@ void esp_scan_deinit(struct wpa_supplicant *wpa_s)
}
int esp_handle_beacon_probe(u8 type, u8 *frame, size_t len, u8 *sender,
u32 rssi, u8 channel, u64 current_tsf)
int8_t rssi, u8 channel, u64 current_tsf)
{
struct wpa_supplicant *wpa_s = &g_wpa_supp;
struct os_reltime now;

View File

@ -1,17 +1,7 @@
/**
* Copyright 2020 Espressif Systems (Shanghai) PTE LTD
/*
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO 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-License-Identifier: Apache-2.0
*/
#ifndef ESP_SCAN_I_H
@ -19,7 +9,7 @@
void esp_scan_init(struct wpa_supplicant *wpa_s);
void esp_scan_deinit(struct wpa_supplicant *wpa_s);
int esp_handle_beacon_probe(u8 type, u8 *frame, size_t len, u8 *sender,
u32 rssi, u8 channel, u64 current_tsf);
int8_t rssi, u8 channel, u64 current_tsf);
void esp_supplicant_handle_scan_done_evt(void);
#endif

View File

@ -137,7 +137,7 @@ struct wpa_funcs {
uint8_t *(*wpa3_build_sae_msg)(uint8_t *bssid, uint32_t type, size_t *len);
int (*wpa3_parse_sae_msg)(uint8_t *buf, size_t len, uint32_t type, uint16_t status);
int (*wpa3_hostap_handle_auth)(uint8_t *buf, size_t len, uint32_t type, uint16_t status, uint8_t *bssid);
int (*wpa_sta_rx_mgmt)(u8 type, u8 *frame, size_t len, u8 *sender, u32 rssi, u8 channel, u64 current_tsf);
int (*wpa_sta_rx_mgmt)(u8 type, u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 channel, u64 current_tsf);
void (*wpa_config_done)(void);
uint8_t *(*owe_build_dhie)(uint16_t group);
int (*owe_process_assoc_resp)(const u8 *rsn_ie, size_t rsn_len, const uint8_t *dh_ie, size_t dh_len);

View File

@ -321,12 +321,15 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len,u8
sta_info = ap_sta_add(hapd, bssid);
if (!sta_info) {
wpa_printf(MSG_ERROR, "failed to add station " MACSTR, MAC2STR(bssid));
return false;
goto fail;
}
#ifdef CONFIG_SAE
if (sta_info->lock && os_semphr_take(sta_info->lock, 0) != TRUE) {
wpa_printf(MSG_INFO, "Ignore assoc request as softap is busy with sae calculation for station "MACSTR, MAC2STR(bssid));
if (esp_send_assoc_resp(hapd, sta_info, bssid, WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY, rsnxe ? false : true, subtype) != WLAN_STATUS_SUCCESS) {
goto fail;
}
return false;
}
#endif /* CONFIG_SAE */
@ -357,10 +360,7 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len,u8
}
fail:
if (sta_info) {
ap_free_sta(hapd, sta_info);
}
esp_wifi_ap_deauth_internal(bssid, WLAN_REASON_PREV_AUTH_NOT_VALID);
return false;
}
#endif

View File

@ -833,7 +833,6 @@ components/wifi_provisioning/python/wifi_scan_pb2.py
components/wifi_provisioning/src/scheme_console.c
components/wifi_provisioning/src/wifi_config.c
components/wifi_provisioning/src/wifi_scan.c
components/wpa_supplicant/esp_supplicant/src/esp_scan_i.h
components/wpa_supplicant/esp_supplicant/src/esp_wpa_err.h
components/wpa_supplicant/include/utils/wpa_debug.h
components/wpa_supplicant/include/utils/wpabuf.h