fix(wpa_supplicant): Add some minor fixes in roaming

1) Add a fix in roaming example for 11kvr
    2) Removed length constraint for neighbor report received.
This commit is contained in:
Aditi 2024-09-27 00:51:29 +05:30 committed by BOT
parent 9e168a1480
commit b2abac0a4e
3 changed files with 16 additions and 11 deletions

View File

@ -1203,8 +1203,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 band */

View File

@ -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
*/
@ -543,15 +543,20 @@ void neighbor_report_recvd_cb(void *ctx, const uint8_t *report, size_t report_le
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);
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;
wifi_event_neighbor_report_t *neighbor_report_event = os_zalloc(sizeof(wifi_event_neighbor_report_t) + report_len);
if (neighbor_report_event == NULL) {
wpa_printf(MSG_DEBUG, "memory alloc failed");
}
if (report_len < ESP_WIFI_MAX_NEIGHBOR_REP_LEN) {
os_memcpy(neighbor_report_event->report, report, report_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);
os_free(neighbor_report_event);
}
int esp_rrm_send_neighbor_report_request(void)

View File

@ -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");