From patchwork Mon Nov 5 09:45:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Spinadel, David" X-Patchwork-Id: 197174 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 BB0DC2C008D for ; Mon, 5 Nov 2012 20:45:25 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5A7C49CD9E; Mon, 5 Nov 2012 04:45:22 -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 u-6NEKRZz821; Mon, 5 Nov 2012 04:45:22 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9EDBC9CDCC; Mon, 5 Nov 2012 04:45: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 A19C79CDCC for ; Mon, 5 Nov 2012 04:45: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 fwd4mCzruJDx for ; Mon, 5 Nov 2012 04:45:11 -0500 (EST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 32AAA9CD9E for ; Mon, 5 Nov 2012 04:45:11 -0500 (EST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 05 Nov 2012 01:45:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,713,1344236400"; d="scan'208,217";a="215247687" Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228]) by orsmga001.jf.intel.com with ESMTP; 05 Nov 2012 01:45:08 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.22.143) by FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 5 Nov 2012 01:45:07 -0800 Received: from hasmsx151.ger.corp.intel.com (10.184.195.9) by fmsmsx119.amr.corp.intel.com (10.18.22.143) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 5 Nov 2012 01:45:07 -0800 Received: from hasmsx152.ger.corp.intel.com ([169.254.3.13]) by HASMSX151.ger.corp.intel.com ([169.254.3.244]) with mapi id 14.01.0355.002; Mon, 5 Nov 2012 11:45:04 +0200 From: "Spinadel, David" To: "hostap@lists.shmoo.com" Subject: [RFC] wpa_supplicant: set prev_sched_ssid only if needed Thread-Topic: [RFC] wpa_supplicant: set prev_sched_ssid only if needed Thread-Index: Ac27KzU3pEASFIrETKOV5Heqn8g2VQ== Date: Mon, 5 Nov 2012 09:45:03 +0000 Message-ID: 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 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. 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; }