mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
fix(esp_wifi): Address some review comments
This commit is contained in:
committed by
Shreyas Sheth
parent
ef9a42b438
commit
d8ca0675bb
@ -23,7 +23,6 @@
|
||||
#include "rsn_supp/wpa_i.h"
|
||||
#include "rsn_supp/wpa.h"
|
||||
#include "esp_private/wifi.h"
|
||||
#include "eloop.h"
|
||||
|
||||
/* Utility Functions */
|
||||
esp_err_t esp_supplicant_str_to_mac(const char *str, uint8_t dest[6])
|
||||
@ -36,9 +35,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)
|
||||
@ -329,14 +327,16 @@ void supplicant_sta_conn_handler(uint8_t *bssid)
|
||||
/* Register for mgmt frames */
|
||||
register_mgmt_frames(wpa_s);
|
||||
/* clear set bssid flag */
|
||||
clear_bssid_flag(wpa_s);
|
||||
clear_bssid_flag_and_channel(wpa_s);
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
}
|
||||
|
||||
void supplicant_sta_disconn_handler(void)
|
||||
void supplicant_sta_disconn_handler(uint8_t reason_code)
|
||||
{
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
#if defined(CONFIG_IEEE80211R)
|
||||
struct wpa_sm *sm = &gWpaSm;
|
||||
#endif
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||
|
||||
#if defined(CONFIG_RRM)
|
||||
@ -353,8 +353,8 @@ void supplicant_sta_disconn_handler(void)
|
||||
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)) {
|
||||
/* clear all ft auth related IEs so that next will be open auth */
|
||||
if (!sm->cur_pmksa) {
|
||||
/* clear all ft auth related IEs so that next will be open auth */
|
||||
wpa_sta_clear_ft_auth_ie();
|
||||
}
|
||||
#endif
|
||||
|
@ -32,5 +32,5 @@ void esp_supplicant_unset_all_appie(void);
|
||||
void esp_set_scan_ie(void);
|
||||
void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool add_mdie);
|
||||
void supplicant_sta_conn_handler(uint8_t* bssid);
|
||||
void supplicant_sta_disconn_handler(void);
|
||||
void supplicant_sta_disconn_handler(uint8_t reason_code);
|
||||
#endif
|
||||
|
@ -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;
|
||||
|
||||
|
@ -260,6 +260,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;
|
||||
@ -280,7 +282,7 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
|
||||
#endif /* CONFIG_OWE_STA */
|
||||
|
||||
esp_wpa3_free_sae_data();
|
||||
supplicant_sta_disconn_handler();
|
||||
supplicant_sta_disconn_handler(reason_code);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT
|
||||
|
Reference in New Issue
Block a user