[PATCH 1/1] P2P: Clear the discovery state incase of deffered GO Neg response

Jithu Jance jithu at broadcom.com
Thu Aug 7 06:28:58 EDT 2014


After sending out GO Neg response with status=1, clear the p2p
discovery state. This will help in allowing the legacy STA scan's
to proceed (concurrent case). Also the P2P-FIND-STOPPED event will
help to sync the userspace. Another option is to resume the SEARCH
or LISTEN, but doesn't make much sense since we are waiting for the
user input (p2p_connect command).
Signed-off-by: Jithu Jance <jithu at broadcom.com>
---
 src/p2p/p2p.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 565cbdb..22ec6cf 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -3034,8 +3034,16 @@ static void p2p_go_neg_resp_failure_cb(struct p2p_data *p2p, int success,
 		struct p2p_device *dev;
 		dev = p2p_get_device(p2p, addr);
 		if (dev &&
-		    dev->status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE)
+		    dev->status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE) {
 			dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE;
+			if ((p2p->state == P2P_SEARCH) || (p2p->state == P2P_LISTEN_ONLY)) {
+				/* Clear our search state or Listen state since now the peer is
+				 * awaiting response from our side.
+				 */
+				p2p_dbg(p2p, "Clear the P2P discovery state");
+				p2p_stop_find(p2p);
+			}
+		}
 	}
 }

--
1.7.9.5



More information about the HostAP mailing list