From patchwork Tue Nov 12 12:10:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 290599 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 0700B2C009D for ; Tue, 12 Nov 2013 23:11:03 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id BAC359C0A4; Tue, 12 Nov 2013 07:10:59 -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 O1I9BRiDw7do; Tue, 12 Nov 2013 07:10:59 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 940E09C088; Tue, 12 Nov 2013 07:10:51 -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 34C989C0AA for ; Tue, 12 Nov 2013 07:10:50 -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 WzsQ2EwhMKCk for ; Tue, 12 Nov 2013 07:10:45 -0500 (EST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) (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 C114A9C087 for ; Tue, 12 Nov 2013 07:10:44 -0500 (EST) Received: by mail-la0-f42.google.com with SMTP id ec20so2586093lab.15 for ; Tue, 12 Nov 2013 04:10:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=FuUwcpbsaYZBYzYhCFHWScPtViSOI6gEVI0VcGWLZSo=; b=TASVDPlURJwiSDjfZQtQXXdwjo4VBRBCXuc9Zojys9z1Xt0ryq2zlPrAHWRRjyh0dS mbR+WCvx5OyuUTerkYiIGeo4kH7iQBwXsF319WC30fu4FhpJD82lUx6vLNWxA5/Pc1na ZWDhvs9UrqJyDuzUQl0PEDIZONhp6gDip6MxKeZtgXCK03ZGuU3DOFHdBoF0beiDyVcS RgKoIv78hwv+smtoTzhlbjCR+RhBa32Fkiw1kSdA3YcbpSyDyaHanWT6+c5LE8xDIeNa qX08s04FKIbbbVV+RDroH7ipwTjD3r2jY5J19m3Z8f6uQhZtyPQ6EMEtw/Cw7H3Ks0bo kb8w== X-Received: by 10.152.10.99 with SMTP id h3mr27407691lab.13.1384258243192; Tue, 12 Nov 2013 04:10:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.136.162 with HTTP; Tue, 12 Nov 2013 04:10:23 -0800 (PST) In-Reply-To: References: <20131022130327.GB11408@w1.fi> From: Jithu Jance Date: Tue, 12 Nov 2013 17:40:23 +0530 Message-ID: Subject: Re: [PATCH 1/1] STA: Request new scan only for the original interface 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, On Fri, Nov 8, 2013 at 10:10 AM, Jithu Jance wrote: > Hi Jouni, > > > Maybe an additional "int own_request" argument for >> wpas_select_network_from_last_scan() and using that to determine whether >> to start the scan request at the end of the selected == NULL && ssid == >> NULL case? > > > Makes sense. Thanks for your feedback. I will change the patch accordingly > and resubmit it. > > Kindly see whether the below patch is fine. Signed-hostap: Jithu Jance --- wpa_supplicant/events.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) struct wpa_ssid *ssid = NULL; @@ -1342,7 +1342,12 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s, wpa_supplicant_associate(wpa_s, NULL, ssid); if (new_scan) wpa_supplicant_rsn_preauth_scan_results(wpa_s); - } else { + } else if (own_request) { + /* + * No SSID found. If SCAN results are as a result of + * own scan request and not due to a scan request on + * another shared interface, try another scan. + * */ int timeout_sec = wpa_s->scan_interval; int timeout_usec = 0; #ifdef CONFIG_P2P @@ -1446,7 +1451,7 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s) return -1; } - return wpas_select_network_from_last_scan(wpa_s, 0); + return wpas_select_network_from_last_scan(wpa_s, 0, 1); #endif /* CONFIG_NO_SCAN_PROCESSING */ } -- 1.7.9.5 *> Jithu Jance* diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 4493772..ae2c07c 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -46,7 +46,7 @@ #ifndef CONFIG_NO_SCAN_PROCESSING static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s, - int new_scan); + int new_scan, int own_request); #endif /* CONFIG_NO_SCAN_PROCESSING */ @@ -1302,12 +1302,12 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, wpa_scan_results_free(scan_res); - return wpas_select_network_from_last_scan(wpa_s, 1); + return wpas_select_network_from_last_scan(wpa_s, 1, own_request); } static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s, - int new_scan) + int new_scan, int own_request) { struct wpa_bss *selected;