From patchwork Wed Jan 7 12:18:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Decostre X-Patchwork-Id: 426204 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 1D6A814009B for ; Wed, 7 Jan 2015 23:24:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2A2F917C028; Wed, 7 Jan 2015 07:24:38 -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 I54xbSu2EGJh; Wed, 7 Jan 2015 07:24:37 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2CB0A9D28A; Wed, 7 Jan 2015 07:24:33 -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 CBA3E9D28A for ; Wed, 7 Jan 2015 07:24:31 -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 urkhI5gkLmA9 for ; Wed, 7 Jan 2015 07:24:26 -0500 (EST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) (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 535DB9D288 for ; Wed, 7 Jan 2015 07:24:26 -0500 (EST) Received: by mail-wi0-f172.google.com with SMTP id n3so7351277wiv.5 for ; Wed, 07 Jan 2015 04:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=o6jS9s8b2jfJb1VgZ4zfTGep+upFEcnxgNvtnBnKCTc=; b=Om13aDyMtjwC8djInF7l8BDXLxX30BrlxrpYm5XjNI3kV0Y6Hxgg5pDBBMbY+G0a+L optwGKe+sWyZB6uby/5rJUzhVsB8Aed5Nsk3NZeyt+iv1TII+QKAdyliT5+Rqt94EwH8 I6Tnfy8TXpHJ0qI/osd10kaAOMl6M9bGynwRsZMmYX3/ipBLlYWRYuIlr8yTC8m8Yy/x 8ifpOJsi4NkNl2+LkV0cY7m7pSE0ZqMb9TKs52xdb1VTFWWpq3HwRRJxKoGe6yYf/hpC 3Wafysmy4Xg3h8W+Rc9S0FAIZVm9YoapNEohPv6ClDmTmQdSglRkLfaxn9M0hVX4fKnv QzqA== X-Received: by 10.180.72.33 with SMTP id a1mr46746912wiv.18.1420633141188; Wed, 07 Jan 2015 04:19:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.243.99 with HTTP; Wed, 7 Jan 2015 04:18:20 -0800 (PST) From: Adrien Decostre Date: Wed, 7 Jan 2015 13:18:20 +0100 Message-ID: Subject: [PATCH] Extend channel list restriction for ACS To: hostap 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 Dear all, The patch below extend the possibility to define channel list restriction for automatic channel selection (ACS) to the case DFS support is not enabled. Best regards From a4b1378661dc5f8de47ac47af8f020cd20f6bd4d Mon Sep 17 00:00:00 2001 From: Adrien Decostre Date: Wed, 7 Jan 2015 13:03:04 +0100 Subject: [PATCH] add the possibility to define a subset of channels used by the ACS engine when not operating on DFS channels --- src/ap/acs.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) struct hostapd_iface *iface) @@ -467,6 +481,9 @@ static void acs_survey_all_chans_intereference_factor( if (!acs_usable_chan(chan)) continue; + if (!is_in_chanlist(iface, chan)) + continue; + wpa_printf(MSG_DEBUG, "ACS: Survey analysis for channel %d (%d MHz)", chan->chan, chan->freq); @@ -542,7 +559,9 @@ acs_find_ideal_chan(struct hostapd_iface *iface) if (chan->flag & HOSTAPD_CHAN_DISABLED) continue; - + + if (!is_in_chanlist(iface, chan)) + continue; /* HT40 on 5 GHz has a limited set of primary channels as per * 11n Annex J */ -- 1.7.9.5 diff --git a/src/ap/acs.c b/src/ap/acs.c index 97cf26f..21d932e 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -454,6 +454,20 @@ static int acs_usable_chan(struct hostapd_channel_data *chan) return 1; } +static int is_in_chanlist(struct hostapd_iface *iface, + struct hostapd_channel_data *chan) +{ + int *entry; + + if (!iface->conf->chanlist) + return 1; + + for (entry = iface->conf->chanlist; *entry != -1; entry++) { + if (*entry == chan->chan) + return 1; + } + return 0; +} static void acs_survey_all_chans_intereference_factor(