From 03304184bb461f853300be01314bffe765a091d9 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Thu, 14 Dec 2023 20:32:21 +0530 Subject: [PATCH] hostap: Skip RSSI retrieval for AP mode RSSI is only applicable for STA mode, as for AP there are multiple peers. This causes failure and unnecessary delay, so just skip the retrieval. Signed-off-by: Chaitanya Tata Signed-off-by: Jukka Rissanen --- modules/hostap/src/supp_api.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 078a2a408a7..751a12ecefd 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -646,14 +646,16 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status } } - ret = z_wpa_ctrl_signal_poll(&signal_poll); - if (!ret) { - status->rssi = signal_poll.rssi; + if (IS_ENABLED(CONFIG_AP) && status->iface_mode == WIFI_MODE_INFRA) { + ret = z_wpa_ctrl_signal_poll(&signal_poll); + if (!ret) { + status->rssi = signal_poll.rssi; + } else { + wpa_printf(MSG_WARNING, "%s:Failed to read RSSI", __func__); + status->rssi = -WPA_INVALID_NOISE; + } } else { - wpa_printf(MSG_WARNING, "%s:Failed to read RSSI\n", - __func__); status->rssi = -WPA_INVALID_NOISE; - ret = 0; } conn_info = os_zalloc(sizeof(struct wpa_conn_info));