diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 7b7ca286d8..a75b4c90d1 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 7b7ca286d82f0d3e0ad324d1b1d72a0f6b99e318 +Subproject commit a75b4c90d1f230bd54735571e847e5fd4ec35e09 diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_common.c b/components/wpa_supplicant/esp_supplicant/src/esp_common.c index 709385dd31..095369584f 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_common.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_common.c @@ -26,7 +26,6 @@ #if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP #include "esp_roaming.h" #endif -#include "eloop.h" /* Utility Functions */ esp_err_t esp_supplicant_str_to_mac(const char *str, uint8_t dest[6]) @@ -39,9 +38,8 @@ esp_err_t esp_supplicant_str_to_mac(const char *str, uint8_t dest[6]) } struct wpa_supplicant g_wpa_supp; -#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) -static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 channel); +#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) #if defined(CONFIG_RRM) static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender, u8 *payload, size_t len, int8_t rssi) @@ -340,8 +338,8 @@ void supplicant_sta_conn_handler(uint8_t *bssid) void supplicant_sta_disconn_handler(uint8_t reason_code) { - struct wpa_sm *sm = &gWpaSm; #if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) + struct wpa_sm *sm = &gWpaSm; struct wpa_supplicant *wpa_s = &g_wpa_supp; #if defined(CONFIG_RRM) @@ -358,7 +356,7 @@ void supplicant_sta_disconn_handler(uint8_t reason_code) wpa_s->current_bss = NULL; } #if defined(CONFIG_IEEE80211R) - if (reason_code == WIFI_REASON_INVALID_PMKID || reason_code == WIFI_REASON_INVALID_MDE || reason_code == WIFI_REASON_INVALID_FTE || (sm->cur_pmksa == NULL)) { + if (!sm->cur_pmksa) { /* clear all ft auth related IEs so that next will be open auth */ wpa_sta_clear_ft_auth_ie(); } @@ -414,7 +412,7 @@ int esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb, void neighbor_report_recvd_cb(void *ctx, const uint8_t *report, size_t report_len) { - if (report == NULL) { + if (!report) { wpa_printf(MSG_DEBUG, "RRM: Notifying neighbor report - NONE"); esp_event_post(WIFI_EVENT, WIFI_EVENT_STA_NEIGHBOR_REP, NULL, 0, 0); return; @@ -422,16 +420,15 @@ void neighbor_report_recvd_cb(void *ctx, const uint8_t *report, size_t report_le wpa_printf(MSG_DEBUG, "RRM: Notifying neighbor report (token = %d)", report[0]); wifi_event_neighbor_report_t *neighbor_report_event = os_zalloc(sizeof(wifi_event_neighbor_report_t) + report_len); - if (neighbor_report_event == NULL) { + if (!neighbor_report_event) { wpa_printf(MSG_DEBUG, "memory alloc failed"); + return; } - if (report_len < ESP_WIFI_MAX_NEIGHBOR_REP_LEN) { - os_memcpy(neighbor_report_event->report, report, report_len); - } + os_memcpy(neighbor_report_event->report, report, ESP_WIFI_MAX_NEIGHBOR_REP_LEN); os_memcpy(neighbor_report_event->n_report, report, report_len); neighbor_report_event->report_len = report_len; - esp_event_post(WIFI_EVENT, WIFI_EVENT_STA_NEIGHBOR_REP, &neighbor_report_event, sizeof(wifi_event_neighbor_report_t), 0); + esp_event_post(WIFI_EVENT, WIFI_EVENT_STA_NEIGHBOR_REP, neighbor_report_event, sizeof(wifi_event_neighbor_report_t) + report_len, 0); os_free(neighbor_report_event); } diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c index 83330c0d01..0326d33683 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c @@ -22,7 +22,6 @@ #include "common/wnm_sta.h" #include "esp_scan_i.h" #include "esp_common_i.h" -#include "eloop.h" extern struct wpa_supplicant g_wpa_supp; diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c index ae734b40cd..a891b97a62 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa_main.c @@ -295,6 +295,8 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code) case WIFI_REASON_ASSOC_FAIL: case WIFI_REASON_CONNECTION_FAIL: case WIFI_REASON_HANDSHAKE_TIMEOUT: + case WIFI_REASON_INVALID_MDE: + case WIFI_REASON_INVALID_FTE: wpa_sta_clear_curr_pmksa(); wpa_sm_notify_disassoc(&gWpaSm); break;