From patchwork Mon Aug 11 10:25:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bojan Prtvar X-Patchwork-Id: 378940 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]) by ozlabs.org (Postfix) with ESMTP id 7F159140141 for ; Mon, 11 Aug 2014 20:25:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A19A09D2AA; Mon, 11 Aug 2014 06:25:28 -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 SuJD7pEl-jTT; Mon, 11 Aug 2014 06:25:28 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DA0069D29E; Mon, 11 Aug 2014 06:25:22 -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 8537F17C021 for ; Mon, 11 Aug 2014 06:25:19 -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 Ps-BqSbD5VOG for ; Mon, 11 Aug 2014 06:25:12 -0400 (EDT) Received: from mail.rt-rk.com (mx2.rt-rk.com [89.216.37.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id ADC6D9D29E for ; Mon, 11 Aug 2014 06:25:12 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id AFAA81A2061 for ; Mon, 11 Aug 2014 12:25:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com Received: from mail.rt-rk.com ([127.0.0.1]) by localhost (mail.rt-rk.com [127.0.0.1]) (amavisd-new, port 10026) with LMTP id QYJeC3EuxsGI for ; Mon, 11 Aug 2014 12:25:09 +0200 (CEST) Received: from mcs13.domain.local (mcs13.domain.local [192.168.227.45]) by mail.rt-rk.com (Postfix) with ESMTPSA id 9D3D01A1D0F for ; Mon, 11 Aug 2014 12:25:09 +0200 (CEST) Date: Mon, 11 Aug 2014 12:25:03 +0200 From: Bojan Prtvar To: hostap@lists.shmoo.com Subject: [PATCH] wpa_supplicant: Use freq_list scan filtar in sched_scan Message-ID: <20140811102502.GA65664@mcs13.domain.local> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Global freq_list scan filtar was taken into account only by req_scan and not by req_sched_scan. We want to allow the user to limit the channels that wpa_supplicant will scan in req_sched_scan requests as well. Signed-off-by: Bojan Prtvar --- wpa_supplicant/scan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 40eb8d8..ec80877 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1244,6 +1244,13 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) if (wpa_s->conf->filter_rssi) params.filter_rssi = wpa_s->conf->filter_rssi; + /* See if user specified frequencies. If so, scan only those. */ + if (wpa_s->conf->freq_list && !params.freqs) { + wpa_dbg(wpa_s, MSG_DEBUG, + "Optimize scan based on conf->freq_list"); + int_array_concat(¶ms.freqs, wpa_s->conf->freq_list); + } + scan_params = ¶ms; scan: