From patchwork Tue May 13 05:27:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 348232 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 C12D51400D5 for ; Tue, 13 May 2014 15:28:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DAD909C200; Tue, 13 May 2014 01:28:23 -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 IGC1QHqj-VZN; Tue, 13 May 2014 01:28:23 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A928B9C12F; Tue, 13 May 2014 01:28:07 -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 D09C19C12F for ; Tue, 13 May 2014 01:28:05 -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 oDiwDISFH-BH for ; Tue, 13 May 2014 01:27:58 -0400 (EDT) Received: from mail2.candelatech.com (mail2.candelatech.com [208.74.158.173]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DF9F19C11D for ; Tue, 13 May 2014 01:27:56 -0400 (EDT) Received: from build-32.candelatech.com (firewall.candelatech.com [70.89.124.249]) by mail2.candelatech.com (Postfix) with ESMTP id 7B44D40A339; Mon, 12 May 2014 22:27:56 -0700 (PDT) From: greearb@candelatech.com To: hostap@lists.shmoo.com Subject: [RFC 2/3] scan: Make scan-on-channel and min-scan-gap work more often. Date: Mon, 12 May 2014 22:27:51 -0700 Message-Id: <1399958872-29628-2-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1399958872-29628-1-git-send-email-greearb@candelatech.com> References: <1399958872-29628-1-git-send-email-greearb@candelatech.com> Cc: Ben Greear 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: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Ben Greear Optimizing this breaks ath10k though, so keep it disabled on when system is not configured for concurrent connections, even though this logic should only increase the speed at which we can connect, not actually do concurrent connections. Signed-off-by: Ben Greear --- wpa_supplicant/events.c | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 0a1d50d..4f95acc 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1341,17 +1341,6 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, os_get_reltime(&t); wpa_s->last_scan_rx_sec = t.sec; - /* Now, *if* we have (another) scan scheduled, and a min-scan-gap - * configured, make sure it happens after the minimum time. Since - * one STA's scan results can be propagated to other STA on the - * same radio, this is actually a common case. - */ - if (wpa_s->conf->min_scan_gap && - eloop_is_timeout_registered(wpa_supplicant_scan, wpa_s, NULL)) { - /* Min gap will be applied as needed */ - wpa_dbg(wpa_s, MSG_DEBUG, "Re-requesting scan to apply min-gap"); - wpa_supplicant_req_scan(wpa_s, 1, 0); - } wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available (own=%u ext=%u)", wpa_s->own_scan_running, wpa_s->external_scan_running); @@ -1367,6 +1356,25 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, wpas_notify_scan_done(wpa_s, 1); + /* Now, *if* we have (another) scan scheduled, and a min-scan-gap + * configured, make sure it happens after the minimum time. Since + * one STA's scan results can be propagated to other STA on the + * same radio, this is actually a common case. + */ + if (wpa_s->conf->min_scan_gap && + eloop_is_timeout_registered(wpa_supplicant_scan, wpa_s, NULL)) { + /* Min gap will be applied as needed */ + wpa_dbg(wpa_s, MSG_DEBUG, "Re-requesting scan to apply min-gap/scan-on-freq"); + /* To temporarily work around ath10k bug, only cancel existing + * if we are configured to allow concurrent associations. + */ + if (wpa_s->conf->concurrent_assoc_ok) { + /* Cancel any existing scan request */ + wpa_supplicant_cancel_scan(wpa_s); + } + wpa_supplicant_req_scan(wpa_s, 1, 0); + } + if (!wpa_s->own_scan_running && wpa_s->external_scan_running) { wpa_dbg(wpa_s, MSG_DEBUG, "Do not use results from externally requested scan operation for network selection"); wpa_scan_results_free(scan_res);