Skip to content

Commit 5028896

Browse files
committed
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
2 parents 9788842 + 2c48120 commit 5028896

File tree

11 files changed

+59
-8
lines changed

11 files changed

+59
-8
lines changed

components/esp_rom/esp32c2/ld/esp32c2.rom.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ trc_SetTxAmpduState = 0x40001ccc;
15151515
trc_tid_isTxAmpduOperational = 0x40001cd0;
15161516
trcAmpduSetState = 0x40001cd4;
15171517
wDevCheckBlockError = 0x40001cd8;
1518-
wDev_AppendRxBlocks = 0x40001cdc;
1518+
/*wDev_AppendRxBlocks = 0x40001cdc;*/
15191519
wDev_DiscardFrame = 0x40001ce0;
15201520
wDev_GetNoiseFloor = 0x40001ce4;
15211521
wDev_IndicateAmpdu = 0x40001ce8;

components/esp_rom/esp32c3/ld/esp32c3.rom.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ TRC_PER_IS_GOOD = 0x400017a4;
16231623
trc_SetTxAmpduState = 0x400017a8;
16241624
trc_tid_isTxAmpduOperational = 0x400017ac;
16251625
trcAmpduSetState = 0x400017b0;
1626-
wDev_AppendRxBlocks = 0x400017b8;
1626+
/*wDev_AppendRxBlocks = 0x400017b8;*/
16271627
wDev_DiscardFrame = 0x400017bc;
16281628
wDev_GetNoiseFloor = 0x400017c0;
16291629
wDev_IndicateAmpdu = 0x400017c4;

components/esp_rom/esp32c5/mp/esp32c5/ld/esp32c5.rom.pp.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pm_extend_tbtt_adaptive_servo = 0x40000dc8;
142142
/*pm_scale_listen_interval = 0x40000dcc;*/
143143
pm_parse_mbssid_element = 0x40000dd0;
144144
pm_disconnected_wake = 0x40000dd4;
145-
pm_tx_data_process = 0x40000dd8;
145+
/*pm_tx_data_process = 0x40000dd8;*/
146146
pm_is_twt_awake = 0x40000ddc;
147147
pm_enable_twt_keep_alive = 0x40000de0;
148148
pm_twt_on_tsf_timer = 0x40000de4;
@@ -260,7 +260,7 @@ trcAmpduSetState = 0x40000fa0;
260260
trc_set_bf_report_rate = 0x40000fa4;
261261
trc_onPPTxDone = 0x40000fa8;
262262
wDevCheckBlockError = 0x40000fac;
263-
wDev_AppendRxBlocks = 0x40000fb0;
263+
/*wDev_AppendRxBlocks = 0x40000fb0;*/
264264
wDev_DiscardFrame = 0x40000fb4;
265265
wDev_GetNoiseFloor = 0x40000fb8;
266266
wDev_IndicateAmpdu = 0x40000fbc;

components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ trc_SetTxAmpduState = 0x40000dc4;
145145
trc_tid_isTxAmpduOperational = 0x40000dc8;
146146
trcAmpduSetState = 0x40000dcc;
147147
//wDevCheckBlockError = 0x40000dd0;
148-
wDev_AppendRxBlocks = 0x40000dd4;
148+
/*wDev_AppendRxBlocks = 0x40000dd4;*/
149149
wDev_DiscardFrame = 0x40000dd8;
150150
wDev_GetNoiseFloor = 0x40000ddc;
151151
wDev_IndicateAmpdu = 0x40000de0;

components/esp_rom/esp32s3/ld/esp32s3.rom.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ trc_SetTxAmpduState = 0x40005838;
19041904
trc_tid_isTxAmpduOperational = 0x40005844;
19051905
trcAmpduSetState = 0x40005850;
19061906
wDevCheckBlockError = 0x4000585c;
1907-
wDev_AppendRxBlocks = 0x40005868;
1907+
/*wDev_AppendRxBlocks = 0x40005868;*/
19081908
wDev_DiscardFrame = 0x40005874;
19091909
wDev_GetNoiseFloor = 0x40005880;
19101910
wDev_IndicateAmpdu = 0x4000588c;

components/esp_wifi/include/esp_wifi.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,18 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs;
254254
#define WIFI_ENABLE_GMAC 0
255255
#endif
256256

257+
#if CONFIG_ESP_WIFI_11R_SUPPORT
258+
#define WIFI_ENABLE_11R (1<<6)
259+
#else
260+
#define WIFI_ENABLE_11R 0
261+
#endif
262+
263+
#if CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
264+
#define WIFI_ENABLE_ENTERPRISE (1<<7)
265+
#else
266+
#define WIFI_ENABLE_ENTERPRISE 0
267+
#endif
268+
257269
#if CONFIG_ESP_WIFI_ENABLE_DUMP_HESIGB && !WIFI_CSI_ENABLED
258270
#define WIFI_DUMP_HESIGB_ENABLED true
259271
#else
@@ -272,14 +284,18 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs;
272284
#define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3)
273285
#define CONFIG_FEATURE_GCMP_BIT (1<<4)
274286
#define CONFIG_FEATURE_GMAC_BIT (1<<5)
287+
#define CONFIG_FEATURE_11R_BIT (1<<6)
288+
#define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7)
275289

