From patchwork Wed Jan 18 21:51:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 136697 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 DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0A387B6EFF for ; Thu, 19 Jan 2012 08:52:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B091717C031; Wed, 18 Jan 2012 16:52:21 -0500 (EST) 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 iu0gLmLZZnZB; Wed, 18 Jan 2012 16:52:21 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A303017C034; Wed, 18 Jan 2012 16:52:17 -0500 (EST) 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 5715B9C2E4 for ; Wed, 18 Jan 2012 16:52:16 -0500 (EST) 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 dHA0nRJdNpO1 for ; Wed, 18 Jan 2012 16:52:11 -0500 (EST) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4589F9C247 for ; Wed, 18 Jan 2012 16:52:11 -0500 (EST) Received: from [10.16.192.224] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Wed, 18 Jan 2012 14:01:13 -0800 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from SJEXCHCCR01.corp.ad.broadcom.com ([10.252.49.130]) by SJEXCHHUB01.corp.ad.broadcom.com ([10.16.192.224]) with mapi; Wed, 18 Jan 2012 13:52:00 -0800 From: "Jithu Jance" To: "hostap@lists.shmoo.com" Date: Wed, 18 Jan 2012 13:51:59 -0800 Subject: [PATCH] P2P: Notify upper framework on stopping the p2p_find(SEARCH) Thread-Topic: [PATCH] P2P: Notify upper framework on stopping the p2p_find(SEARCH) Thread-Index: AQHM1iqoAOaQZWriFUaFPNUSqSHWMA== Message-ID: <6C370B347C3FE8438C9692873287D2E1195AE35DA4@SJEXCHCCR01.corp.ad.broadcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 63099EA33DS17192496-01-01 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 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 This patch notifies the upper framework that an on-going discovery has been stopped. This is useful in cases where a p2p_find with a timeout value initiated by the upper framework has been finished or when the framework initiated "p2p_find" is stopped by a "p2p_connect". Signed-hostap: Jithu Jance --- src/common/wpa_ctrl.h | 1 + src/p2p/p2p.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 6cd9de5..d13ba02 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -128,6 +128,7 @@ extern "C" { #define P2P_EVENT_SERV_DISC_RESP "P2P-SERV-DISC-RESP " #define P2P_EVENT_INVITATION_RECEIVED "P2P-INVITATION-RECEIVED " #define P2P_EVENT_INVITATION_RESULT "P2P-INVITATION-RESULT " +#define P2P_EVENT_FIND_STOPPED "P2P-FIND-STOPPED " #define INTERWORKING_AP "INTERWORKING-AP " #define INTERWORKING_NO_MATCH "INTERWORKING-NO-MATCH " diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index e61e133..d9db956 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -17,6 +17,7 @@ #include "common.h" #include "eloop.h" #include "common/ieee802_11_defs.h" +#include "common/wpa_ctrl.h" #include "common/ieee802_11_common.h" #include "wps/wps_i.h" #include "p2p_i.h" @@ -994,6 +995,10 @@ void p2p_stop_find_for_freq(struct p2p_data *p2p, int freq) wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Stopping find"); eloop_cancel_timeout(p2p_find_timeout, p2p, NULL); p2p_clear_timeout(p2p); + if(p2p->state == P2P_SEARCH) { + wpa_printf(MSG_DEBUG, "P2P-FIND-STOPPED"); + wpa_msg(p2p->cfg->msg_ctx, MSG_INFO, P2P_EVENT_FIND_STOPPED); + } p2p_set_state(p2p, P2P_IDLE); p2p_free_req_dev_types(p2p); p2p->start_after_scan = P2P_AFTER_SCAN_NOTHING; -- 1.7.4.1 d-off-by: Jithu Jance --- src/common/wpa_ctrl.h | 1 + src/p2p/p2p.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 6cd9de5..d13ba02 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -128,6 +128,7 @@ extern "C" { #define P2P_EVENT_SERV_DISC_RESP "P2P-SERV-DISC-RESP " #define P2P_EVENT_INVITATION_RECEIVED "P2P-INVITATION-RECEIVED " #define P2P_EVENT_INVITATION_RESULT "P2P-INVITATION-RESULT " +#define P2P_EVENT_FIND_STOPPED "P2P-FIND-STOPPED " #define INTERWORKING_AP "INTERWORKING-AP " #define INTERWORKING_NO_MATCH "INTERWORKING-NO-MATCH " diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index e61e133..d9db956 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -17,6 +17,7 @@ #include "common.h" #include "eloop.h" #include "common/ieee802_11_defs.h" +#include "common/wpa_ctrl.h" #include "common/ieee802_11_common.h" #include "wps/wps_i.h" #include "p2p_i.h" @@ -994,6 +995,10 @@ void p2p_stop_find_for_freq(struct p2p_data *p2p, int freq) wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Stopping find"); eloop_cancel_timeout(p2p_find_timeout, p2p, NULL); p2p_clear_timeout(p2p); + if(p2p->state == P2P_SEARCH) { + wpa_printf(MSG_DEBUG, "P2P-FIND-STOPPED"); + wpa_msg(p2p->cfg->msg_ctx, MSG_INFO, P2P_EVENT_FIND_STOPPED); + } p2p_set_state(p2p, P2P_IDLE); p2p_free_req_dev_types(p2p); p2p->start_after_scan = P2P_AFTER_SCAN_NOTHING;