mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/rrm_dpp_task_delete' into 'master'
wpa_supplicant: Correct task deletion for RRM and DPP tasks Closes IDFGH-5688 See merge request espressif/esp-idf!14940
This commit is contained in:
commit
d95b56a435
@ -304,9 +304,6 @@ void esp_supplicant_common_deinit(void)
|
|||||||
{
|
{
|
||||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||||
|
|
||||||
if (esp_supplicant_post_evt(SIG_SUPPLICANT_DEL_TASK, 0) != 0) {
|
|
||||||
wpa_printf(MSG_ERROR, "failed to send task delete event");
|
|
||||||
}
|
|
||||||
esp_scan_deinit(wpa_s);
|
esp_scan_deinit(wpa_s);
|
||||||
wpas_rrm_reset(wpa_s);
|
wpas_rrm_reset(wpa_s);
|
||||||
wpas_clear_beacon_rep_data(wpa_s);
|
wpas_clear_beacon_rep_data(wpa_s);
|
||||||
@ -314,6 +311,12 @@ void esp_supplicant_common_deinit(void)
|
|||||||
&supplicant_sta_conn_handler);
|
&supplicant_sta_conn_handler);
|
||||||
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED,
|
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED,
|
||||||
&supplicant_sta_disconn_handler);
|
&supplicant_sta_disconn_handler);
|
||||||
|
wpa_s->type = 0;
|
||||||
|
wpa_s->subtype = 0;
|
||||||
|
esp_wifi_register_mgmt_frame_internal(wpa_s->type, wpa_s->subtype);
|
||||||
|
if (esp_supplicant_post_evt(SIG_SUPPLICANT_DEL_TASK, 0) != 0) {
|
||||||
|
wpa_printf(MSG_ERROR, "failed to send task delete event");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb,
|
int esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb,
|
||||||
@ -587,12 +590,19 @@ int esp_supplicant_post_evt(uint32_t evt_id, uint32_t data)
|
|||||||
evt->id = evt_id;
|
evt->id = evt_id;
|
||||||
evt->data = data;
|
evt->data = data;
|
||||||
|
|
||||||
|
/* Make sure lock exists before taking it */
|
||||||
|
if (s_supplicant_api_lock) {
|
||||||
SUPPLICANT_API_LOCK();
|
SUPPLICANT_API_LOCK();
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (xQueueSend(s_supplicant_evt_queue, &evt, 10 / portTICK_PERIOD_MS ) != pdPASS) {
|
if (xQueueSend(s_supplicant_evt_queue, &evt, 10 / portTICK_PERIOD_MS ) != pdPASS) {
|
||||||
SUPPLICANT_API_UNLOCK();
|
SUPPLICANT_API_UNLOCK();
|
||||||
os_free(evt);
|
os_free(evt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (evt_id != SIG_SUPPLICANT_DEL_TASK) {
|
||||||
SUPPLICANT_API_UNLOCK();
|
SUPPLICANT_API_UNLOCK();
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -34,22 +34,36 @@ struct action_rx_param {
|
|||||||
|
|
||||||
static int esp_dpp_post_evt(uint32_t evt_id, uint32_t data)
|
static int esp_dpp_post_evt(uint32_t evt_id, uint32_t data)
|
||||||
{
|
{
|
||||||
DPP_API_LOCK();
|
|
||||||
|
|
||||||
dpp_event_t *evt = os_zalloc(sizeof(dpp_event_t));
|
dpp_event_t *evt = os_zalloc(sizeof(dpp_event_t));
|
||||||
|
int ret = ESP_OK;
|
||||||
|
|
||||||
if (evt == NULL) {
|
if (evt == NULL) {
|
||||||
DPP_API_UNLOCK();
|
ret = ESP_ERR_NO_MEM;
|
||||||
return ESP_ERR_NO_MEM;
|
goto end;
|
||||||
}
|
}
|
||||||
evt->id = evt_id;
|
evt->id = evt_id;
|
||||||
evt->data = data;
|
evt->data = data;
|
||||||
if ( xQueueSend(s_dpp_evt_queue, &evt, 10 / portTICK_PERIOD_MS ) != pdPASS) {
|
if (s_dpp_api_lock) {
|
||||||
DPP_API_UNLOCK();
|
DPP_API_LOCK();
|
||||||
os_free(evt);
|
} else {
|
||||||
return ESP_ERR_DPP_FAILURE;
|
ret = ESP_ERR_DPP_FAILURE;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
if (xQueueSend(s_dpp_evt_queue, &evt, 10 / portTICK_PERIOD_MS ) != pdPASS) {
|
||||||
DPP_API_UNLOCK();
|
DPP_API_UNLOCK();
|
||||||
return ESP_OK;
|
ret = ESP_ERR_DPP_FAILURE;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (evt_id != SIG_DPP_DEL_TASK) {
|
||||||
|
DPP_API_UNLOCK();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
end:
|
||||||
|
if (evt) {
|
||||||
|
os_free(evt);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void esp_dpp_call_cb(esp_supp_dpp_event_t evt, void *data)
|
static void esp_dpp_call_cb(esp_supp_dpp_event_t evt, void *data)
|
||||||
@ -653,6 +667,10 @@ void esp_supp_dpp_deinit(void)
|
|||||||
params->key = NULL;
|
params->key = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_ACTION_TX_STATUS,
|
||||||
|
&offchan_event_handler);
|
||||||
|
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_ROC_DONE,
|
||||||
|
&offchan_event_handler);
|
||||||
s_dpp_auth_retries = 0;
|
s_dpp_auth_retries = 0;
|
||||||
dpp_global_deinit(s_dpp_ctx.dpp_global);
|
dpp_global_deinit(s_dpp_ctx.dpp_global);
|
||||||
esp_dpp_post_evt(SIG_DPP_DEL_TASK, 0);
|
esp_dpp_post_evt(SIG_DPP_DEL_TASK, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user