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 <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2023-12-14 20:32:21 +05:30 committed by Alberto Escolar
parent e648f0c24a
commit 03304184bb
1 changed files with 8 additions and 6 deletions

View File

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