Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'

fix(wifi): backport some wifi fixes to v5.3

See merge request espressif/esp-idf!32291
This commit is contained in:
Jiang Jiang Jian
2024-07-26 11:08:23 +08:00
11 changed files with 59 additions and 8 deletions

View File

@@ -1515,7 +1515,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;

View File

@@ -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;

View File

@@ -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;
@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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, \

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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)
{