276290
/* Set additional WiFi features and capabilities */
277291
#define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \
278292
WIFI_ENABLE_SPIRAM | \
279293
WIFI_FTM_INITIATOR | \
280294
WIFI_FTM_RESPONDER | \
281295
WIFI_ENABLE_GCMP | \
282-
WIFI_ENABLE_GMAC)
296+
WIFI_ENABLE_GMAC | \
297+
WIFI_ENABLE_11R | \
298+
WIFI_ENABLE_ENTERPRISE)
283299

284300
#define WIFI_INIT_CONFIG_DEFAULT() { \
285301
.osi_funcs = &g_wifi_osi_funcs, \

components/esp_wifi/include/esp_wifi_types_generic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ typedef struct {
879879
typedef enum {
880880
WPS_FAIL_REASON_NORMAL = 0, /**< WPS normal fail reason */
881881
WPS_FAIL_REASON_RECV_M2D, /**< WPS receive M2D frame */
882+
WPS_FAIL_REASON_RECV_DEAUTH, /**< Recv deauth from AP while wps handshake */
882883
WPS_FAIL_REASON_MAX
883884
} wifi_event_sta_wps_fail_reason_t;
884885

components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "esp_owe_i.h"
3434

3535
#include "esp_wps.h"
36+
#include "esp_wps_i.h"
3637
#include "eap_server/eap.h"
3738
#include "eapol_auth/eapol_auth_sm.h"
3839
#include "ap/ieee802_1x.h"
@@ -303,6 +304,11 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
303304
}
304305
break;
305306
}
307+
308+
struct wps_sm_funcs *wps_sm_cb = wps_get_wps_sm_cb();
309+
if (wps_sm_cb && wps_sm_cb->wps_sm_notify_deauth) {
310+
wps_sm_cb->wps_sm_notify_deauth();
311+
}
306312
#ifdef CONFIG_OWE_STA
307313
owe_deinit();
308314
#endif /* CONFIG_OWE_STA */

components/wpa_supplicant/esp_supplicant/src/esp_wps.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct wps_rx_param {
4545
};
4646
static STAILQ_HEAD(, wps_rx_param) s_wps_rxq;
4747

48+
static struct wps_sm_funcs *s_wps_sm_cb = NULL;
4849
static void *s_wps_task_hdl = NULL;
4950
static void *s_wps_queue = NULL;
5051
static void *s_wps_data_lock = NULL;
@@ -839,6 +840,13 @@ int wps_finish(void)
839840
return ret;
840841
}
841842

843+
static void wps_sm_notify_deauth(void)
844+
{
845+
if (gWpsSm && gWpsSm->wps->state != WPS_FINISHED) {
846+
wps_stop_process(WPS_FAIL_REASON_RECV_DEAUTH);
847+
}
848+
}
849+
842850
/* Add current ap to discard ap list */
843851
void wps_add_discard_ap(u8 *bssid)
844852
{
@@ -1385,6 +1393,11 @@ int wps_init_cfg_pin(struct wps_config *cfg)
13851393
return 0;
13861394
}
13871395

1396+
struct wps_sm_funcs* wps_get_wps_sm_cb(void)
1397+
{
1398+
return s_wps_sm_cb;
1399+
}
1400+
13881401
static int wifi_station_wps_init(const esp_wps_config_t *config)
13891402
{
13901403
struct wps_funcs *wps_cb;
@@ -1466,6 +1479,12 @@ static int wifi_station_wps_init(const esp_wps_config_t *config)
14661479
wps_cb->wps_start_pending = wps_start_pending;
14671480
esp_wifi_set_wps_cb_internal(wps_cb);
14681481

1482+
s_wps_sm_cb = os_malloc(sizeof(struct wps_sm_funcs));
1483+
if (s_wps_sm_cb == NULL) {
1484+
goto _err;
1485+
}
1486+
s_wps_sm_cb->wps_sm_notify_deauth = wps_sm_notify_deauth;
1487+
14691488
return ESP_OK;
14701489

14711490
_err:
@@ -1539,6 +1558,10 @@ wifi_station_wps_deinit(void)
15391558
wps_deinit(sm->wps);
15401559
sm->wps = NULL;
15411560
}
1561+
if (s_wps_sm_cb) {
1562+
os_free(s_wps_sm_cb);
1563+
s_wps_sm_cb = NULL;
1564+
}
15421565
os_free(gWpsSm);
15431566
gWpsSm = NULL;
15441567

0 commit comments

Comments
 (0)