Skip to content

Commit 619cdb6

Browse files
krish2718kartben
authored andcommitted
wifi: Fix current PHY rate handling
Fix the name to include TX and also add units to the shell display. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 2e7f631 commit 619cdb6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ struct wifi_iface_status {
671671
unsigned short beacon_interval;
672672
/** is TWT capable? */
673673
bool twt_capable;
674-
/** The current 802.11 PHY data rate */
675-
int current_phy_rate;
674+
/** The current 802.11 PHY TX data rate (in Kbps) */
675+
int current_phy_tx_rate;
676676
};
677677

678678
/** @brief Wi-Fi power save parameters */

modules/hostap/src/supp_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ int supplicant_status(const struct device *dev, struct wifi_iface_status *status
15381538
ret = z_wpa_ctrl_signal_poll(&signal_poll);
15391539
if (!ret) {
15401540
status->rssi = signal_poll.rssi;
1541-
status->current_phy_rate = signal_poll.current_txrate;
1541+
status->current_phy_tx_rate = signal_poll.current_txrate;
15421542
} else {
15431543
wpa_printf(MSG_WARNING, "%s: Failed to read signal poll info",
15441544
__func__);

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,9 @@ static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[])
11131113
PR("DTIM: %d\n", status.dtim_period);
11141114
PR("TWT: %s\n",
11151115
status.twt_capable ? "Supported" : "Not supported");
1116-
PR("Current PHY rate : %d\n", status.current_phy_rate);
1116+
PR("Current PHY TX rate (Mbps) : %d.%03d\n",
1117+
status.current_phy_tx_rate / 1000,
1118+
status.current_phy_tx_rate % 1000);
11171119
}
11181120

11191121
return 0;

0 commit comments

Comments
 (0)