diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 2195b685a0e5c..bc23c3b93c5f9 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -671,8 +671,8 @@ struct wifi_iface_status { unsigned short beacon_interval; /** is TWT capable? */ bool twt_capable; - /** The current 802.11 PHY data rate */ - int current_phy_rate; + /** The current 802.11 PHY TX data rate (in Kbps) */ + int current_phy_tx_rate; }; /** @brief Wi-Fi power save parameters */ diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 13155af5cf3b2..6ca77e7cf3c26 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1538,8 +1538,10 @@ 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; + status->current_phy_tx_rate = signal_poll.current_txrate; } else { - wpa_printf(MSG_WARNING, "%s:Failed to read RSSI", __func__); + wpa_printf(MSG_WARNING, "%s: Failed to read signal poll info", + __func__); } } @@ -1567,15 +1569,6 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status } os_free(conn_info); - - ret = wpa_drv_signal_poll(wpa_s, si); - if (!ret) { - status->current_phy_rate = si->current_txrate; - } else { - wpa_printf(MSG_WARNING, "%s: Failed to get signal info\n", __func__); - status->current_phy_rate = 0; - ret = 0; - } } else { ret = 0; } diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index fac7a354e86e4..354e5e626cba0 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1113,7 +1113,9 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) PR("DTIM: %d\n", status.dtim_period); PR("TWT: %s\n", status.twt_capable ? "Supported" : "Not supported"); - PR("Current PHY rate : %d\n", status.current_phy_rate); + PR("Current PHY TX rate (Mbps) : %d.%03d\n", + status.current_phy_tx_rate / 1000, + status.current_phy_tx_rate % 1000); } return 0;