From patchwork Mon Nov 5 13:53:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Spinadel, David" X-Patchwork-Id: 197197 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 C0A832C0081 for ; Tue, 6 Nov 2012 00:53:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 342B09C202; Mon, 5 Nov 2012 08:53: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 tCqR-VuzZCAY; Mon, 5 Nov 2012 08:53:20 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B2B9D9C206; Mon, 5 Nov 2012 08:53:16 -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 4F2EF9C206 for ; Mon, 5 Nov 2012 08:53:15 -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 MfYbdBDOzcZQ for ; Mon, 5 Nov 2012 08:53:10 -0500 (EST) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 740749C202 for ; Mon, 5 Nov 2012 08:53:09 -0500 (EST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 05 Nov 2012 05:53:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,715,1344236400"; d="scan'208,217";a="213591030" Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228]) by azsmga001.ch.intel.com with ESMTP; 05 Nov 2012 05:53:05 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.19.17.220) by FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 5 Nov 2012 05:53:05 -0800 Received: from hasmsx103.ger.corp.intel.com (10.184.198.6) by FMSMSX151.amr.corp.intel.com (10.19.17.220) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 5 Nov 2012 05:53:04 -0800 Received: from hasmsx152.ger.corp.intel.com ([169.254.3.13]) by HASMSX103.ger.corp.intel.com ([169.254.1.252]) with mapi id 14.01.0355.002; Mon, 5 Nov 2012 15:53:02 +0200 From: "Spinadel, David" To: "hostap@lists.shmoo.com" Subject: RE: [RFC] wpa_supplicant: set prev_sched_ssid only if needed Thread-Topic: [RFC] wpa_supplicant: set prev_sched_ssid only if needed Thread-Index: Ac27KzU3pEASFIrETKOV5Heqn8g2VQAMVxlg Date: Mon, 5 Nov 2012 13:53:01 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.184.70.11] MIME-Version: 1.0 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 This one is buggy. Better way is just to add the if (!ssid) wpa_s->prev_sched_ssid = NULL; Before the return, I think. Any suggestions? Thanks, David From: hostap-bounces@lists.shmoo.com [mailto:hostap-bounces@lists.shmoo.com] On Behalf Of Spinadel, David Sent: Monday, November 05, 2012 11:45 To: hostap@lists.shmoo.com Subject: [RFC] wpa_supplicant: set prev_sched_ssid only if needed Hi, There are probably whitespaces problems, sorry. If you want this patch, I will find a way to send it without redundant things. From 119a7496fa0e223adfd17456d1212f7099a55643 Mon Sep 17 00:00:00 2001 From: David Spinadel Date: Mon, 5 Nov 2012 09:46:14 +0200 Subject: [PATCH] wpa_supplicant: set prev_sched_ssid only if needed Set prev_sched_ssid only in case that there is no room for another ssid, and there is at least one more ssid to scan. Otherwise, when enabling or adding a new network during scheduled scan, it will start the next iteration from the last sched ssid, and won't scan for all networks. Signed-off-by: David Spinadel --- wpa_supplicant/scan.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) -- 1.7.1 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index df663bc..38af84c 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -880,7 +880,6 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) wpa_s->sched_scan_timeout = max_sched_scan_ssids * 2; wpa_s->first_sched_scan = 1; ssid = wpa_s->conf->ssid; - wpa_s->prev_sched_ssid = ssid; } if (wildcard) { @@ -929,11 +928,12 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) (wpas_network_disabled(wpa_s, ssid) || !ssid->scan_ssid)); break; + if (!ssid) + wpa_s->prev_sched_ssid = NULL; } } next: - wpa_s->prev_sched_ssid = ssid; ssid = ssid->next; }