mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
Merge branch 'bugfix/wpa2_ent_fixes_v53' into 'release/v5.3'
Few fixes in wpa_supplicant(v5.3) See merge request espressif/esp-idf!34275
This commit is contained in:
@@ -673,7 +673,7 @@ void esp_nan_app_deinit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s_nan_data_lock) {
|
if (s_nan_data_lock) {
|
||||||
os_semphr_delete(s_nan_data_lock);
|
os_mutex_delete(s_nan_data_lock);
|
||||||
s_nan_data_lock = NULL;
|
s_nan_data_lock = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -415,7 +415,7 @@ void esp_supplicant_common_deinit(void)
|
|||||||
s_supplicant_evt_queue = NULL;
|
s_supplicant_evt_queue = NULL;
|
||||||
}
|
}
|
||||||
if (s_supplicant_api_lock) {
|
if (s_supplicant_api_lock) {
|
||||||
os_semphr_delete(s_supplicant_api_lock);
|
os_mutex_delete(s_supplicant_api_lock);
|
||||||
s_supplicant_api_lock = NULL;
|
s_supplicant_api_lock = NULL;
|
||||||
}
|
}
|
||||||
} else if (esp_supplicant_post_evt(SIG_SUPPLICANT_DEL_TASK, 0) != 0) {
|
} else if (esp_supplicant_post_evt(SIG_SUPPLICANT_DEL_TASK, 0) != 0) {
|
||||||
|
@@ -616,7 +616,7 @@ static void esp_dpp_task(void *pvParameters)
|
|||||||
s_dpp_evt_queue = NULL;
|
s_dpp_evt_queue = NULL;
|
||||||
|
|
||||||
if (s_dpp_api_lock) {
|
if (s_dpp_api_lock) {
|
||||||
os_semphr_delete(s_dpp_api_lock);
|
os_mutex_delete(s_dpp_api_lock);
|
||||||
s_dpp_api_lock = NULL;
|
s_dpp_api_lock = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -242,7 +242,7 @@ void wpa2_task(void *pvParameters)
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (s_wifi_wpa2_sync_sem) {
|
if (s_wifi_wpa2_sync_sem) {
|
||||||
wpa_printf(MSG_DEBUG, "EAP: wifi->EAP api completed sig(%" PRId32 ")", e->sig);
|
wpa_printf(MSG_DEBUG, "EAP: wifi->EAP api completed");
|
||||||
os_semphr_give(s_wifi_wpa2_sync_sem);
|
os_semphr_give(s_wifi_wpa2_sync_sem);
|
||||||
} else {
|
} else {
|
||||||
wpa_printf(MSG_ERROR, "EAP: null wifi->EAP sync sem");
|
wpa_printf(MSG_ERROR, "EAP: null wifi->EAP sync sem");
|
||||||
@@ -255,7 +255,7 @@ void wpa2_task(void *pvParameters)
|
|||||||
wpa_printf(MSG_DEBUG, "EAP: task deleted");
|
wpa_printf(MSG_DEBUG, "EAP: task deleted");
|
||||||
s_wpa2_queue = NULL;
|
s_wpa2_queue = NULL;
|
||||||
if (s_wifi_wpa2_sync_sem) {
|
if (s_wifi_wpa2_sync_sem) {
|
||||||
wpa_printf(MSG_DEBUG, "EAP: wifi->EAP api completed sig(%" PRId32 ")", e->sig);
|
wpa_printf(MSG_DEBUG, "EAP: wifi->EAP api completed");
|
||||||
os_semphr_give(s_wifi_wpa2_sync_sem);
|
os_semphr_give(s_wifi_wpa2_sync_sem);
|
||||||
} else {
|
} else {
|
||||||
wpa_printf(MSG_ERROR, "EAP: null wifi->EAP sync sem");
|
wpa_printf(MSG_ERROR, "EAP: null wifi->EAP sync sem");
|
||||||
@@ -725,7 +725,7 @@ static int eap_peer_sm_init(void)
|
|||||||
|
|
||||||
gEapSm = sm;
|
gEapSm = sm;
|
||||||
#ifdef USE_WPA2_TASK
|
#ifdef USE_WPA2_TASK
|
||||||
s_wpa2_queue = os_queue_create(SIG_WPA2_MAX, sizeof(s_wpa2_queue));
|
s_wpa2_queue = os_queue_create(SIG_WPA2_MAX, sizeof(ETSEvent));
|
||||||
ret = os_task_create(wpa2_task, "wpa2T", WPA2_TASK_STACK_SIZE, NULL, WPA2_TASK_PRIORITY, &s_wpa2_task_hdl);
|
ret = os_task_create(wpa2_task, "wpa2T", WPA2_TASK_STACK_SIZE, NULL, WPA2_TASK_PRIORITY, &s_wpa2_task_hdl);
|
||||||
if (ret != TRUE) {
|
if (ret != TRUE) {
|
||||||
wpa_printf(MSG_ERROR, "wps enable: failed to create task");
|
wpa_printf(MSG_ERROR, "wps enable: failed to create task");
|
||||||
@@ -782,7 +782,7 @@ static void eap_peer_sm_deinit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s_wpa2_data_lock) {
|
if (s_wpa2_data_lock) {
|
||||||
os_semphr_delete(s_wpa2_data_lock);
|
os_mutex_delete(s_wpa2_data_lock);
|
||||||
s_wpa2_data_lock = NULL;
|
s_wpa2_data_lock = NULL;
|
||||||
wpa_printf(MSG_DEBUG, "EAP: eap_peer_sm_deinit: free data lock");
|
wpa_printf(MSG_DEBUG, "EAP: eap_peer_sm_deinit: free data lock");
|
||||||
}
|
}
|
||||||
|
@@ -1771,6 +1771,11 @@ int wps_task_deinit(void)
|
|||||||
wps_rxq_deinit();
|
wps_rxq_deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (s_wps_data_lock) {
|
||||||
|
os_mutex_delete(s_wps_data_lock);
|
||||||
|
s_wps_data_lock = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1803,7 +1808,7 @@ int wps_task_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
os_bzero(s_wps_sig_cnt, SIG_WPS_NUM);
|
os_bzero(s_wps_sig_cnt, SIG_WPS_NUM);
|
||||||
s_wps_queue = os_queue_create(SIG_WPS_NUM, sizeof(s_wps_queue));
|
s_wps_queue = os_queue_create(SIG_WPS_NUM, sizeof(ETSEvent));
|
||||||
if (!s_wps_queue) {
|
if (!s_wps_queue) {
|
||||||
wpa_printf(MSG_ERROR, "wps task init: failed to alloc queue");
|
wpa_printf(MSG_ERROR, "wps task init: failed to alloc queue");
|
||||||
goto _wps_no_mem;
|
goto _wps_no_mem;
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
* See README for more details.
|
* See README for more details.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -95,23 +95,26 @@ int eloop_register_timeout(unsigned int secs, unsigned int usecs,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
timeout = os_zalloc(sizeof(*timeout));
|
timeout = os_zalloc(sizeof(*timeout));
|
||||||
if (timeout == NULL)
|
if (timeout == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
if (os_get_reltime(&timeout->time) < 0) {
|
if (os_get_reltime(&timeout->time) < 0) {
|
||||||
os_free(timeout);
|
os_free(timeout);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
now_sec = timeout->time.sec;
|
now_sec = timeout->time.sec;
|
||||||
timeout->time.sec += secs;
|
timeout->time.sec += secs;
|
||||||
if (timeout->time.sec < now_sec)
|
if (timeout->time.sec < now_sec) {
|
||||||
goto overflow;
|
goto overflow;
|
||||||
|
}
|
||||||
timeout->time.usec += usecs;
|
timeout->time.usec += usecs;
|
||||||
while (timeout->time.usec >= 1000000) {
|
while (timeout->time.usec >= 1000000) {
|
||||||
timeout->time.sec++;
|
timeout->time.sec++;
|
||||||
timeout->time.usec -= 1000000;
|
timeout->time.usec -= 1000000;
|
||||||
}
|
}
|
||||||
if (timeout->time.sec < now_sec)
|
if (timeout->time.sec < now_sec) {
|
||||||
goto overflow;
|
goto overflow;
|
||||||
|
}
|
||||||
timeout->eloop_data = eloop_data;
|
timeout->eloop_data = eloop_data;
|
||||||
timeout->user_data = user_data;
|
timeout->user_data = user_data;
|
||||||
timeout->handler = handler;
|
timeout->handler = handler;
|
||||||
@@ -165,9 +168,10 @@ static bool timeout_exists(struct eloop_timeout *old)
|
|||||||
struct eloop_timeout *timeout, *prev;
|
struct eloop_timeout *timeout, *prev;
|
||||||
dl_list_for_each_safe(timeout, prev, &eloop.timeout,
|
dl_list_for_each_safe(timeout, prev, &eloop.timeout,
|
||||||
struct eloop_timeout, list) {
|
struct eloop_timeout, list) {
|
||||||
if (old == timeout)
|
if (old == timeout) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -178,12 +182,14 @@ static void eloop_remove_timeout(struct eloop_timeout *timeout)
|
|||||||
ELOOP_LOCK();
|
ELOOP_LOCK();
|
||||||
/* Make sure timeout still exists(Another context may have deleted this) */
|
/* Make sure timeout still exists(Another context may have deleted this) */
|
||||||
timeout_present = timeout_exists(timeout);
|
timeout_present = timeout_exists(timeout);
|
||||||
if (timeout_present)
|
if (timeout_present) {
|
||||||
dl_list_del(&timeout->list);
|
dl_list_del(&timeout->list);
|
||||||
|
}
|
||||||
ELOOP_UNLOCK();
|
ELOOP_UNLOCK();
|
||||||
if (timeout_present)
|
if (timeout_present) {
|
||||||
os_free(timeout);
|
os_free(timeout);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ELOOP_DEBUG
|
#ifdef ELOOP_DEBUG
|
||||||
int eloop_cancel_timeout_debug(eloop_timeout_handler handler, void *eloop_data,
|
int eloop_cancel_timeout_debug(eloop_timeout_handler handler, void *eloop_data,
|
||||||
@@ -215,7 +221,6 @@ int eloop_cancel_timeout(eloop_timeout_handler handler,
|
|||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int eloop_cancel_timeout_one(eloop_timeout_handler handler,
|
int eloop_cancel_timeout_one(eloop_timeout_handler handler,
|
||||||
void *eloop_data, void *user_data,
|
void *eloop_data, void *user_data,
|
||||||
struct os_reltime *remaining)
|
struct os_reltime *remaining)
|
||||||
@@ -233,8 +238,9 @@ int eloop_cancel_timeout_one(eloop_timeout_handler handler,
|
|||||||
(timeout->eloop_data == eloop_data) &&
|
(timeout->eloop_data == eloop_data) &&
|
||||||
(timeout->user_data == user_data)) {
|
(timeout->user_data == user_data)) {
|
||||||
removed = 1;
|
removed = 1;
|
||||||
if (os_reltime_before(&now, &timeout->time))
|
if (os_reltime_before(&now, &timeout->time)) {
|
||||||
os_reltime_sub(&timeout->time, &now, remaining);
|
os_reltime_sub(&timeout->time, &now, remaining);
|
||||||
|
}
|
||||||
eloop_remove_timeout(timeout);
|
eloop_remove_timeout(timeout);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -242,7 +248,6 @@ int eloop_cancel_timeout_one(eloop_timeout_handler handler,
|
|||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int eloop_is_timeout_registered(eloop_timeout_handler handler,
|
int eloop_is_timeout_registered(eloop_timeout_handler handler,
|
||||||
void *eloop_data, void *user_data)
|
void *eloop_data, void *user_data)
|
||||||
{
|
{
|
||||||
@@ -251,14 +256,14 @@ int eloop_is_timeout_registered(eloop_timeout_handler handler,
|
|||||||
dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) {
|
dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) {
|
||||||
if (tmp->handler == handler &&
|
if (tmp->handler == handler &&
|
||||||
tmp->eloop_data == eloop_data &&
|
tmp->eloop_data == eloop_data &&
|
||||||
tmp->user_data == user_data)
|
tmp->user_data == user_data) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int eloop_deplete_timeout(unsigned int req_secs, unsigned int req_usecs,
|
int eloop_deplete_timeout(unsigned int req_secs, unsigned int req_usecs,
|
||||||
eloop_timeout_handler handler, void *eloop_data,
|
eloop_timeout_handler handler, void *eloop_data,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
@@ -290,7 +295,6 @@ int eloop_deplete_timeout(unsigned int req_secs, unsigned int req_usecs,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int eloop_replenish_timeout(unsigned int req_secs, unsigned int req_usecs,
|
int eloop_replenish_timeout(unsigned int req_secs, unsigned int req_usecs,
|
||||||
eloop_timeout_handler handler, void *eloop_data,
|
eloop_timeout_handler handler, void *eloop_data,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
@@ -399,7 +403,7 @@ void eloop_destroy(void)
|
|||||||
eloop_remove_timeout(timeout);
|
eloop_remove_timeout(timeout);
|
||||||
}
|
}
|
||||||
if (eloop_data_lock) {
|
if (eloop_data_lock) {
|
||||||
os_semphr_delete(eloop_data_lock);
|
os_mutex_delete(eloop_data_lock);
|
||||||
eloop_data_lock = NULL;
|
eloop_data_lock = NULL;
|
||||||
}
|
}
|
||||||
os_timer_disarm(&eloop.eloop_timer);
|
os_timer_disarm(&eloop.eloop_timer);
|
||||||
|
Reference in New Issue
Block a user