mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
Merge branch 'fix/backport_wifi_fixes_v5.4' into 'release/v5.4'
fix(Wi-Fi): Backport some Wi-Fi fixes to v5.4 See merge request espressif/esp-idf!36495
This commit is contained in:
Submodule components/bt/controller/lib_esp32 updated: 35fb599d37...b0b9cff14b
Submodule components/esp_coex/lib updated: 7b588f2dbb...f8196c5811
Submodule components/esp_phy/lib updated: f5f852b53c...84a5574221
@@ -305,7 +305,9 @@ phy_rate_to_index = 0x400014b8;
|
||||
phy_get_target_pwr = 0x400014bc;
|
||||
phy_get_max_pwr = 0x400014c0;
|
||||
phy_get_pwr_index = 0x400014c4;
|
||||
phy_chip_set_chan_ana = 0x40005a8a;
|
||||
phy_chip_set_chan_ana = 0x400014d4;
|
||||
phy_get_romfuncs = 0x400014d8;
|
||||
/* Data (.data, .bss, .rodata) */
|
||||
phy_param_rom = 0x4084fc6c;
|
||||
rom_phyFuns = 0x4084fb84;
|
||||
rom_phyFuns_eco2 = 0x4084fc68;
|
||||
|
@@ -53,6 +53,9 @@ hal_tsf_get_tbttstart = 0x40000bcc;
|
||||
hal_get_tsf_time = 0x40000bd0;
|
||||
hal_get_sta_tsf = 0x40000bd4;
|
||||
tsf_hal_get_tbtt_interval = 0x40000bd8;
|
||||
tsf_hal_get_time = 0x400014cc;
|
||||
/*pm_get_tbtt_count = 0x400014c8;*/
|
||||
tsf_hal_get_counter_value = 0x400014d0;
|
||||
dbg_hal_check_clr_mplen_bitmap = 0x40000bdc;
|
||||
dbg_hal_check_set_mplen_bitmap = 0x40000be0;
|
||||
ic_get_trc = 0x40000be4;
|
||||
@@ -76,14 +79,14 @@ lmacReachLongLimit = 0x40000c28;
|
||||
lmacReachShortLimit = 0x40000c2c;
|
||||
lmacRecycleMPDU = 0x40000c30;
|
||||
lmacRxDone = 0x40000c34;
|
||||
/*lmacSetTxFrame = 0x40000c38;*/
|
||||
lmacSetTxFrame = 0x40000c38;
|
||||
lmacTxDone = 0x40000c3c;
|
||||
lmacTxFrame = 0x40000c40;
|
||||
lmacDisableTransmit = 0x40000c44;
|
||||
lmacDiscardFrameExchangeSequence = 0x40000c48;
|
||||
lmacProcessCollision = 0x40000c4c;
|
||||
lmacProcessAckTimeout = 0x40000c50;
|
||||
/*lmacProcessShortRetryFail = 0x40000c54;*/
|
||||
lmacProcessShortRetryFail = 0x40000c54;
|
||||
lmacProcessCollisions_task = 0x40000c58;
|
||||
lmacProcessTxRtsError = 0x40000c5c;
|
||||
lmacProcessTxError = 0x40000c60;
|
||||
@@ -119,7 +122,7 @@ pm_local_tsf_process = 0x40000cd4;
|
||||
pm_set_beacon_filter = 0x40000cd8;
|
||||
pm_is_in_wifi_slice_threshold = 0x40000cdc;
|
||||
pm_is_waked = 0x40000ce0;
|
||||
/*pm_keep_alive = 0x40000ce4;*/
|
||||
pm_keep_alive = 0x40000ce4;
|
||||
pm_on_beacon_rx = 0x40000ce8;
|
||||
pm_on_data_rx = 0x40000cec;
|
||||
pm_on_data_tx = 0x40000cf0;
|
||||
@@ -137,7 +140,7 @@ pm_rx_data_process = 0x40000d1c;
|
||||
pm_sleep = 0x40000d20;
|
||||
pm_sleep_for = 0x40000d24;
|
||||
/*pm_tbtt_process = 0x40000d28;*/
|
||||
/*pm_tx_data_done_process = 0x40000d2c;*/
|
||||
pm_tx_data_done_process = 0x40000d2c;
|
||||
pm_allow_tx = 0x40000d30;
|
||||
pm_extend_tbtt_adaptive_servo = 0x40000d34;
|
||||
pm_scale_listen_interval = 0x40000d38;
|
||||
@@ -146,7 +149,7 @@ pm_disconnected_wake = 0x40000d40;
|
||||
/*pm_tx_data_process = 0x40000d44;*/
|
||||
pm_is_twt_awake = 0x40000d48;
|
||||
pm_enable_twt_keep_alive = 0x40000d4c;
|
||||
/*pm_twt_on_tsf_timer = 0x40000d50;*/
|
||||
pm_twt_on_tsf_timer = 0x40000d50;
|
||||
pm_twt_process = 0x40000d54;
|
||||
pm_is_twt_start = 0x40000d58;
|
||||
pm_twt_set_target_wdev_time = 0x40000d5c;
|
||||
@@ -197,7 +200,7 @@ ppSearchTxQueue = 0x40000e0c;
|
||||
ppSearchTxframe = 0x40000e10;
|
||||
ppSelectNextQueue = 0x40000e14;
|
||||
ppSubFromAMPDU = 0x40000e18;
|
||||
/*ppTask = 0x40000e1c;*/
|
||||
ppTask = 0x40000e1c;
|
||||
ppTxPkt = 0x40000e20;
|
||||
ppTxProtoProc = 0x40000e24;
|
||||
ppTxqUpdateBitmap = 0x40000e28;
|
||||
@@ -241,13 +244,13 @@ rcSetTxAmpduLimit = 0x40000ebc;
|
||||
rcTxUpdatePer = 0x40000ec0;
|
||||
rcUpdateAckSnr = 0x40000ec4;
|
||||
rcUpdateRate = 0x40000ec8;
|
||||
/*rcUpdateTxDone = 0x40000ecc;*/
|
||||
/*rcUpdateTxDoneAmpdu2 = 0x40000ed0;*/
|
||||
rcUpdateTxDone = 0x40000ecc;
|
||||
rcUpdateTxDoneAmpdu2 = 0x40000ed0;
|
||||
rcUpSched = 0x40000ed4;
|
||||
rcReachRetryLimit = 0x40000ed8;
|
||||
rcGetDCMMaxRate = 0x40000edc;
|
||||
rcGetSMPDURate = 0x40000ee0;
|
||||
/*rcGetRate = 0x40000ee4;*/
|
||||
rcGetRate = 0x40000ee4;
|
||||
rx11AXRate2AMPDULimit = 0x40000ee8;
|
||||
rx11NRate2AMPDULimit = 0x40000eec;
|
||||
rssi_margin = 0x40000ef0;
|
||||
@@ -263,7 +266,7 @@ trcAmpduSetState = 0x40000f14;
|
||||
trc_set_bf_report_rate = 0x40000f18;
|
||||
trc_onPPTxDone = 0x40000f1c;
|
||||
wDevCheckBlockError = 0x40000f20;
|
||||
/*wDev_AppendRxBlocks = 0x40000f24;*/
|
||||
wDev_AppendRxBlocks = 0x40000f24;
|
||||
wDev_DiscardFrame = 0x40000f28;
|
||||
wDev_GetNoiseFloor = 0x40000f2c;
|
||||
wDev_IndicateAmpdu = 0x40000f30;
|
||||
@@ -275,7 +278,7 @@ wdev_mac_special_reg_store = 0x40000f44;
|
||||
wdev_mac_wakeup = 0x40000f48;
|
||||
wdev_mac_sleep = 0x40000f4c;
|
||||
wDev_ProcessFiq = 0x40000f50;
|
||||
/*wDev_ProcessRxSucData = 0x40000f54;*/
|
||||
wDev_ProcessRxSucData = 0x40000f54;
|
||||
wdevProcessRxSucDataAll = 0x40000f58;
|
||||
wdev_csi_len_align = 0x40000f5c;
|
||||
wDev_IndicateBeaconMemoryFrame = 0x40000f60;
|
||||
|
@@ -555,20 +555,38 @@ menu "Wi-Fi"
|
||||
default n
|
||||
help
|
||||
Select this option to enable 802.11k 802.11v APIs(RRM and BTM support).
|
||||
|
||||
config ESP_WIFI_RRM_SUPPORT
|
||||
bool "Enable 802.11k APIs Support"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
default n
|
||||
help
|
||||
Select this option to enable 802.11k APIs(RRM support).
|
||||
Only APIs which are helpful for network assisted roaming
|
||||
are supported for now.
|
||||
Enable this option with BTM and RRM enabled in sta config
|
||||
Enable this option with RRM enabled in sta config
|
||||
to make device ready for network assisted roaming.
|
||||
BTM: BSS transition management enables an AP to request a station to transition
|
||||
to a specific AP, or to indicate to a station a set of preferred APs.
|
||||
RRM: Radio measurements enable STAs to understand the radio environment,
|
||||
it enables STAs to observe and gather data on radio link performance
|
||||
and on the radio environment. Current implementation adds beacon report,
|
||||
link measurement, neighbor report.
|
||||
|
||||
config ESP_WIFI_WNM_SUPPORT
|
||||
bool "Enable 802.11v APIs Support"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
default n
|
||||
help
|
||||
Select this option to enable 802.11v APIs(BTM support).
|
||||
Only APIs which are helpful for network assisted roaming
|
||||
are supported for now.
|
||||
Enable this option with BTM enabled in sta config
|
||||
to make device ready for network assisted roaming.
|
||||
BTM: BSS transition management enables an AP to request a station to transition
|
||||
to a specific AP, or to indicate to a station a set of preferred APs.
|
||||
|
||||
config ESP_WIFI_SCAN_CACHE
|
||||
bool "Keep scan results in cache"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
depends on ESP_WIFI_RRM_SUPPORT
|
||||
default n
|
||||
help
|
||||
Keep scan results in cache, if not enabled, those
|
||||
@@ -578,6 +596,8 @@ menu "Wi-Fi"
|
||||
bool "Enable Multi Band Operation Certification Support"
|
||||
default n
|
||||
select ESP_WIFI_11KV_SUPPORT
|
||||
select ESP_WIFI_RRM_SUPPORT
|
||||
select ESP_WIFI_WNM_SUPPORT
|
||||
select ESP_WIFI_SCAN_CACHE
|
||||
help
|
||||
Select this option to enable WiFi Multiband operation certification support.
|
||||
|
@@ -1312,8 +1312,9 @@ typedef struct {
|
||||
* @brief Argument structure for WIFI_EVENT_STA_NEIGHBOR_REP event
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t report[ESP_WIFI_MAX_NEIGHBOR_REP_LEN]; /**< Neighbor Report received from the AP*/
|
||||
uint8_t report[ESP_WIFI_MAX_NEIGHBOR_REP_LEN]; /**< Neighbor Report received from the AP (will be deprecated in next major release, use n_report instead)*/
|
||||
uint16_t report_len; /**< Length of the report*/
|
||||
uint8_t n_report[]; /**< Neighbor Report received from the AP*/
|
||||
} wifi_event_neighbor_report_t;
|
||||
|
||||
/** Argument structure for WIFI_EVENT_AP_WRONG_PASSWORD event */
|
||||
|
Submodule components/esp_wifi/lib updated: b15699a76c...73ba41ad38
@@ -66,13 +66,13 @@ menu "Roaming Methods"
|
||||
bool "Support Legacy roaming approach"
|
||||
default y
|
||||
help
|
||||
Roaming between APs that do not support 802.11kv.
|
||||
Roaming between APs that do not support 802.11v.
|
||||
This will allow station to roam even when connection is not BTM supported,
|
||||
by forcefully disconnecting from current AP and connecting to better AP.
|
||||
|
||||
config ESP_WIFI_ROAMING_NETWORK_ASSISTED_ROAM
|
||||
bool "Support Network Assisted roaming using 802.11kv"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
bool "Support Network Assisted roaming using 802.11v"
|
||||
depends on ESP_WIFI_WNM_SUPPORT
|
||||
default y
|
||||
help
|
||||
Roaming between APs using network assisted Roaming.
|
||||
@@ -151,7 +151,7 @@ config ESP_WIFI_ROAMING_BACKOFF_TIME
|
||||
|
||||
config ESP_WIFI_ROAMING_PERIODIC_RRM_MONITORING
|
||||
bool "Send periodic neighbor report request to AP for internal list updation"
|
||||
depends on ESP_WIFI_11KV_SUPPORT
|
||||
depends on ESP_WIFI_RRM_SUPPORT
|
||||
default y
|
||||
help
|
||||
This option will enable station to keep sending RRM neighbor list request to AP and
|
||||
|
@@ -39,7 +39,7 @@ Currently 2 methods of roaming are supported by the roaming app. (Roaming App Se
|
||||
|
||||
1) Network Assisted Roaming:
|
||||
|
||||
Enabled by “Support Network Assisted Roaming using 802.11kv”, this method primarily uses the BSS transition Management mechanisms outlined in IEEE 802.11v. It uses Candidates received from neighbor report requests (if enabled, explained later.) and scanning results to Send BSS transition Management Queries to the AP it is currently associated to. Depending on the current radio environment and vendor implementation on the side of the AP, this could then lead to BSS Transition Management Requests and corresponding BSS Transition Management responses which could lead to a seamless transition from one AP to another. For a better understanding of the mechanisms involved and the general implementation please look up the IEEE 802.11v specification and upstream wpa_supplicant’s implementation.
|
||||
Enabled by “Support Network Assisted Roaming using 802.11v”, this method primarily uses the BSS transition Management mechanisms outlined in IEEE 802.11v. It uses Candidates received from neighbor report requests (if enabled, explained later.) and scanning results to Send BSS transition Management Queries to the AP it is currently associated to. Depending on the current radio environment and vendor implementation on the side of the AP, this could then lead to BSS Transition Management Requests and corresponding BSS Transition Management responses which could lead to a seamless transition from one AP to another. For a better understanding of the mechanisms involved and the general implementation please look up the IEEE 802.11v specification and upstream wpa_supplicant’s implementation.
|
||||
|
||||
Please note that for this to work as expected, the APs should support 802.11k & 802.11v and be setup in a network where they are aware of each other.
|
||||
|
||||
|
@@ -174,8 +174,11 @@ endif()
|
||||
if(CONFIG_ESP_WIFI_11KV_SUPPORT OR CONFIG_ESP_WIFI_11R_SUPPORT)
|
||||
set(roaming_src
|
||||
"src/common/ieee802_11_common.c")
|
||||
if(CONFIG_ESP_WIFI_11KV_SUPPORT)
|
||||
set(roaming_src ${roaming_src} "src/common/rrm.c" "src/common/wnm_sta.c")
|
||||
if(CONFIG_ESP_WIFI_RRM_SUPPORT)
|
||||
set(roaming_src ${roaming_src} "src/common/rrm.c")
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_WNM_SUPPORT)
|
||||
set(roaming_src ${roaming_src} "src/common/wnm_sta.c")
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_11R_SUPPORT)
|
||||
set(roaming_src ${roaming_src} "src/rsn_supp/wpa_ft.c")
|
||||
@@ -289,7 +292,13 @@ 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_SUPPLICANT_TASK CONFIG_WNM CONFIG_RRM CONFIG_IEEE80211KV)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WNM CONFIG_RRM CONFIG_IEEE80211KV)
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_RRM_SUPPORT)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_RRM)
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_WNM_SUPPORT)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_WNM)
|
||||
endif()
|
||||
if(CONFIG_ESP_WIFI_11R_SUPPORT)
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE CONFIG_IEEE80211R)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -38,43 +38,9 @@ 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)
|
||||
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
static void *s_supplicant_task_hdl = NULL;
|
||||
static void *s_supplicant_evt_queue = NULL;
|
||||
static void *s_supplicant_api_lock = NULL;
|
||||
static bool s_supplicant_task_init_done;
|
||||
#define SUPPLICANT_API_LOCK() os_mutex_lock(s_supplicant_api_lock)
|
||||
#define SUPPLICANT_API_UNLOCK() os_mutex_unlock(s_supplicant_api_lock)
|
||||
#define SUPPLICANT_TASK_STACK_SIZE (6144 + TASK_STACK_SIZE_ADD)
|
||||
|
||||
static int handle_action_frm(u8 *frame, size_t len,
|
||||
u8 *sender, int8_t rssi, u8 channel)
|
||||
{
|
||||
struct ieee_mgmt_frame *frm = os_malloc(sizeof(struct ieee_mgmt_frame) + len);
|
||||
|
||||
if (!frm) {
|
||||
wpa_printf(MSG_ERROR, "memory allocation failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
os_memcpy(frm->sender, sender, ETH_ALEN);
|
||||
frm->len = len;
|
||||
frm->channel = channel;
|
||||
frm->rssi = rssi;
|
||||
|
||||
os_memcpy(frm->payload, frame, len);
|
||||
if (esp_supplicant_post_evt(SIG_SUPPLICANT_RX_ACTION, (u32)frm) != 0) {
|
||||
os_free(frm);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_SUPPLICANT_TASK */
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV)
|
||||
#if defined(CONFIG_RRM)
|
||||
static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender,
|
||||
u8 *payload, size_t len, int8_t rssi)
|
||||
{
|
||||
@@ -91,6 +57,7 @@ static void handle_rrm_frame(struct wpa_supplicant *wpa_s, u8 *sender,
|
||||
payload + 1, len - 1, rssi);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_RRM */
|
||||
|
||||
static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 channel)
|
||||
{
|
||||
@@ -106,65 +73,18 @@ static int mgmt_rx_action(u8 *frame, size_t len, u8 *sender, int8_t rssi, u8 cha
|
||||
|
||||
category = *frame++;
|
||||
len--;
|
||||
#if defined(CONFIG_WNM)
|
||||
if (category == WLAN_ACTION_WNM) {
|
||||
ieee802_11_rx_wnm_action(wpa_s, sender, frame, len);
|
||||
} else if (category == WLAN_ACTION_RADIO_MEASUREMENT) {
|
||||
}
|
||||
#endif /* CONFIG_WNM */
|
||||
#if defined(CONFIG_RRM)
|
||||
if (category == WLAN_ACTION_RADIO_MEASUREMENT) {
|
||||
handle_rrm_frame(wpa_s, sender, frame, len, rssi);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_RRM */
|
||||
return 0;
|
||||
}
|
||||
#endif /* defined(CONFIG_IEEE80211KV) */
|
||||
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
static void btm_rrm_task(void *pvParameters)
|
||||
{
|
||||
supplicant_event_t *evt;
|
||||
bool task_del = false;
|
||||
|
||||
while (1) {
|
||||
if (os_queue_recv(s_supplicant_evt_queue, &evt, OS_BLOCK) != TRUE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* event validation failed */
|
||||
if (evt->id >= SIG_SUPPLICANT_MAX) {
|
||||
os_free(evt);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (evt->id) {
|
||||
case SIG_SUPPLICANT_RX_ACTION: {
|
||||
struct ieee_mgmt_frame *frm = (struct ieee_mgmt_frame *)evt->data;
|
||||
mgmt_rx_action(frm->payload, frm->len, frm->sender, frm->rssi, frm->channel);
|
||||
os_free(frm);
|
||||
break;
|
||||
}
|
||||
|
||||
case SIG_SUPPLICANT_SCAN_DONE:
|
||||
esp_supplicant_handle_scan_done_evt();
|
||||
break;
|
||||
case SIG_SUPPLICANT_DEL_TASK:
|
||||
task_del = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
os_free(evt);
|
||||
|
||||
if (task_del) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
os_queue_delete(s_supplicant_evt_queue);
|
||||
s_supplicant_evt_queue = NULL;
|
||||
|
||||
/* At this point, we completed */
|
||||
os_task_delete(NULL);
|
||||
}
|
||||
#endif /* CONFIG_SUPPLICANT_TASK */
|
||||
|
||||
static void clear_bssid_flag_and_channel(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
@@ -198,19 +118,20 @@ static void register_mgmt_frames(struct wpa_supplicant *wpa_s)
|
||||
/* subtype is defined only for action frame */
|
||||
wpa_s->subtype = 0;
|
||||
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#ifdef CONFIG_RRM
|
||||
/* current supported features in supplicant: rrm and btm */
|
||||
if (esp_wifi_is_rm_enabled_internal(WIFI_IF_STA)) {
|
||||
wpa_s->subtype = 1 << WLAN_ACTION_RADIO_MEASUREMENT;
|
||||
}
|
||||
#endif /* CONFIG_RRM */
|
||||
#ifdef CONFIG_WNM
|
||||
if (esp_wifi_is_btm_enabled_internal(WIFI_IF_STA)) {
|
||||
wpa_s->subtype |= 1 << WLAN_ACTION_WNM;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WNM */
|
||||
if (wpa_s->subtype) {
|
||||
wpa_s->type |= 1 << WLAN_FC_STYPE_ACTION;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
/* register auth/assoc frames if FT is enabled */
|
||||
@@ -252,6 +173,19 @@ static int handle_assoc_frame(u8 *frame, size_t len,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void wpa_sta_clear_ft_auth_ie(void)
|
||||
{
|
||||
struct wpa_sm *sm = &gWpaSm;
|
||||
wpa_printf(MSG_DEBUG, "Clearing all FT IE parameters and keys");
|
||||
/* Reset FT parameters */
|
||||
wpa_sm_set_ft_params(sm, NULL, 0);
|
||||
esp_wifi_unset_appie_internal(WIFI_APPIE_RAM_STA_AUTH);
|
||||
sm->ft_reassoc_completed = 0;
|
||||
sm->ft_protocol = 0;
|
||||
/* Clear pmk and ptk */
|
||||
wpa_sm_drop_sa(sm);
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
|
||||
@@ -269,7 +203,7 @@ static int ieee80211_handle_rx_frm(u8 type, u8 *frame, size_t len, u8 *sender,
|
||||
int ret = 0;
|
||||
|
||||
switch (type) {
|
||||
#if defined(CONFIG_IEEE80211R) || defined(CONFIG_IEEE80211KV)
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
case WLAN_FC_STYPE_BEACON:
|
||||
case WLAN_FC_STYPE_PROBE_RESP:
|
||||
ret = esp_handle_beacon_probe(type, frame, len, sender, rssi, channel, current_tsf);
|
||||
@@ -282,18 +216,14 @@ static int ieee80211_handle_rx_frm(u8 type, u8 *frame, size_t len, u8 *sender,
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
case WLAN_FC_STYPE_ASSOC_RESP:
|
||||
case WLAN_FC_STYPE_REASSOC_RESP:
|
||||
wpa_sm_notify_assoc(&gWpaSm, sender);
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
ret = handle_assoc_frame(frame, len, sender, rssi, channel);
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
wpa_sm_notify_assoc(&gWpaSm, sender);
|
||||
break;
|
||||
#if defined(CONFIG_IEEE80211KV)
|
||||
case WLAN_FC_STYPE_ACTION:
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
ret = handle_action_frm(frame, len, sender, rssi, channel);
|
||||
#else /* CONFIG_SUPPLICANT_TASK */
|
||||
ret = mgmt_rx_action(frame, len, sender, rssi, channel);
|
||||
#endif /* CONFIG_SUPPLICANT_TASK */
|
||||
mgmt_rx_action(frame, len, sender, rssi, channel);
|
||||
break;
|
||||
#endif /* defined(CONFIG_IEEE80211KV) */
|
||||
default:
|
||||
@@ -338,36 +268,10 @@ int esp_supplicant_common_init(struct wpa_funcs *wpa_cb)
|
||||
int ret = 0;
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
if (!s_supplicant_api_lock) {
|
||||
s_supplicant_api_lock = os_recursive_mutex_create();
|
||||
}
|
||||
|
||||
if (!s_supplicant_api_lock) {
|
||||
wpa_printf(MSG_ERROR, "%s: failed to create Supplicant API lock", __func__);
|
||||
ret = -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
s_supplicant_evt_queue = os_queue_create(3, sizeof(supplicant_event_t));
|
||||
|
||||
if (!s_supplicant_evt_queue) {
|
||||
wpa_printf(MSG_ERROR, "%s: failed to create Supplicant event queue", __func__);
|
||||
ret = -1;
|
||||
goto err;
|
||||
}
|
||||
ret = os_task_create(btm_rrm_task, "btm_rrm_t", SUPPLICANT_TASK_STACK_SIZE, NULL, 2, &s_supplicant_task_hdl);
|
||||
if (ret != TRUE) {
|
||||
wpa_printf(MSG_ERROR, "btm: failed to create task");
|
||||
ret = -1;
|
||||
goto err;
|
||||
}
|
||||
s_supplicant_task_init_done = true;
|
||||
#endif /* CONFIG_SUPPLICANT_TASK */
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#if defined(CONFIG_RRM)
|
||||
wpas_rrm_reset(wpa_s);
|
||||
wpas_clear_beacon_rep_data(wpa_s);
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
esp_scan_init(wpa_s);
|
||||
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
@@ -397,36 +301,16 @@ void esp_supplicant_common_deinit(void)
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
esp_scan_deinit(wpa_s);
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#if defined(CONFIG_RRM)
|
||||
wpas_rrm_reset(wpa_s);
|
||||
wpas_clear_beacon_rep_data(wpa_s);
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
if (wpa_s->type) {
|
||||
wpa_s->type = 0;
|
||||
esp_wifi_register_mgmt_frame_internal(wpa_s->type, wpa_s->subtype);
|
||||
}
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
/* We have failed to create task, delete queue and exit */
|
||||
if (!s_supplicant_task_hdl) {
|
||||
if (s_supplicant_evt_queue) {
|
||||
os_queue_delete(s_supplicant_evt_queue);
|
||||
s_supplicant_evt_queue = NULL;
|
||||
}
|
||||
if (s_supplicant_api_lock) {
|
||||
os_mutex_delete(s_supplicant_api_lock);
|
||||
s_supplicant_api_lock = NULL;
|
||||
}
|
||||
} else if (esp_supplicant_post_evt(SIG_SUPPLICANT_DEL_TASK, 0) != 0) {
|
||||
/* failed to post delete event, just delete event queue and exit */
|
||||
if (s_supplicant_evt_queue) {
|
||||
os_queue_delete(s_supplicant_evt_queue);
|
||||
s_supplicant_evt_queue = NULL;
|
||||
}
|
||||
}
|
||||
s_supplicant_task_init_done = false;
|
||||
#endif /* CONFIG_SUPPLICANT_TASK */
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
}
|
||||
|
||||
@@ -455,9 +339,10 @@ void supplicant_sta_conn_handler(uint8_t *bssid)
|
||||
void supplicant_sta_disconn_handler(uint8_t reason_code)
|
||||
{
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
struct wpa_sm *sm = &gWpaSm;
|
||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#if defined(CONFIG_RRM)
|
||||
wpas_rrm_reset(wpa_s);
|
||||
wpas_clear_beacon_rep_data(wpa_s);
|
||||
/* Not clearing in case of roaming disconnect as BTM induced connection
|
||||
@@ -466,15 +351,21 @@ void supplicant_sta_disconn_handler(uint8_t reason_code)
|
||||
if (reason_code != WIFI_REASON_ROAMING) {
|
||||
clear_bssid_flag_and_channel(wpa_s);
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
if (wpa_s->current_bss) {
|
||||
wpa_s->current_bss = NULL;
|
||||
}
|
||||
#if defined(CONFIG_IEEE80211R)
|
||||
if (!sm->cur_pmksa) {
|
||||
/* clear all ft auth related IEs so that next will be open auth */
|
||||
wpa_sta_clear_ft_auth_ie();
|
||||
}
|
||||
#endif
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R)
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#if defined(CONFIG_RRM)
|
||||
bool esp_rrm_is_rrm_supported_connection(void)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||
@@ -521,20 +412,24 @@ 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;
|
||||
}
|
||||
if (report_len > ESP_WIFI_MAX_NEIGHBOR_REP_LEN) {
|
||||
wpa_printf(MSG_ERROR, "RRM: Neighbor report too large (>%d bytes), hence not reporting", ESP_WIFI_MAX_NEIGHBOR_REP_LEN);
|
||||
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) {
|
||||
wpa_printf(MSG_DEBUG, "memory alloc failed");
|
||||
return;
|
||||
}
|
||||
wpa_printf(MSG_DEBUG, "RRM: Notifying neighbor report (token = %d)", report[0]);
|
||||
wifi_event_neighbor_report_t neighbor_report_event = {0};
|
||||
os_memcpy(neighbor_report_event.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);
|
||||
|
||||
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) + report_len, 0);
|
||||
os_free(neighbor_report_event);
|
||||
}
|
||||
|
||||
int esp_rrm_send_neighbor_report_request(void)
|
||||
@@ -562,6 +457,33 @@ int esp_rrm_send_neighbor_report_request(void)
|
||||
return wpas_rrm_send_neighbor_rep_request(wpa_s, &wpa_ssid, 0, 0, neighbor_report_recvd_cb, NULL);
|
||||
}
|
||||
|
||||
static size_t get_rm_enabled_ie(uint8_t *ie, size_t len)
|
||||
{
|
||||
uint8_t rrm_ie[7] = {0};
|
||||
uint8_t rrm_ie_len = 5;
|
||||
uint8_t *pos = rrm_ie;
|
||||
|
||||
if (!esp_wifi_is_rm_enabled_internal(WIFI_IF_STA)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pos++ = WLAN_EID_RRM_ENABLED_CAPABILITIES;
|
||||
*pos++ = rrm_ie_len;
|
||||
*pos |= WLAN_RRM_CAPS_LINK_MEASUREMENT;
|
||||
|
||||
*pos |= WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE |
|
||||
#ifdef SCAN_CACHE_SUPPORTED
|
||||
WLAN_RRM_CAPS_BEACON_REPORT_TABLE |
|
||||
#endif /* SCAN_CACHE_SUPPORTED */
|
||||
WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE;
|
||||
|
||||
os_memcpy(ie, rrm_ie, sizeof(rrm_ie));
|
||||
|
||||
return rrm_ie_len + 2;
|
||||
}
|
||||
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
#if defined(CONFIG_WNM)
|
||||
bool esp_wnm_is_btm_supported_connection(void)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||
@@ -597,6 +519,37 @@ int esp_wnm_send_bss_transition_mgmt_query(enum btm_query_reason query_reason,
|
||||
return wnm_send_bss_transition_mgmt_query(wpa_s, query_reason, btm_candidates, cand_list);
|
||||
}
|
||||
|
||||
static uint8_t get_extended_caps_ie(uint8_t *ie, size_t len)
|
||||
{
|
||||
uint8_t ext_caps_ie[5] = {0};
|
||||
uint8_t ext_caps_ie_len = 3;
|
||||
uint8_t *pos = ext_caps_ie;
|
||||
wifi_ioctl_config_t cfg = {0};
|
||||
esp_err_t err = 0;
|
||||
|
||||
if (!esp_wifi_is_btm_enabled_internal(WIFI_IF_STA)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pos++ = WLAN_EID_EXT_CAPAB;
|
||||
*pos++ = ext_caps_ie_len;
|
||||
|
||||
err = esp_wifi_internal_ioctl(WIFI_IOCTL_GET_STA_HT2040_COEX, &cfg);
|
||||
if (err == ESP_OK && cfg.data.ht2040_coex.enable) {
|
||||
*pos++ |= BIT(WLAN_EXT_CAPAB_20_40_COEX);
|
||||
} else {
|
||||
*pos++ = 0;
|
||||
}
|
||||
*pos ++ = 0;
|
||||
#define CAPAB_BSS_TRANSITION BIT(3)
|
||||
*pos |= CAPAB_BSS_TRANSITION;
|
||||
#undef CAPAB_BSS_TRANSITION
|
||||
os_memcpy(ie, ext_caps_ie, sizeof(ext_caps_ie));
|
||||
|
||||
return ext_caps_ie_len + 2;
|
||||
}
|
||||
#endif /* defined(CONFIG_WNM) */
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
int esp_mbo_update_non_pref_chan(struct non_pref_chan_s *non_pref_chan)
|
||||
{
|
||||
@@ -604,56 +557,7 @@ int esp_mbo_update_non_pref_chan(struct non_pref_chan_s *non_pref_chan)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_MBO */
|
||||
|
||||
void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_bss *bss, char *ssid)
|
||||
{
|
||||
wifi_config_t *config = os_zalloc(sizeof(wifi_config_t));
|
||||
|
||||
if (!config) {
|
||||
wpa_printf(MSG_ERROR, "failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
|
||||
esp_wifi_get_config(WIFI_IF_STA, config);
|
||||
/* We only support roaming in same ESS, therefore only bssid setting is needed */
|
||||
os_memcpy(config->sta.bssid, bss->bssid, ETH_ALEN);
|
||||
config->sta.bssid_set = 1;
|
||||
config->sta.channel = bss->channel;
|
||||
/* supplicant connect will only be called in case of bss transition(roaming) */
|
||||
esp_wifi_internal_issue_disconnect(WIFI_REASON_BSS_TRANSITION_DISASSOC);
|
||||
esp_wifi_set_config(WIFI_IF_STA, config);
|
||||
os_free(config);
|
||||
esp_wifi_connect();
|
||||
}
|
||||
|
||||
static size_t get_rm_enabled_ie(uint8_t *ie, size_t len)
|
||||
{
|
||||
uint8_t rrm_ie[7] = {0};
|
||||
uint8_t rrm_ie_len = 5;
|
||||
uint8_t *pos = rrm_ie;
|
||||
|
||||
if (!esp_wifi_is_rm_enabled_internal(WIFI_IF_STA)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pos++ = WLAN_EID_RRM_ENABLED_CAPABILITIES;
|
||||
*pos++ = rrm_ie_len;
|
||||
*pos |= WLAN_RRM_CAPS_LINK_MEASUREMENT;
|
||||
|
||||
*pos |= WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE |
|
||||
#ifdef SCAN_CACHE_SUPPORTED
|
||||
WLAN_RRM_CAPS_BEACON_REPORT_TABLE |
|
||||
#endif /* SCAN_CACHE_SUPPORTED */
|
||||
WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE;
|
||||
|
||||
os_memcpy(ie, rrm_ie, sizeof(rrm_ie));
|
||||
|
||||
return rrm_ie_len + 2;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MBO
|
||||
static size_t get_mbo_oce_scan_ie(uint8_t *ie, size_t len)
|
||||
{
|
||||
uint8_t mbo_ie[32] = {0};
|
||||
@@ -710,42 +614,31 @@ static uint8_t get_operating_class_ie(uint8_t *ie, size_t len)
|
||||
}
|
||||
#endif /* CONFIG_MBO */
|
||||
|
||||
static uint8_t get_extended_caps_ie(uint8_t *ie, size_t len)
|
||||
void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_bss *bss, char *ssid)
|
||||
{
|
||||
uint8_t ext_caps_ie[5] = {0};
|
||||
uint8_t ext_caps_ie_len = 3;
|
||||
uint8_t *pos = ext_caps_ie;
|
||||
wifi_ioctl_config_t cfg = {0};
|
||||
esp_err_t err = 0;
|
||||
wifi_config_t *config = os_zalloc(sizeof(wifi_config_t));
|
||||
|
||||
if (!esp_wifi_is_btm_enabled_internal(WIFI_IF_STA)) {
|
||||
return 0;
|
||||
if (!config) {
|
||||
wpa_printf(MSG_ERROR, "failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
|
||||
*pos++ = WLAN_EID_EXT_CAPAB;
|
||||
*pos++ = ext_caps_ie_len;
|
||||
|
||||
err = esp_wifi_internal_ioctl(WIFI_IOCTL_GET_STA_HT2040_COEX, &cfg);
|
||||
if (err == ESP_OK && cfg.data.ht2040_coex.enable) {
|
||||
*pos++ |= BIT(WLAN_EXT_CAPAB_20_40_COEX);
|
||||
} else {
|
||||
*pos++ = 0;
|
||||
}
|
||||
*pos ++ = 0;
|
||||
#define CAPAB_BSS_TRANSITION BIT(3)
|
||||
*pos |= CAPAB_BSS_TRANSITION;
|
||||
#undef CAPAB_BSS_TRANSITION
|
||||
os_memcpy(ie, ext_caps_ie, sizeof(ext_caps_ie));
|
||||
|
||||
return ext_caps_ie_len + 2;
|
||||
esp_wifi_get_config(WIFI_IF_STA, config);
|
||||
/* We only support roaming in same ESS, therefore only bssid setting is needed */
|
||||
os_memcpy(config->sta.bssid, bss->bssid, ETH_ALEN);
|
||||
config->sta.bssid_set = 1;
|
||||
config->sta.channel = bss->channel;
|
||||
/* supplicant connect will only be called in case of bss transition(roaming) */
|
||||
esp_wifi_internal_issue_disconnect(WIFI_REASON_BSS_TRANSITION_DISASSOC);
|
||||
esp_wifi_set_config(WIFI_IF_STA, config);
|
||||
os_free(config);
|
||||
esp_wifi_connect();
|
||||
}
|
||||
|
||||
#else /* CONFIG_IEEE80211KV */
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
|
||||
void esp_set_scan_ie(void)
|
||||
{
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#ifdef CONFIG_WNM
|
||||
#define SCAN_IE_LEN 64
|
||||
uint8_t *ie, *pos;
|
||||
size_t len = SCAN_IE_LEN, ie_len;
|
||||
@@ -768,7 +661,7 @@ void esp_set_scan_ie(void)
|
||||
esp_wifi_set_appie_internal(WIFI_APPIE_PROBEREQ, ie, SCAN_IE_LEN - len, 0);
|
||||
os_free(ie);
|
||||
#undef SCAN_IE_LEN
|
||||
#endif /* CONFIG_IEEE80211KV */
|
||||
#endif /* defined(CONFIG_WNM) */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
@@ -802,13 +695,11 @@ static size_t add_mdie(uint8_t *bssid, uint8_t *ie, size_t len)
|
||||
|
||||
return mdie_len;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
int wpa_sm_update_ft_ies(struct wpa_sm *sm, const u8 *md,
|
||||
const u8 *ies, size_t ies_len, bool auth_ie)
|
||||
{
|
||||
wpa_printf(MSG_INFO, "Updating FT IEs (len=%d)", ies_len);
|
||||
wpa_printf(MSG_INFO, "Updating FT IEs (len=%d), auth_ie %d ", ies_len, auth_ie);
|
||||
if (os_memcmp(sm->mobility_domain, md, MOBILITY_DOMAIN_ID_LEN) != 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -874,44 +765,9 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
int esp_supplicant_post_evt(uint32_t evt_id, uint32_t data)
|
||||
{
|
||||
supplicant_event_t *evt = os_zalloc(sizeof(supplicant_event_t));
|
||||
if (!evt) {
|
||||
wpa_printf(MSG_ERROR, "Failed to allocated memory");
|
||||
return -1;
|
||||
}
|
||||
evt->id = evt_id;
|
||||
evt->data = data;
|
||||
|
||||
/* Make sure lock exists before taking it */
|
||||
SUPPLICANT_API_LOCK();
|
||||
|
||||
/* Make sure no event can be sent when deletion event is sent or task not initialized */
|
||||
if (!s_supplicant_task_init_done) {
|
||||
SUPPLICANT_API_UNLOCK();
|
||||
os_free(evt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (os_queue_send(s_supplicant_evt_queue, &evt, os_task_ms_to_tick(10)) != TRUE) {
|
||||
SUPPLICANT_API_UNLOCK();
|
||||
os_free(evt);
|
||||
return -1;
|
||||
}
|
||||
if (evt_id == SIG_SUPPLICANT_DEL_TASK) {
|
||||
s_supplicant_task_init_done = false;
|
||||
}
|
||||
SUPPLICANT_API_UNLOCK();
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_SUPPLICANT_TASK */
|
||||
#else /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
void esp_set_scan_ie(void) { }
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
|
||||
#ifndef CONFIG_IEEE80211KV
|
||||
bool esp_rrm_is_rrm_supported_connection(void)
|
||||
{
|
||||
return false;
|
||||
@@ -939,7 +795,7 @@ int esp_wnm_send_bss_transition_mgmt_query(enum btm_query_reason query_reason,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_IEEE80211KV */
|
||||
#endif /* defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) */
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV) || defined(CONFIG_IEEE80211R) || defined(CONFIG_WPA3_SAE)
|
||||
void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie)
|
||||
@@ -956,7 +812,7 @@ void esp_set_assoc_ie(uint8_t *bssid, const u8 *ies, size_t ies_len, bool mdie)
|
||||
return;
|
||||
}
|
||||
pos = ie;
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#if defined(CONFIG_RRM)
|
||||
ie_len = get_rm_enabled_ie(pos, len);
|
||||
pos += ie_len;
|
||||
len -= ie_len;
|
||||
@@ -968,7 +824,7 @@ 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 /* CONFIG_IEEE80211KV */
|
||||
#endif /* defined(CONFIG_RRM) */
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
if (mdie) {
|
||||
ie_len = add_mdie(bssid, pos, len);
|
||||
|
@@ -12,7 +12,7 @@
|
||||
struct wpa_funcs;
|
||||
extern struct wpa_supplicant g_wpa_supp;
|
||||
|
||||
#ifdef CONFIG_IEEE80211KV
|
||||
#if defined(CONFIG_RRM) || defined(CONFIG_WNM)
|
||||
struct ieee_mgmt_frame {
|
||||
u8 sender[ETH_ALEN];
|
||||
u8 channel;
|
||||
@@ -21,25 +21,11 @@ struct ieee_mgmt_frame {
|
||||
u8 payload[0];
|
||||
};
|
||||
|
||||
int esp_supplicant_post_evt(uint32_t evt_id, uint32_t data);
|
||||
|
||||
typedef struct {
|
||||
uint32_t id;
|
||||
uint32_t data;
|
||||
} supplicant_event_t;
|
||||
|
||||
enum SIG_SUPPLICANT {
|
||||
SIG_SUPPLICANT_RX_ACTION,
|
||||
SIG_SUPPLICANT_SCAN_DONE,
|
||||
SIG_SUPPLICANT_DEL_TASK,
|
||||
SIG_SUPPLICANT_MAX,
|
||||
};
|
||||
|
||||
void esp_get_tx_power(uint8_t *tx_power);
|
||||
#ifdef CONFIG_MBO
|
||||
bool mbo_bss_profile_match(u8 *bssid);
|
||||
#endif
|
||||
#endif
|
||||
#endif /* defined(CONFIG_RRM) || defined(CONFIG_WNM) */
|
||||
int esp_supplicant_common_init(struct wpa_funcs *wpa_cb);
|
||||
void esp_supplicant_common_deinit(void);
|
||||
void esp_supplicant_unset_all_appie(void);
|
||||
|
@@ -35,16 +35,10 @@ static void scan_done_event_handler(void *arg, ETS_STATUS status)
|
||||
wpa_s->type &= ~(1 << WLAN_FC_STYPE_BEACON) & ~(1 << WLAN_FC_STYPE_PROBE_RESP);
|
||||
esp_wifi_register_mgmt_frame_internal(wpa_s->type, wpa_s->subtype);
|
||||
}
|
||||
#ifdef CONFIG_SUPPLICANT_TASK
|
||||
if (esp_supplicant_post_evt(SIG_SUPPLICANT_SCAN_DONE, 0) != 0) {
|
||||
wpa_printf(MSG_ERROR, "Posting of scan done failed!");
|
||||
}
|
||||
#else
|
||||
esp_supplicant_handle_scan_done_evt();
|
||||
#endif /*CONFIG_SUPPLICANT_TASK*/
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IEEE80211KV)
|
||||
#if defined(CONFIG_WNM)
|
||||
static void handle_wnm_scan_done(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct wpa_bss *bss = wpa_bss_get_next_bss(wpa_s, wpa_s->current_bss);
|
||||
@@ -77,11 +71,14 @@ void esp_supplicant_handle_scan_done_evt(void)
|
||||
struct wpa_supplicant *wpa_s = &g_wpa_supp;
|
||||
|
||||
wpa_printf(MSG_INFO, "scan done received");
|
||||
#if defined(CONFIG_IEEE80211KV)
|
||||
#if defined(CONFIG_RRM)
|
||||
/* Check which module started this, call the respective function */
|
||||
if (wpa_s->scan_reason == REASON_RRM_BEACON_REPORT) {
|
||||
wpas_beacon_rep_scan_process(wpa_s, wpa_s->scan_start_tsf);
|
||||
} else if (wpa_s->scan_reason == REASON_WNM_BSS_TRANS_REQ) {
|
||||
}
|
||||
#endif
|
||||
#if defined(CONFIG_WNM)
|
||||
if (wpa_s->scan_reason == REASON_WNM_BSS_TRANS_REQ) {
|
||||
handle_wnm_scan_done(wpa_s);
|
||||
}
|
||||
#endif
|
||||
|
@@ -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;
|
||||
|
@@ -268,7 +268,7 @@ static int ieee802_11_parse_extension(struct wpa_supplicant *wpa_s, const struct
|
||||
*/
|
||||
int ieee802_11_parse_elems(struct wpa_supplicant *wpa_s, const u8 *start, size_t len)
|
||||
{
|
||||
#if defined(CONFIG_RRM) || defined(CONFIG_SAE_PK)
|
||||
#if defined(CONFIG_RRM) || defined(CONFIG_WNM) || defined(CONFIG_SAE_PK)
|
||||
const struct element *elem;
|
||||
u8 unknown = 0;
|
||||
|
||||
@@ -297,7 +297,7 @@ int ieee802_11_parse_elems(struct wpa_supplicant *wpa_s, const u8 *start, size_t
|
||||
}
|
||||
break;
|
||||
#endif /*CONFIG_SAE_PK*/
|
||||
#ifdef CONFIG_RRM
|
||||
#ifdef CONFIG_WNM
|
||||
case WLAN_EID_EXT_CAPAB:
|
||||
/* extended caps can go beyond 8 octacts but we aren't using them now */
|
||||
os_memcpy(wpa_s->extend_caps, pos, 5);
|
||||
@@ -311,7 +311,7 @@ int ieee802_11_parse_elems(struct wpa_supplicant *wpa_s, const u8 *start, size_t
|
||||
if (unknown)
|
||||
return -1;
|
||||
|
||||
#endif /* defined(CONFIG_RRM) || defined(CONFIG_SAE_PK) */
|
||||
#endif /* defined(CONFIG_RRM) || defined(CONFIG_WNM) || defined(CONFIG_SAE_PK) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -364,9 +364,8 @@ static void esp_bss_rssi_low_handler(void* arg, esp_event_base_t event_base,
|
||||
{
|
||||
wifi_event_bss_rssi_low_t *event = event_data;
|
||||
|
||||
ESP_LOGI(TAG, "%s:bss rssi is=%d", __func__, event->rssi);
|
||||
ESP_LOGI(TAG, "%s:bss rssi is=%ld", __func__, event->rssi);
|
||||
/* Lets check channel conditions */
|
||||
rrm_ctx++;
|
||||
if (esp_rrm_send_neighbor_report_request() < 0) {
|
||||
/* failed to send neighbor report request */
|
||||
ESP_LOGI(TAG, "failed to send neighbor report request");
|
||||
|
Reference in New Issue
Block a user