Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 3 additions & 10 deletions modules/hostap/src/supp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,9 +1538,11 @@
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__);
}

Check notice on line 1545 in modules/hostap/src/supp_api.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

modules/hostap/src/supp_api.c:1545 - __func__); + __func__);
}

conn_info = os_zalloc(sizeof(struct wpa_conn_info));
Expand All @@ -1567,15 +1569,6 @@
}

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

Check notice on line 1118 in subsys/net/l2/wifi/wifi_shell.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/net/l2/wifi/wifi_shell.c:1118 - PR("Current PHY TX rate (Mbps) : %d.%03d\n", - status.current_phy_tx_rate / 1000, + PR("Current PHY TX rate (Mbps) : %d.%03d\n", status.current_phy_tx_rate / 1000,
}

return 0;
Expand Down
Loading