Skip to content

Commit

Permalink
wifi: Fix current PHY rate handling
Browse files Browse the repository at this point in the history
Fix the name to include TX and also add units to the shell display.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and kartben committed Nov 29, 2024
1 parent 2e7f631 commit 619cdb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/zephyr/net/wifi_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion modules/hostap/src/supp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ 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_rate = signal_poll.current_txrate;
status->current_phy_tx_rate = signal_poll.current_txrate;
} else {
wpa_printf(MSG_WARNING, "%s: Failed to read signal poll info",
__func__);
Expand Down
4 changes: 3 additions & 1 deletion subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 619cdb6

Please sign in to comment.