Skip to content

Commit ad5d362

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'fix/backport_some_wifi_fixes_v5.5' into 'release/v5.5'
Fix/backport some wifi fixes v5.5 See merge request espressif/esp-idf!39529
2 parents 52e3d9b + 0fe8891 commit ad5d362

File tree

11 files changed

+51
-6
lines changed

11 files changed

+51
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pm_check_state = 0x40001b6c;
2323
pm_dream = 0x40001b78;
2424
pm_on_beacon_rx = 0x40001ba0;
2525
//pm_parse_beacon = 0x40001bac;
26-
pm_process_tim = 0x40001bb0;
26+
//pm_process_tim = 0x40001bb0;
2727
pm_rx_beacon_process = 0x40001bb4;
2828
pm_rx_data_process = 0x40001bb8;
2929
pm_sleep = 0x40001bbc;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ ieee80211_getcapinfo = 0x40002130;
949949
/* sta_recv_sa_query_resp = 0x40002144; */
950950
ieee80211_set_max_rate = 0x4000214c;
951951
ic_set_sta = 0x40002150;
952-
ieee80211_parse_wpa = 0x40002158;
952+
//ieee80211_parse_wpa = 0x40002158;
953953
ieee80211_add_assoc_req_ies = 0x40002160;
954954
ieee80211_add_probe_req_ies = 0x40002164;
955955
/* Data (.data, .bss, .rodata) */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mac_tx_set_plcp1 = 0x40001640;
1717
pm_check_state = 0x40001648;
1818
/*pm_on_beacon_rx = 0x4000167c;*/
1919
/*pm_parse_beacon = 0x40001688;*/
20-
pm_process_tim = 0x4000168c;
20+
/*pm_process_tim = 0x4000168c;*/
2121
pm_rx_beacon_process = 0x40001690;
2222
pm_rx_data_process = 0x40001694;
2323
/* pm_sleep = 0x40001698;*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pm_on_isr_twt_wake = 0x40000d98;
128128
pm_on_tsf_timer = 0x40000d9c;
129129
pm_on_twt_force_tx = 0x40000da0;
130130
pm_parse_beacon = 0x40000da4;
131-
pm_process_tim = 0x40000da8;
131+
/*pm_process_tim = 0x40000da8;*/
132132
pm_rx_beacon_process = 0x40000dac;
133133
pm_rx_data_process = 0x40000db0;
134134
pm_sleep = 0x40000db4;
@@ -140,7 +140,7 @@ pm_extend_tbtt_adaptive_servo = 0x40000dc8;
140140
pm_scale_listen_interval = 0x40000dcc;
141141
pm_parse_mbssid_element = 0x40000dd0;
142142
pm_disconnected_wake = 0x40000dd4;
143-
pm_tx_data_process = 0x40000dd8;
143+
/*pm_tx_data_process = 0x40000dd8;*/
144144
pm_is_twt_awake = 0x40000ddc;
145145
pm_enable_twt_keep_alive = 0x40000de0;
146146
pm_twt_on_tsf_timer = 0x40000de4;

components/esp_wifi/include/esp_wifi_types_generic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ typedef struct {
539539
uint8_t transition_disable; /**< Whether to enable transition disable feature */
540540
uint8_t sae_ext; /**< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. */
541541
wifi_bss_max_idle_config_t bss_max_idle_cfg; /**< Configuration for bss max idle, effective if CONFIG_WIFI_BSS_MAX_IDLE_SUPPORT is enabled */
542+
uint16_t gtk_rekey_interval; /**< GTK rekeying interval in seconds. If set to 0, GTK rekeying is disabled. Range: 60 ~ 65535 including 0. */
542543
} wifi_ap_config_t;
543544

544545
#define SAE_H2E_IDENTIFIER_LEN 32 /**< Length of the password identifier for H2E */

components/wpa_supplicant/esp_supplicant/src/esp_hostap.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ void *hostap_init(void)
8484

