From patchwork Thu Aug 7 10:28:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 377808 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 329AA140085 for ; Thu, 7 Aug 2014 20:29:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 988259D22A; Thu, 7 Aug 2014 06:29:16 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uKncoY0-7RHz; Thu, 7 Aug 2014 06:29:16 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A41E09D225; Thu, 7 Aug 2014 06:29:10 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 154E59D225 for ; Thu, 7 Aug 2014 06:29:09 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YDaIxw3UtGm6 for ; Thu, 7 Aug 2014 06:29:02 -0400 (EDT) Received: from mail-gw3-out.broadcom.com (mail-gw3-out.broadcom.com [216.31.210.64]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2A5939D218 for ; Thu, 7 Aug 2014 06:29:01 -0400 (EDT) X-IronPort-AV: E=Sophos;i="5.01,817,1400050800"; d="scan'208";a="41601931" Received: from irvexchcas06.broadcom.com (HELO IRVEXCHCAS06.corp.ad.broadcom.com) ([10.9.208.53]) by mail-gw3-out.broadcom.com with ESMTP; 07 Aug 2014 03:41:17 -0700 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS06.corp.ad.broadcom.com (10.9.208.53) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 7 Aug 2014 03:29:00 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.174.1; Thu, 7 Aug 2014 03:29:00 -0700 Received: from jithu?broadcom.com (dhcp-blr-25-121.ban.broadcom.com [10.132.25.121]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id B9F179F9F9 for ; Thu, 7 Aug 2014 03:28:59 -0700 (PDT) Date: Thu, 7 Aug 2014 15:58:58 +0530 From: Jithu Jance To: Subject: [PATCH 1/1] P2P: Clear the discovery state incase of deffered GO Neg response Message-ID: <65d5f9e18f252cc5cc2075828ebef9abb77c5b06.1407407258.git.jithu@broadcom.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com 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 --- src/p2p/p2p.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 1.7.9.5 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); + } + } } }