[PATCH v2] Extend STATUS command with frequency information

Bojan Prtvar bojan.prtvar
Sat Sep 13 09:24:04 PDT 2014


This makes 'wpa_cli status' command more versatile.

Signed-off-by: Bojan Prtvar <bojan.prtvar at rt-rk.com>
---
v2: Style simplified

 wpa_supplicant/ctrl_iface.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index f612b49..bd54676 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -1539,6 +1539,11 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
 		if (ret < 0 || ret >= end - pos)
 			return pos - buf;
 		pos += ret;
+		ret = os_snprintf(pos, end - pos, "freq=%d\n",
+				wpa_s->assoc_freq);
+		if (ret < 0 || ret >= end - pos)
+			return pos - buf;
+		pos += ret;
 		if (ssid) {
 			u8 *_ssid = ssid->ssid;
 			size_t ssid_len = ssid->ssid_len;
-- 
1.9.1.286.g5172cb3




More information about the Hostap mailing list