mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
fix(esp_wifi): Correctly break 11kv config into wnm and rrm configs
This commit is contained in:
parent
cfed129e05
commit
c058048085
@ -559,7 +559,7 @@ menu "Wi-Fi"
|
||||
config ESP_WIFI_RRM_SUPPORT
|
||||
bool "Enable 802.11k APIs Support"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
default n
|
||||
default y
|
||||
help
|
||||
Select this option to enable 802.11k APIs(RRM support).
|
||||
Only APIs which are helpful for network assisted roaming
|
||||
@ -574,7 +574,7 @@ menu "Wi-Fi"
|
||||
config ESP_WIFI_WNM_SUPPORT
|
||||
bool "Enable 802.11v APIs Support"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
default n
|
||||
default y
|
||||
help
|
||||
Select this option to enable 802.11v APIs(BTM support).
|
||||
Only APIs which are helpful for network assisted roaming
|
||||
@ -606,7 +606,6 @@ menu "Wi-Fi"
|
||||
bool "Advanced support for Wi-Fi Roaming (Experimental)"
|
||||
depends on IDF_EXPERIMENTAL_FEATURES
|
||||
default n
|
||||
select ESP_WIFI_SCAN_CACHE
|
||||
help
|
||||
Enable Espressif's roaming app to allow for efficient Wi-Fi roaming.
|
||||
This includes configurable periodic environment scans, maintaining a cache of the
|
||||
|
@ -292,7 +292,7 @@ if(CONFIG_ESP_WIFI_DPP_SUPPORT)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_DPP)
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_11KV_SUPPORT)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WNM CONFIG_RRM CONFIG_IEEE80211KV)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_IEEE80211KV)
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_RRM_SUPPORT)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_RRM)
|
||||
|
@ -36,8 +36,7 @@ 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)
|
||||
#if defined(CONFIG_RRM)
|
||||
#ifdef CONFIG_RRM
|
||||
static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender,
|
||||
u8 *payload, size_t len, int8_t rssi)
|
||||
{
|
||||
@ -56,8 +55,10 @@ static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender,
|
||||
}
|
||||
#endif /* CONFIG_RRM */
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV)
|
||||
static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 channel)
|
||||
{
|
||||
#if defined(CONFIG_RRM) || defined(CONFIG_WNM)
|
||||
u8 category;
|
||||
u8 bssid[ETH_ALEN];
|
||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||
@ -80,11 +81,13 @@ static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 cha
|
||||
handle_rrm_frame(wpa_s, sender, frame, len, rssi);
|
||||
}
|
||||
#endif /* CONFIG_RRM */
|
||||
#endif /* defined(CONFIG_RRM) || defined(CONFIG_WNM) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void clear_bssid_flag_and_channel(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
#if defined(CONFIG_WNM)
|
||||
wifi_config_t *config;
|
||||
|
||||
/* Reset only if btm is enabled */
|
||||
@ -107,8 +110,11 @@ static void clear_bssid_flag_and_channel(struct wpa_supplicant *wpa_s)
|
||||
}
|
||||
os_free(config);
|
||||
wpa_printf(MSG_DEBUG, "cleared bssid flag");
|
||||
#endif /* CONFIG_WNM */
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
static void register_mgmt_frames(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
wpa_s->type &= ~(1 << WLAN_FC_STYPE_ACTION);
|
||||
@ -139,6 +145,7 @@ static void register_mgmt_frames(struct wpa_supplicant *wpa_s)
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
esp_wifi_register_mgmt_frame_internal(wpa_s->type, wpa_s->subtype);
|
||||
}
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
static int handle_auth_frame(u8 *frame, size_t len,
|
||||
@ -184,7 +191,6 @@ static void wpa_sta_clear_ft_auth_ie(void)
|
||||
wpa_sm_drop_sa(sm);
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
|
||||
void esp_supplicant_unset_all_appie(void)
|
||||
{
|
||||
@ -361,7 +367,6 @@ void supplicant_sta_disconn_handler(uint8_t reason_code)
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
#if defined(CONFIG_RRM)
|
||||
bool esp_rrm_is_rrm_supported_connection(void)
|
||||
{
|
||||
@ -478,8 +483,8 @@ static size_t get_rm_enabled_ie(uint8_t *ie, size_t len)
|
||||
|
||||
return rrm_ie_len + 2;
|
||||
}
|
||||
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
|
||||
#if defined(CONFIG_WNM)
|
||||
bool esp_wnm_is_btm_supported_connection(void)
|
||||
{
|
||||
@ -633,9 +638,9 @@ void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
|
||||
esp_wifi_connect();
|
||||
}
|
||||
|
||||
#if defined(CONFIG_WNM) || defined(CONFIG_MBO)
|
||||
void esp_set_scan_ie(void)
|
||||
{
|
||||
#ifdef CONFIG_WNM
|
||||
#define SCAN_IE_LEN 64
|
||||
uint8_t *ie, *pos;
|
||||
size_t len = SCAN_IE_LEN, ie_len;
|
||||
@ -646,20 +651,24 @@ void esp_set_scan_ie(void)
|
||||
return;
|
||||
}
|
||||
pos = ie;
|
||||
#ifdef CONFIG_WNM
|
||||
ie_len = get_extended_caps_ie(pos, len);
|
||||
pos += ie_len;
|
||||
len -= ie_len;
|
||||
#endif /* defined(CONFIG_WNM) */
|
||||
#ifdef CONFIG_MBO
|
||||
ie_len = get_mbo_oce_scan_ie(pos, len);
|
||||
pos += ie_len;
|
||||
len -= ie_len;
|
||||
#endif /* CONFIG_MBO */
|
||||
esp_wifi_unset_appie_internal(WIFI_APPIE_PROBEREQ);
|
||||
esp_wifi_set_appie_internal(WIFI_APPIE_PROBEREQ, ie, SCAN_IE_LEN - len, 0);
|
||||
if (SCAN_IE_LEN - len) {
|
||||
esp_wifi_unset_appie_internal(WIFI_APPIE_PROBEREQ);
|
||||
esp_wifi_set_appie_internal(WIFI_APPIE_PROBEREQ, ie, SCAN_IE_LEN - len, 0);
|
||||
}
|
||||
os_free(ie);
|
||||
#undef SCAN_IE_LEN
|
||||
#endif /* defined(CONFIG_WNM) */
|
||||
}
|
||||
#endif /* defined(CONFIG_WNM) || defined(CONFIG_MBO) */
|
||||
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
static size_t add_mdie(uint8_t *bssid, uint8_t *ie, size_t len)
|
||||
@ -762,15 +771,22 @@ int wpa_drv_send_action(struct wpa_supplicant *wpa_s,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
#ifndef CONFIG_WNM
|
||||
void esp_set_scan_ie(void) { }
|
||||
|
||||
bool esp_rrm_is_rrm_supported_connection(void)
|
||||
bool esp_wnm_is_btm_supported_connection(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int esp_wnm_send_bss_transition_mgmt_query(enum btm_query_reason query_reason,
|
||||
const char *btm_candidates,
|
||||
int cand_list)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool esp_wnm_is_btm_supported_connection(void)
|
||||
#ifndef CONFIG_RRM
|
||||
bool esp_rrm_is_rrm_supported_connection(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -785,22 +801,15 @@ int esp_rrm_send_neighbor_rep_request(neighbor_rep_request_cb cb,
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
int esp_wnm_send_bss_transition_mgmt_query(enum btm_query_reason query_reason,
|
||||
const char *btm_candidates,
|
||||
int cand_list)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) || defined(CONFIG_WPA3_SAE)
|
||||
#if defined(CONFIG_RRM) || defined(CONFIG_IEEE80211R) || defined(CONFIG_WPA3_SAE)
|
||||
void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie)
|
||||
{
|
||||
#define ASSOC_IE_LEN 128
|
||||
uint8_t *ie, *pos;
|
||||
size_t len = ASSOC_IE_LEN;
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
#if defined(CONFIG_RRM) || defined(CONFIG_IEEE80211R)
|
||||
size_t ie_len;
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
ie = os_malloc(ASSOC_IE_LEN + ies_len);
|
||||
@ -813,6 +822,7 @@ void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie)
|
||||
ie_len = get_rm_enabled_ie(pos, len);
|
||||
pos += ie_len;
|
||||
len -= ie_len;
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
#ifdef CONFIG_MBO
|
||||
ie_len = get_operating_class_ie(pos, len);
|
||||
pos += ie_len;
|
||||
@ -821,7 +831,6 @@ void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie)
|
||||
pos += ie_len;
|
||||
len -= ie_len;
|
||||
#endif /* CONFIG_MBO */
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
if (mdie) {
|
||||
ie_len = add_mdie(bssid, pos, len);
|
||||
@ -840,4 +849,4 @@ void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie)
|
||||
}
|
||||
#else
|
||||
void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie) { }
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) || defined(CONFIG_WPA3_SAE) */
|
||||
#endif /* defined(CONFIG_RRM) || defined(CONFIG_IEEE80211R) || defined(CONFIG_WPA3_SAE) */
|
||||
|
@ -2,3 +2,5 @@ CONFIG_ESP_WIFI_11KV_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_SCAN_CACHE=y
|
||||
CONFIG_ESP_WIFI_MBO_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_11R_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_RRM_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_WNM_SUPPORT=y
|
||||
|
@ -1,9 +1,9 @@
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
|
||||
|
||||
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
|
||||
CONFIG_ESP_WIFI_11KV_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_SCAN_CACHE=y
|
||||
CONFIG_ESP_WIFI_MBO_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_ENABLE_ROAMING_APP=y
|
||||
CONFIG_ESP_WIFI_11R_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_WNM_SUPPORT=y
|
||||
CONFIG_ESP_WIFI_RRM_SUPPORT=y
|
||||
|
Loading…
x
Reference in New Issue
Block a user