From fa699fad0e5f5796151b440fba76b455165c4420 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Tue, 15 Jul 2025 06:51:42 +0000 Subject: [PATCH 1/2] wifi: Fix fractional part of Tx rate by converting to float The Tx rate was previously stored as an integer, which caused loss of precision for rates like 8.6 Mbps or 34.4 Mbps due to integer division. The change will update data type to float. Signed-off-by: Kapil Bhatt --- include/zephyr/net/wifi_mgmt.h | 2 +- subsys/net/l2/wifi/wifi_shell.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index 40dd023839a7d..65609997a8ba4 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -701,7 +701,7 @@ struct wifi_iface_status { /** is TWT capable? */ bool twt_capable; /** The current 802.11 PHY TX data rate (in Mbps) */ - int current_phy_tx_rate; + float current_phy_tx_rate; }; /** @brief Wi-Fi power save parameters */ diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index a62d8e0eb8243..5e0a8ec78fc30 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1489,7 +1489,7 @@ 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 TX rate (Mbps) : %d\n", status.current_phy_tx_rate); + PR("Current PHY TX rate (Mbps) : %.1f\n", (double)status.current_phy_tx_rate); } return 0; From 46f45d69251d33136927a4fa62074e4e60289281 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Tue, 15 Jul 2025 06:58:32 +0000 Subject: [PATCH 2/2] manifest: hostap: Update revision of hostap Update hostap revision to fix tx rate. Signed-off-by: Kapil Bhatt --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3634554334c3a..a7d1c6244f487 100644 --- a/west.yml +++ b/west.yml @@ -281,7 +281,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: e942f86e865d5b24bbbe8b0c333f030cbbe62bfb + revision: pull/93/head - name: liblc3 revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183 path: modules/lib/liblc3