From patchwork Tue Nov 8 10:36:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Garg X-Patchwork-Id: 124316 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 70E7AB6F7E for ; Tue, 8 Nov 2011 21:36:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 41CE99C1A4; Tue, 8 Nov 2011 05:36:52 -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 1zLrZ+LrkMWc; Tue, 8 Nov 2011 05:36:52 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id EA22F9C20F; Tue, 8 Nov 2011 05:36:47 -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 944439C20F for ; Tue, 8 Nov 2011 05:36:46 -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 u6UNgfYc7gBZ for ; Tue, 8 Nov 2011 05:36:41 -0500 (EST) Received: from MMS3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 230A09C1A4 for ; Tue, 8 Nov 2011 05:36:41 -0500 (EST) Received: from [10.16.192.232] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Tue, 08 Nov 2011 02:43:15 -0800 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from SJEXCHCCR02.corp.ad.broadcom.com ([10.16.192.130]) by SJEXCHHUB02.corp.ad.broadcom.com ([10.16.192.232]) with mapi; Tue, 8 Nov 2011 02:36:28 -0800 From: "Neeraj Kumar Garg" To: "hostap@lists.shmoo.com" Date: Tue, 8 Nov 2011 02:36:18 -0800 Subject: [PATCH] P2P return a successful response for p2p presence request if driver has return noa_len greater than 0 Thread-Topic: [PATCH] P2P return a successful response for p2p presence request if driver has return noa_len greater than 0 Thread-Index: AcyeAj+//LEBKxklTK6D7dtk59jpbA== Message-ID: <2C2F1EBA8050E74EA81502D5740B4BD6BBA9D30FAD@SJEXCHCCR02.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: 62A7D8493IW2647365-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: , Mime-version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Hello Jouni, Sorry for sending this patch again. Please let me know if the patch requires modifications. If the driver returns a valid noa attribute and curr_noa_len > 0, we should return P2P Presence response as P2P_SC_SUCCESS instead of UNABLE_TO_ACCODATE. The problem is p2p_process_presence_req takes the status response from p2p_group_presence_req function and then puts this status in P2P Presence response. With the present code, if curr_noa_len==0, then only we send a SUCCESS response. I agree that calling function p2p_group_presence_req() is not required as we are anyways again calling get_noa in the function p2p_process_presence_req. But then alternatively, we should not use status variable to send the P2P presence response OR status variable should be dependent upon get_noa call in function p2p_process_presence_req. --- src/p2p/p2p_group.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) mode change 100644 => 100755 src/p2p/p2p_group.c Regards, -Neeraj diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c old mode 100644 new mode 100755 index 58b24c5..d60f6c0 --- a/src/p2p/p2p_group.c +++ b/src/p2p/p2p_group.c @@ -658,7 +658,7 @@ u8 p2p_group_presence_req(struct p2p_group *group, curr_noa_len); /* TODO: properly process request and store copy */ - if (curr_noa_len > 0) + if (curr_noa_len < 0) return P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE; return P2P_SC_SUCCESS;