From patchwork Wed Aug 20 16:46:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 381735 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 109861400B2 for ; Thu, 21 Aug 2014 02:47:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DE34C17C01F; Wed, 20 Aug 2014 12:47:36 -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 LfXIe3Mjd+Pw; Wed, 20 Aug 2014 12:47:36 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id EF48217C069; Wed, 20 Aug 2014 12:47:30 -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 614DB9D230 for ; Wed, 20 Aug 2014 12:47:29 -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 EyUcGngzd7ED for ; Wed, 20 Aug 2014 12:47:22 -0400 (EDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 7A6F39D226 for ; Wed, 20 Aug 2014 12:47:14 -0400 (EDT) Received: by mail-lb0-f172.google.com with SMTP id z11so7062941lbi.17 for ; Wed, 20 Aug 2014 09:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=jjQsSo/toqH00IRyMcBuJUHnRPSlRg6PJtIJBMOCEgQ=; b=bbwoeYH+NfG2sW+xeepve0I0121sSChllhKEbhda/rK9C8u+98aKzeMOjUkt6sdB7L ns6cIy3/OXn4KYMNQj6HOW7BOOFqzmC8zGcuEK/eW5Daz92Z19gg3Mpx63TDjanGd5rY gwK0RNnJibNZfiVHLVv2P3WHF+L1w6q9vNXxf1wI2wmUr0b0qzuEj9pX3OU3dDYIxxn1 ENd3/HPP9497Q+BE5LwejBaP3SVzc+mVe9tARpoebci/pwND7Wj3LP/GA7a5+OyEA2Fn iwa9NlmVHXuIKatjUvrrazq47JaXr1yLq0ZD+0xjLBvjcv2sqiHKu3hjE2s1vtpRL81e f7Fw== X-Received: by 10.152.5.42 with SMTP id p10mr23234507lap.82.1408553230177; Wed, 20 Aug 2014 09:47:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.171.227 with HTTP; Wed, 20 Aug 2014 09:46:49 -0700 (PDT) From: Jithu Jance Date: Wed, 20 Aug 2014 22:16:49 +0530 Message-ID: Subject: Re: [PATCH 1/1] P2P: Prevent pending_action_tx from truncating extended listen To: "hostap@lists.shmoo.com" 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 Hi Jouni, I overlooked a compilation failure for the previous patch after merging to the local repo (compiled without enabling CONFIG_P2P). Please find the corrected patch attached inline as well as attached. I am facing white space issue in copy-pasting the patch in-line. Is there any work around for the white space issue? I am using gmail in plain-text mode. Signed-off-by: Jithu Jance --- wpa_supplicant/offchannel.c | 7 +++++++ wpa_supplicant/p2p_supplicant.c | 6 +++--- wpa_supplicant/p2p_supplicant.h | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) void wpas_p2p_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ies); diff --git a/wpa_supplicant/offchannel.c b/wpa_supplicant/offchannel.c index 77683b6..17689c5 100644 --- a/wpa_supplicant/offchannel.c +++ b/wpa_supplicant/offchannel.c @@ -12,6 +12,7 @@ #include "common.h" #include "utils/eloop.h" #include "wpa_supplicant_i.h" +#include "p2p_supplicant.h" #include "driver_i.h" #include "offchannel.h" @@ -188,6 +189,12 @@ void offchannel_send_action_tx_status( wpa_s->pending_action_bssid, data, data_len, result); } + + if (wpa_s->p2p_long_listen > 0) { + /* Continue the listen */ + wpa_printf(MSG_DEBUG, "P2P: Continuing long Listen state"); + wpas_p2p_listen_start(wpa_s, wpa_s->p2p_long_listen); + } } diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index d91877c..3a30b1c 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4925,7 +4925,7 @@ void wpas_p2p_remain_on_channel_cb(struct wpa_supplicant *wpa_s, } -static int wpas_p2p_listen_start(struct wpa_supplicant *wpa_s, +int wpas_p2p_listen_start(struct wpa_supplicant *wpa_s, unsigned int timeout) { /* Limit maximum Listen state time based on driver limitation. */ @@ -4954,12 +4954,12 @@ void wpas_p2p_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, wpas_p2p_listen_work_done(wpa_s); if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL) return; + if (wpa_s->p2p_long_listen > 0) + wpa_s->p2p_long_listen -= wpa_s->max_remain_on_chan; if (p2p_listen_end(wpa_s->global->p2p, freq) > 0) return; /* P2P module started a new operation */ if (offchannel_pending_action_tx(wpa_s)) return; - if (wpa_s->p2p_long_listen > 0) - wpa_s->p2p_long_listen -= wpa_s->max_remain_on_chan; if (wpa_s->p2p_long_listen > 0) { wpa_printf(MSG_DEBUG, "P2P: Continuing long Listen state"); wpas_p2p_listen_start(wpa_s, wpa_s->p2p_long_listen); diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplicant.h index 841d6df..a75c467 100644 --- a/wpa_supplicant/p2p_supplicant.h +++ b/wpa_supplicant/p2p_supplicant.h @@ -58,6 +58,8 @@ int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout, const u8 *dev_id, unsigned int search_delay); void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s); int wpas_p2p_listen(struct wpa_supplicant *wpa_s, unsigned int timeout); +int wpas_p2p_listen_start(struct wpa_supplicant *wpa_s, + unsigned int timeout); int wpas_p2p_assoc_req_ie(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, u8 *buf, size_t len, int p2p_group);