8585
hapd->conf->sae_pwe = esp_wifi_get_config_sae_pwe_h2e_internal(WIFI_IF_AP);
8686
auth_conf->sae_pwe = hapd->conf->sae_pwe;
87+
auth_conf->wpa_group_rekey = esp_wifi_ap_get_gtk_rekeying_config_internal();
88+
#define MIN_GTK_REKEYING_INTERVAL 60
89+
if (auth_conf->wpa_group_rekey && auth_conf->wpa_group_rekey < MIN_GTK_REKEYING_INTERVAL) {
90+
auth_conf->wpa_group_rekey = MIN_GTK_REKEYING_INTERVAL;
91+
}
92+
#undef MIN_GTK_REKEYING_INTERVAL
8793

8894
authmode = esp_wifi_ap_get_prof_authmode_internal();
8995
if (authmode_has_wpa(authmode)) {

components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ esp_err_t esp_wifi_register_mgmt_frame_internal(uint32_t type, uint32_t subtype)
285285
esp_err_t esp_wifi_send_mgmt_frm_internal(const wifi_mgmt_frm_req_t *req);
286286
uint8_t esp_wifi_ap_get_prof_pairwise_cipher_internal(void);
287287
uint8_t esp_wifi_ap_get_sae_ext_config_internal(void);
288+
uint16_t esp_wifi_ap_get_gtk_rekeying_config_internal(void);
288289
bool esp_wifi_is_mbo_enabled_internal(uint8_t if_index);
289290
void esp_wifi_get_pmf_config_internal(wifi_pmf_config_t *pmf_cfg, uint8_t ifx);
290291
bool esp_wifi_is_ft_enabled_internal(uint8_t if_index);

components/wpa_supplicant/src/ap/wpa_auth.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ int wpa_auth_for_each_sta(struct wpa_authenticator *wpa_auth,
211211
int (*cb)(struct wpa_state_machine *sm, void *ctx),
212212
void *cb_ctx)
213213
{
214+
struct hostapd_data *hapd = hostapd_get_hapd_data();
215+
struct sta_info *sta;
216+
217+
if (hapd == NULL)
218+
return 1;
219+
220+
for (sta = hapd->sta_list; sta; sta = sta->next) {
221+
if (sta->wpa_sm && cb(sta->wpa_sm, cb_ctx))
222+
return 1;
223+
}
214224
return 0;
215225
}
216226

@@ -397,6 +407,11 @@ struct wpa_authenticator * wpa_init(const u8 *addr,
397407
return NULL;
398408
}
399409

410+
if (wpa_auth->conf.wpa_group_rekey) {
411+
eloop_register_timeout(wpa_auth->conf.wpa_group_rekey,
412+
0, wpa_rekey_gtk, wpa_auth, NULL);
413+
}
414+
400415
#ifdef CONFIG_IEEE80211R_AP
401416
wpa_auth->ft_pmk_cache = wpa_ft_pmk_cache_init();
402417
if (wpa_auth->ft_pmk_cache == NULL) {
@@ -2565,6 +2580,7 @@ static int wpa_sm_step(struct wpa_state_machine *sm)
25652580
void wpa_deinit(struct wpa_authenticator *wpa_auth)
25662581
{
25672582
struct wpa_group *group, *prev;
2583+
eloop_cancel_timeout(wpa_rekey_gtk, wpa_auth, NULL);
25682584
pmksa_cache_auth_deinit(wpa_auth->pmksa);
25692585
if (wpa_auth->wpa_ie != NULL) {
25702586
os_free(wpa_auth->wpa_ie);

examples/wifi/getting_started/softAP/main/Kconfig.projbuild

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,18 @@ menu "Example Configuration"
2323
default 4
2424
help
2525
Max number of the STA connects to AP.
26+
27+
config ESP_GTK_REKEYING_ENABLE
28+
bool "Enable GTK Rekeying"
29+
default y
30+
help
31+
Flag to enable GTK rekeying.
32+
33+
config ESP_GTK_REKEY_INTERVAL
34+
int "GTK rekey interval"
35+
depends on ESP_GTK_REKEYING_ENABLE
36+
range 60 65535
37+
default 600
38+
help
39+
GTK rekeying interval in seconds.
2640
endmenu

0 commit comments

Comments
 (0)