aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ctrl_iface.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-08-25 18:02:12 (GMT)
committerJouni Malinen <j@w1.fi>2013-08-25 18:02:12 (GMT)
commit4c559019bd86a8b698d3e8aca83f9566180eba77 (patch)
tree1fa9f3f73c0c4900d003e3722f2a26df784e8ac3 /wpa_supplicant/ctrl_iface.c
parentae8c27f79d39eb428d7d5e22451042bd109f8dea (diff)
downloadhostap-4c559019bd86a8b698d3e8aca83f9566180eba77.zip
hostap-4c559019bd86a8b698d3e8aca83f9566180eba77.tar.gz
hostap-4c559019bd86a8b698d3e8aca83f9566180eba77.tar.bz2
P2P: Add state info to global STATUS command
This can be used for debugging purposes to see what the current P2P module state is. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ctrl_iface.c')
-rw-r--r--wpa_supplicant/ctrl_iface.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 1064f1d..03ffde0 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -6047,9 +6047,17 @@ static int wpas_global_ctrl_iface_status(struct wpa_global *global,
end = buf + buflen;
#ifdef CONFIG_P2P
- if (global->p2p) {
+ if (global->p2p && !global->p2p_disabled) {
ret = os_snprintf(pos, end - pos, "p2p_device_address=" MACSTR
- "\n", MAC2STR(global->p2p_dev_addr));
+ "\n"
+ "p2p_state=%s\n",
+ MAC2STR(global->p2p_dev_addr),
+ p2p_get_state_txt(global->p2p));
+ if (ret < 0 || ret >= end - pos)
+ return pos - buf;
+ pos += ret;
+ } else if (global->p2p) {
+ ret = os_snprintf(pos, end - pos, "p2p_state=DISABLED\n");
if (ret < 0 || ret >= end - pos)
return pos - buf;
pos += ret;