From 28d0719ff31de776031f73a13bfe804371588dbe Mon Sep 17 00:00:00 2001 From: Arik Nemtsov Date: Wed, 15 Aug 2012 09:10:19 +0300 Subject: ctrl_iface: allow forcing go_intent during p2p_connect (ANDROID) Allow the p2p_connect command to ignore android p2p concurrency considerations. Use the command line argument "no_p2p_conc" to p2p_connect in order to be able to set the go_intent. For instance: wpa_cli p2p_connect 00:11:22:33:44:55 pbc no_p2p_conc go_intent=3 Signed-off-by: Arik Nemtsov --- wpa_supplicant/ctrl_iface.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 4c21833..7f81938 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3050,6 +3050,9 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, int go_intent = -1; int freq = 0; int pd; +#ifdef ANDROID_P2P + int no_p2p_conc; +#endif /* <"pbc" | "pin" | PIN> [label|display|keypad] * [persistent|persistent=] @@ -3081,6 +3084,9 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, auth = os_strstr(pos, " auth") != NULL; automatic = os_strstr(pos, " auto") != NULL; pd = os_strstr(pos, " provdisc") != NULL; +#ifdef ANDROID_P2P + no_p2p_conc = os_strstr(pos, " no_p2p_conc") != NULL; +#endif pos2 = os_strstr(pos, " go_intent="); if (pos2) { @@ -3119,16 +3125,18 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, } #ifdef ANDROID_P2P - if (p2p_handle_concurrency_conflicts(wpa_s, &go_intent) != 0) { - wpa_printf(MSG_INFO, "P2P: Canceling p2p connect due to " - "single channel concurrency conflicts."); - return -1; - } + if (!no_p2p_conc) { + if (p2p_handle_concurrency_conflicts(wpa_s, &go_intent) != 0) { + wpa_printf(MSG_INFO, "P2P: Canceling p2p connect due " + "to single channel concurrency conflicts."); + return -1; + } - if (join && go_intent == 15) { - wpa_printf(MSG_INFO, "P2P: Canceling p2p join due to " - "single channel concurrency conflicts."); - return -1; + if (join && go_intent == 15) { + wpa_printf(MSG_INFO, "P2P: Canceling p2p join due to " + "single channel concurrency conflicts."); + return -1; + } } #endif -- cgit v1.1